On 04/08/2010 09:06 PM, joy c wrote:
   How can I have a command .vimrc , plugins and other vim settings
common to both users and root user?

Currently I have everything set up with my username when I su to root
all my vim settings are gone.

Since (for the most part) I'm the only vim-user on my linux boxes that also has root privs (there are some other admins that don't use vim, and other vim users that aren't admin), I usually just use a soft-link:

  t...@rubbish:/home/tim$ su
  r...@rubbish:/home/tim# cd ~
  r...@rubbish:/root# ln -s ~tim/.vimrc ~/.vimrc
  r...@rubbish:/root# ln -s ~tim/.vim ~/.vim

since root is allowed to read anybody's files.

If you have some root-specific things, you could have a vimrc something like

  source /home/tim/.vimrc
  " set other root-specific stuff here...

though it may not find files within ~tim/.vim such as local file-types and color-schemes, so you may have to link that much or twiddle variables.

Another option would be to keep them under version control (such as svn/hg/git/bzr) and then sync them up occasionally. This allows for bidirectional sharing between the two, yet you can edit one (your user or root vimrc) and still cherry-pick to exclude portions when pushing to the other.

I prefer not to mess with the /etc/vimrc on the assumption that by leaving it alone, upgrades won't try to make me think about it.

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe, reply using "remove me" as the subject.

Reply via email to