2009-03-19

vi or vim - Why the delete key, navigation keys (up, down, left, right), syntax color & a few more other are not working/missing ???

Ever wonder why vi behave weirdly after a new installation of Linux or BSD? Delete key turns the current character into capital, navigation keys adds a newline with random characters, Home & End key does nearly the same, syntax color no longer works (which is eye soring if reading along with a bunch of comments) & other frustration.

That's suppose to be.

Because the default vi (literally) that comes with the default installation is the stripped down version of vim. The usual vim that comes with the more comforting features are still around, just that it needs to be tweak. Or most, install.


Debian or Ubuntu :
apt-get install vim
cp /usr/share/vim/vim71/vimrc_example.vim ~/.vimrc


FreeBSD :
cd /usr/ports/editors/vim; sudo make install clean
cp /usr/local/share/vim/vim72/vimrc_example.vim ~/.vimrc


After the above is down with success, execute the following :
- vi ~/.vimrc <-- as of now, vi still lack of comforting features
- make sure that "syntax on" is NOT commented. Of cause, feel free to browse around for other useful features.
- then,
cat alias vi='vim' >> ~/.bashrc
- restart the current terminal session by login out and login back.

Voilla !!!

No comments: