0

I recently discovered the Vim binding <C-^>, which toggles between the previous buffer and the current buffer.

But I can't find any mention of it in the docs, and it's naturally proven difficult to Google for. What's the Vim function called, or is there something similar which implements a buffer stack?

1
  • I hope you're aware too that you can send it with <kdb>Ctrl</kbd><kbd>6</kbd> in gvim and many terminal emulators. Aug 22, 2012 at 0:18

1 Answer 1

6
:help CTRL-^

or

:help ^^

works for me.

It's not just vim, either. The ^^ toggle-buffer command is is a standard vi feature going all the way back to ancient times.

In vim you also get the ^I and ^O commands which take you along a stack of previous positions, and they can jump from one buffer to another if you reach a point in the history where you had switched buffers.

And then there's :n[ext] :p[rev] and :rew[ind] which move you along the list of files that were named in the original command line. Those are also classical vi (ex) commands. vim adds some commands for altering that list of filenames too. See :help arglist

2
  • Right you are. I was looking for C-^ instead.
    – jogloran
    Aug 21, 2012 at 3:02
  • Also :bn[ext], bp[rev]/bN[ext], br[ewind] for moving between currently-open buffers instead of just ones in the arglist. Aug 22, 2012 at 0:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .