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:
<
Most of the answers in this thread are using plain vim commands which is of course fine but I thought I would provide an extensive answer using a combination of plugins and functions that I find particularly useful (at least some of these tips came from Gary Bernhardt's file navigation tips):
To toggle between the last two file just press twice. I recommend assigning to the spacebar:
nnoremap
For quickly moving around a project the answer is a fuzzy matching solution such as CtrlP. I bind it to for quick access.
In the case I want to see a visual representation of the currently open buffers I use the BufExplorer plugin. Simple but effective.
If I want to browse around the file system I would use the command line or an external utility (Quicklsilver, Afred etc.) but to look at the current project structure NERD Tree is a classic. Do not use this though in the place of 2 as your main file finding method. It will really slow you down. I use the binding .
These should be enough for finding and opening files. From there of course use horizontal and vertical splits. Concerning splits I find these functions particularly useful:
Open new splits in smaller areas when there is not enough room and expand them on navigation. Refer here for comments on what these do exactly:
set winwidth=84
set winheight=5
set winminheight=5
set winheight=999
nnoremap v :111vs
nnoremap s :rightbelow split
set splitright
Move from split to split easily:
nnoremap
nnoremap
nnoremap
nnoremap