However, my .vimrc file is searching for a plugin which only exists in my /home/b/.vim folder. Up until now I have always copied my own /home/b/.vim folder to the root user's area like so:

cp -r /home/b/.vim /root

But unfortunately this contaminates the root account's home folder, and I want to stop doing that (if possible). Can anyone tell me an environment variable, or any trick at all, to run with my own COMPLETE vim environment (including my plugins, etc.) without contaminating root?

Any help is greatly appreciated.

PS - I have gone through the info vim documentation and tried setting VIMRUNTIME VIMRC and other environment variables. They didn't help me, perhaps I was doing something wrong...?

This question came from our site for system and network administrators.

It's a better fit on U&L, IMHO. Please don't ask a new question there but either wait for 5 users to migrate the question or flag it for mod attention.
–
SvenJan 18 '13 at 19:33

Okay I understand. I have the U&L page up, but I won't take any action right now. I was going to post it there but I saw the tags on Server Fault have vim and vimrc in the tags auto-complete, so I figured I'll give Server Fault a try first.
–
Bryan HarrisJan 18 '13 at 19:45

vim -u /home/b/.vimrc maybe ? ~ expands to the home directory of the current user, so /root for root, not /home
–
zecrazytuxJan 18 '13 at 20:04

The directory is technically "clean" that way and its simple enough to setup. I actually do this for a number of configuration files so when I move to a new system I simply copy my /usr/local/etc/ folder to the new machine and set up the links.

My bet is your /home/b/.vimrc plugin path is relative to home directory. When you login as root, those path become relative to /root instead of /home/b. You should be able to modify that manually to absolute path.

I am sorry but I said plugins instead of color schemes... My fault, how can I place a full path to a color scheme? I'm going to start reading through documentation to see if maybe I can figure it out.
–
Bryan HarrisJan 18 '13 at 20:16

Can you post your vimrc? I believe it is still path related.
–
John SiuJan 18 '13 at 20:19

I did this: export VIM=/home/b/.vim Now running vim errors about not finding a file which is normally in /usr/share/vim or someplace like that. Error detected while processing /root/.vimrc: line 13: E484: Can't open file /home/b/.vim/syntax/syntax.vim Press ENTER or type command to continue I put my vimrc on pastebin. I found this vimrc from github somewhere and then commented some of the lines. Sorry if it's hard to read. pastebin.com/0WNqggc6
–
Bryan HarrisJan 18 '13 at 20:34

Here is the same with syntax turned on. Sorry about that: pastebin.com/knkSeemX .
–
Bryan HarrisJan 18 '13 at 20:37

Also just fyi, I got the idea for setting the VIM environment variable from here: stackoverflow.com/questions/5453488/… . Not sure if that was the best way for me to get what I wanted.
–
Bryan HarrisJan 18 '13 at 20:38