It took tabs a while to grow on me when using Vim. This is mainly due to the flexibility that buffers and split windows provide; however, once I realized tabs could act as a convenient way of grouping split windows, I was sold. There's nothing complicated or confusing about using tabs, but a few mappings will make your life easier. Add the following to your vimrc.
let mapleader = ","
map <leader>tt :tabnew<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
map <leader>tn :tabnext<cr>
map <leader>tp :tabprevious<cr>
I've already been called a n00b once on this blog for not seeing the value of the comma motion (repeat latest f, t, F or T in opposite direction). If you use it regularly, you'll obviously want to choose a different map leader.
Now that your mappings are setup, using tabs should be quick and intuitive.
* Press ,tt to open a new tab
* Press ,tc to close the current tab
* Press ,tm [number] to move to tab [number]
* Press ,tn to move to the next tab
* Press ,tp to move to the previous tab
In standard Vim, the tab list will appear at the top of your editing window. Gvim provides the industry standard GUI tabs. Obviously there are more tab commands available, but these basics should get you pretty far.
Showing posts with label tabs. Show all posts
Showing posts with label tabs. Show all posts
Tuesday, November 25, 2008
Subscribe to:
Posts (Atom)