Posted By: Edward Tanguay
I’ve started using Vim to develop Perl scripts and am starting to find it very powerful.
One thing I like is to be able to open multiple files at once with:
vi main.pl maintenance.pl
and then hop between them with:
and see which file are open with:
And to add a file, I can say:
which I expect would then be added to my list of files, but instead it wipes out my current file list and when I type
:args I only have
So how can I add and remove files in my args list?
Why not use tabs (introduced in Vim 7)?
You can switch between tabs with
:tabe <filepath> you can add a new tab; and with a regular
:wq you close a tab.
If you map
: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)