Switching between files
From Vim Tips Wiki
created 2002 · complexity basic · author Kontra, Gergely · version 6.0
When editing multiple files, it is often necessary to switch from one file to another. That can be done more easily using a mapping, rather than entering a command. This tip maps Ctrl-Tab and Ctrl-Shift-Tab to move forwards or backwards through the available buffers or windows.
If you prefer to work with buffers, you can map the
:bp commands (buffer next, and buffer previous).
nnoremap <C-Tab> :bn<CR> nnoremap <C-S-Tab> :bp<CR>
If you frequently use split windows, you might want to use the Ctrl-W family of commands to switch between windows.
nnoremap <C-Tab> <C-w>w nnoremap <C-S-Tab> <C-w>W
And if you prefer one tab for one buffer, you can map the
:tabp commands (tab next, and tab previous).
nnoremap <C-Tab> :tabn<CR> nnoremap <C-S-Tab> :tabp<CR>
- Easier_buffer_switching - I highly recommend the
<F5>mapping followed by completion with
- :help CTRL-W
- :help :bnext
- :help :bprevious
- :help :tabnext
- :help :tabprevious