I found when i use the command sudo vim /etc/www/main.wsgi
the vim said:
neocomplcache disabled: "sudo vim" is detected and $HOME is set to your user's home. You may want to use the sudo.vim plugin, the "-H" option with "sudo" or set always_set_home in /etc/sudoers instead.
Press ENTER or type command to continue
and when i ENTER and edit file, the neocomplcache seems goes wrong function.
the i search the google, I found the command vim sudo:/etc/www/main.wsgi
but it seems doesn't use my own .vimrc configure file.
so, what you others to do ?
Best Answer
Add following mapping to your
vimrc
:Now edit the protected files as you normally do:
but when you want to save the changes use
:W
instead of:w
,vim
will prompt for asudo
password, enter yoursudo
password and hit Enter. That's it!