Friday, December 7, 2007

switch to vi

It's been a big decision to switch to vi. I have been using emacs for 10 years, it helps me on all the platforms from Windows, Linux to Mac OS X. Emacs lisp is such a powerful language which makes emacs so extensible. I would be miss the use of calender and diary, eshell, and xcscope with emacs.

Switching does not mean emacs is bad, may be I will change back to emacs if failed on vi, it's more like the personal taste. As I learned in these days, cscope, sed, the LaunchBar instead of QuickSilver, I feel I am more fond of "efficiency" instead of beauty.

I still didn't totally change to vi because of the gap of learning vi. Here is some notes I would like to share.

1. open file in vim. I learn vim from tutor, it shows :r to read file content to current file buffer, but did not show me how to open a file to a buffer compared with emacs's ctrl-x ctrl-f command. Here is the result :e with a file name will open the file.

2. text column. As the first experience, I enter some text, but find a line is more than 80 charactors if I don't hit cr to change to a new line, and it is a little annoying. Here is the result :set tw=80 will set textwidth to 80.

3. vimrc. Where is the location of vimrc? It is different on all the platforms, to find it the best way is use :version. In windows, it $VIM/.vimrc, on Linux it is ~/.vim/.vimrc, while on mac os x, it is "~/.vimrc".

4. The insert mode and the normal mode. Still a long way to get used to the normal mode, why the default is set to the normal mode instead of the insert mode? Also learning key strokes on normal mode, for instance, y is for copy, p is for paste, d is for delete and / for search, blah blah.