Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vimrc settings for user dont work for root

Tags:

vim

I have modified the .vimrc file in my user. The settings dont work when i switch to superuser. When i check the contents of the file (using vim editor) i can see the mapped keystrokes of newlines (with all the text extending on the rightside beyond screen on same line), but when i check the contents of .vimrc as root, i see all the text in the same window screen one below the other (this may be a very stupid difference, but that is the only difference i noticed. all the data in the file is same).

i am unable to understand what is wrong and how can i correct it.

like image 407
madD7 Avatar asked Jan 30 '15 12:01

madD7


People also ask

Where is vimrc for root?

vimrc . Normally ~ is /root if you login as root, and is /home/YOURNAME if you login as YOURNAME. i'm config option in /etc/vimrc.

Where should your vimrc file be?

The system vimrc should normally be left unmodified and is located in the $VIM * directory.


1 Answers

root is a user too, when you start vim with root, vim load the root's Home/.vimrc usually it is /root/.vimrc

You can cp or ln -s your user's vimrc to /root if this is a personal desktop machine.

I hope I understood your problem.

like image 126
Kent Avatar answered Oct 19 '22 07:10

Kent