atom / vim-mode

Next generation vim support for atom
MIT License
1.72k stars 250 forks source link

Switch to the last used buffer #719

Closed dathinaios closed 6 years ago

dathinaios commented 9 years ago

This is probably my favorite mapping in vim:

nnoremap <leader><leader> <c-^>

I just can't live without it! I have my leader mapped to space and pressing it twice allows me to toggle between two files.

Is there already a way to do that?

bronson commented 9 years ago

This is not so easy because vim-mode doesn't support c-^, and that's because it doesn't have the concept of an alternate file yet. (from vim docs: "mostly the alternate file is the previously edited file").

Emulating countc-^ should be pretty easy... For example, 3c-^ would just switch to the third tab. But that doesn't help this issue. :)

yunake commented 9 years ago

i use :b#<CR> for similar effect in real vim (go to previous buffer). i don't have Atom right now, would this work for you?

dathinaios commented 9 years ago

Thanks guys,

@yunake I'm afraid that did not work...

Also ctrl-u and d is not working for me so... my exploration patience has run out.

Back to Viiiiiiiim... :)

bronson commented 9 years ago

No, wait! It was easier than I thought. I'm about to submit a PR that implements ctrl-^. The code works, just writing the tests now.

Can you explain how ctrl-U and ctrl-D don't work? They work great for me.

dathinaios commented 9 years ago

Thanks!

Not sure what is going on with the ctrl-d ctrl-u

I am using karabiner but I quit it and tried again so not sure what it is... I also tried to disable all packages.

If it persists I will post another issue.

EDIT: I just realised that both shortcuts take me to the start of the line instead.

bronson commented 9 years ago

You're right, ctrl-u and ctrl-d (and ctrl-f and ctrl-b) always move the cursor to column 0. That's a bug worth reporting!

floscr commented 7 years ago

This is a bit late, but I'm now using this package to solve this issue https://github.com/xream/atom-last-buffer

lee-dohm commented 6 years ago

As stated in the README, this package is no longer maintained and is deprecated. We recommend that people use the vim-mode-plus package instead. Because of this, we are archiving this repository and closing all issues and pull requests. Thanks very much for your support and contributions!