Vim Tips Wiki
(Change to TipImported template + severe manual clean)
(Move categories to tip template)
Line 9: Line 9:
 
|version=6.0
 
|version=6.0
 
|rating=30/18
 
|rating=30/18
  +
|category1=
  +
|category2=
 
}}
 
}}
 
I often edit more then one file and do alot of switching between them.
 
I often edit more then one file and do alot of switching between them.

Revision as of 05:05, 25 April 2008

Tip 967 Printable Monobook Previous Next

created August 6, 2005 · complexity basic · author Alexey Vatchenko · version 6.0


I often edit more then one file and do alot of switching between them.

I use Alt-X to quickly switch between buffers, where X is the buffer number 1 to 9.

:map <M-1> :confirm :b1 <CR>
:map <M-2> :confirm :b2 <CR>
...
...
...
:map <M-9> :confirm :b9 <CR>
:map <F3> :confirm :ls <CR>

Comments

number<C-^> is faster. Works great when combined with minibufexpl script#159.


I prefer mapping <Left> and <Right> to :bprev and :bnext.


I added the following lines to my vimrc so I can still use <Left> and <Right> for cursor movement.

" cycle through buffers with <ALT><Left> and <ALT><Right>
:nmap <M-Left> :bprev<CR>
:nmap <M-Right> :bnext<CR>