link vi to vim
[root@localhost ]# which vi
/usr/bin/vi
[root@localhost ]# mv /usr/bin/vi /usr/bin/vi.old
[root@localhost ]# which vim
/usr/bin/vim
[root@localhost ]# ln -s /usr/bin/vim /usr/bin/vi
Install ctags
1. Download the ctags source package
2. ./configure
3. make
4. make install
5. build tags, ctags -R *.c
Install taglist
1. Download ctags package to ~/.vim
2. Unzip the package
3. cd ~/.vim/doc, start vim, run command helptags . so you can help taglist.txt
4. TlistT to open close function list
tips
Open 3 files at the same time
[root@localhost ]# vi start.c stop.c Makefile
list all buffers
:ls
1 # "Makefile" line 7
2 "start.c" line 1
4 %a "stop.c" line 2
1 # "Makefile" line 7
2 "start.c" line 1
4 %a "stop.c" line 2
switch to the 1st buffer: b1
switch to the next buffer: bn
switch to the previous buffer: bp
open a new buffer: e <filename>
close a buffer: bd
see build error, :e error, !!make all error will input to a new file, easy to search the error
to delete all lines, d}
see line number: set number
don't save buffer: set hidden
copy 1 word to register a: "a y w
yell 1 word from register a: "a p