Tagged Questions
1
vote
2answers
53 views
How do I set vim as the default editor when I sudo?
I'm working on a CentOS 5.9 machine, and I simply want to type
sudo vi somefile
and have my trusty vim with syntax highlighting, etc. This seems simple enough, but after many attempts, it's ...
3
votes
1answer
207 views
Only one file name allowed error
Sometimes I forget to do sudo vim and open files to which I don't have write permission. I saw this post and it was really helpful.
When I did :w !sudo tee % it asked me for a password and then the ...
1
vote
2answers
628 views
Problem with vim when logged in as root
When I login as root or edit a file by sudo mode all of the options in my /etc/vimrc are not working (e.g. highlight line-number etc.)
28
votes
4answers
1k views
Becoming root from inside Vim
Sometimes I start editing configuration files in /etc using Vim, but forget to use sudo to start Vim. The inevitable result then is that after finishing my edits I encounter the dreaded notice that I ...
2
votes
2answers
3k views
“No protocol specified” when running vim with sudo
Recently I start to get "No protocol specified" when using sudo vim. It's just a warning I guess, because everything was working normally (I can open, edit and save files). The message doesn't appear ...