1

If I create multiple buffers on gVim (gnome interface for vim), how do I switch buffer ? Vim doc says it's F8 key but it doesn't work...

Any idea ?

Cydonia7
  • 245
  • 1
  • 11
  • Possible duplicate: [how-do-i-edit-an-existing-buffer-in-a-new-tab-in-vim](http://superuser.com/questions/66179/how-do-i-edit-an-existing-buffer-in-a-new-tab-in-vim) –  Jan 15 '12 at 17:33

2 Answers2

4

Switching buffers is done in general with :bp[revious] and :bn[ext] (the part in the brackets being optional). If you don't feel like typing that every time, you can map it to some key, or key combination.

nnoremap <F1> :bp<cr>
nnoremap <F2> :bn<cr>

(feel free to modify to your needs)

If you're thinking about switching between splits, that is done with <C-W> some key, depending on where you want to go. They're all really nicely described in help CTRL-W, but the most commonly used are V and S for splitting, and then C-W C-W (twice) for switching between open splits.

Rook
  • 23,617
  • 32
  • 128
  • 213
0

It depends on how you create those multiple buffers. If they are in multiple windows, then you can switch between windows with Ctrl-W Ctrl-W and related commands. See

:help window-move-cursor

If the bvffers are in multiple tabs, you can switch between tabs with gt and related commands. See

:help gt

Using :helpgrep f8 and :helpgrep F8, I don't find any mention in the Vim docs of F8 being used to switch buffers. What Vim docs are you referring to?

garyjohn
  • 34,610
  • 8
  • 97
  • 89
  • I create buffers using `:split:` or `:vsplit:`. I have found it on a Vim wiki in fact... – Cydonia7 Jan 15 '12 at 18:46
  • In that case you have created new windows, so you can use `Ctrl-W Ctrl-W` to jump to the next window, or `Ctrl-W k` to jump to the window above the current one, for example. There is no default mapping for F8, but you could make your own. Perhaps the wiki mentions such a mapping. – garyjohn Jan 15 '12 at 19:05