我开始使用 Vim 开发 Perl 脚本,并开始发现它非常强大。
我喜欢的一件事是能够使用以下命令同时打开多个文件:
vi main.pl maintenance.pl
然后在它们之间跳转:
:n
:prev
并查看打开哪个文件:
:args
要添加文件,我可以说:
:n test.pl
我希望它会被添加到我的文件列表中,但它会清除我当前的文件列表,当我键入时:args
我只有test.pl
open.
那么如何在参数列表中添加和删除文件呢?
Why not use tabs (introduced in Vim 7)?
You can switch between tabs with :tabn
and :tabp
,
With :tabe <filepath>
you can add a new tab; and with a regular :q
or :wq
you close a tab.
If you map :tabn
and :tabp
to your F7/F8 keys you can easily switch between files.
If there are not that many files or you don't have Vim 7 you can also split your screen in multiple files: :sp <filepath>
. Then you can switch between splitscreens with Ctrl+W and then an arrow key in the direction you want to move (or instead of arrow keys, w for next and W for previous splitscreen)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)