5

I'm trying to change between the active buffer and the alternate buffer with the command Ctrl + ^ as this video explains. However, nothing happens. I'm using a Spanish keyboard and to press the ^ accent, I have to hit Shift therefore I have to type Ctrl + Shift + ^.

As I said nothing happens so is there any other way to do this or could I just map other keys?

Edit: Here you can see the keyboard keyboard.

  • 1
    You can try using Ctrl-V in insert mode to find out what your keys are generating in Vi. See :h i_Ctrl-V. – vappolinario Feb 2 '16 at 21:03
  • Since the '^' is on the same button as the '[' , even if I hit 'Ctrl + shift + ^' or 'Ctrl + ^', I get 'Ctrl + [' (I copied the two combination on a buffer and I got '^[' for both of them) – Wylex Feb 2 '16 at 22:02
8

CTRL-6 can be used to edit the alternate file - tested on OS X by changing the input source from U.S. to Spanish ISO.

If you find yourself wanting to edit the alternate file often, you could consider mapping backspace to edit the alternate file like this:

" 'edit alternate file' convenience mapping
nnoremap <BS> <C-^>
6

Another method to access the alternate file (usually the previous buffer) is the command

:b#

Which should be usable regardless of keyboard/terminal inputs.

  • 1
    It works too but I wanted to be able to do it in normal mode. – Wylex Feb 3 '16 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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