VIM

CentOS 5 - sudo vi - What happened to my colors?!?

So this was bugging me for a while. Finally I decided to figure out what the heck was going on.

Whenever I wanted to edit a config file while not being logged in as root, I would sudo vi it but all the pretty colors would disappear. If I vi'd it directly without sudo, my vim profile would kick in and the colors would be there. If I logged in as root or su - and then edit the file, the pretty colors would be there....

So I then typed:

[root@lunch ~]# which vi
alias vi='vim'
/usr/bin/vim
[root@lunch ~]# sudo which vi
/bin/vi
[root@lunch ~]#

Making Cygwin Windows VIM Work Right (Backspace, Delete, Arrow Keys)

The default Cygwin installation of VIM just sucks. It makes you think it is broken or buggy, but really there is nothing wrong with it. It just isn't configured right.

If you are experiencing backspace/arrow key inconsistencies with you VIM on Windows, all you have to do is the copy /usr/share/vim/{VIM_VERSION}/vimrc_example.vim to ~/.vimrc

e.g.:
cp /usr/share/vim/vim72/vimrc_example.vim ~/.vimrc

Then launch vi and start loving vi all over again!

Thanks go to:
http://simonmcc.blogspot.com/2005/06/cygwin-vim-rxvt-arrow-key-problems....

Syndicate content