Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
I hope you're aware too that you can send it with <kdb>Ctrl</kbd><kbd>6</kbd> in gvim and many terminal emulators. –  echristopherson Aug 22 '12 at 0:18

1 Answer 1

: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

share|improve this answer
    
Right you are. I was looking for C-^ instead. –  jogloran Aug 21 '12 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. –  echristopherson Aug 22 '12 at 0:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.