Edit Multiple files via vim

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

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值