[SOLVED] Directory for vimrc so it's usable by both root and user foo.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Directory for vimrc so it's usable by both root and user foo.
kernel 2.6.21.5, Slackware 12.0
Hi:
I want to avoid the redundancy of placing .vimrc in both /root and /home/foo. Couldn't it be placed somewhere, say, in /etc and its settings be valid for both root and foo? Regards.
/usr/share/vim/vimrc
System wide Vim initializations.
You will need to remove/rename any .vimrc in user's or root's $HOME for it to only use the system wide one. Also you do _not_ need to reboot. Vim will read files when you run it. If that still fails you can make vim use a config file with the -u switch. Perhaps you can alias it.
The thing with slack is that almost all of the variables mentioned in manuals are empty after installation. In this case, it is $VIM. Command :version says
Quote:
fall-back for $VIM: "/usr/share/vim".
So I wrote the following in /etc/profile:
Code:
VIM="/usr/share/vim"
and this solved the problem as /usr/share/vim/vimrc was already there. I only had to add 'set autoindent' at the end, this being a feature I wanted to add, although it already has a 'set autoindent' command above in that file. But for some reason, it won't get executed. I would have to study the script, and perhaps study a little more bash in order to understand this.
Anyways, the problem's been solved, and I thank you guys. Regards.
EDIT: No great science to understand what happens in /usr/share/vim/vimrc. It just was compiled with support for autocommands, be this whatever it be.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.