简体   繁体   中英

Why ~/.vimrc is not working for vim on ubuntu server

I installed ubuntu server on vmware player. I want to use vim, so I put .vimrc file under my home directory.

But when I open vim , vim is not using the configuration from the file ~/.vimrc .

If I do it the same way on a ubuntu desktop virtual machine, everything works fine.

What did I do wrong in the server environment? What else should I do?

In order to tell if your .vimrc is running at all, put

echom ".vimrc message 1"

On the first line of ~/.vimrc

Then launch vim and type

:messages

in regular mode. If you see ".vimrc message 1", you know that the .vimrc is at least being read ... it may be stopping before it does anything useful, but at least vim is picking it up.

I would also try which vim to see which program is being called when you type vim .

You can capture a full log of a Vim session with vim -V20vimlog . After quitting Vim, examine the vimlog log file. It will show where Vim searched.

Does Vim correctly detect your home directory? :echo $HOME will tell you.

Also, read :help .vimrc for details on the resolution and locations of .vimrc .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM