syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.68k stars 4.89k forks source link

Feature request: make Ctrl+O (go back) work more #9451

Closed JonathanReeve closed 5 months ago

JonathanReeve commented 7 years ago

In Vim, I use C-o all the time to go back to a previous buffer, but in spacemacs, it only works a fraction of the time. Somtimes SPC-Tab works when C-o doesn't. I expect to be able to use C-o in a variety of contexts, but it seems that depending on the buffer (org-agenda, mu4e-view, etc, etc.) C-o doesn't work.

CeleritasCelery commented 7 years ago

c-o is bound to evil-jump-backwards. If you think the behavior is wrong you should open an issue with emacs-evil/evil.

duianto commented 7 years ago

@JonathanReeve If you open the ex command line, in either Vim or Spacemacs, by pressing :, typing jumps, and pressing RET, then you'll see the list of locations that C-o jumps through.

It doesn't just jump between buffers, but there can be several locations in the same buffer. I'm not completely sure when a jump location is recorded.

If you want to jump forwards with C-i in Spacemacs, like it does in Vim, then you have to set the dotspacemacs-distinguish-gui-tab variable to t, in .spacemacs. It's nil by default, and that makes it behave like TAB.

JonathanReeve commented 7 years ago

The problem is that neither C-o nor :jumps access an actual list of visited locations. They only access the list of locations that evil mode remembers. So @CeleritasCelery, it's not a matter of evil-jump-backwards misbehaving, but rather that spacemacs doesn't implement C-o keybindings or evil-jump-backwards universally, and the jumps list doesn't contain lots of types of buffers. In Vim, C-o is universal, but in spacemacs, it only seems to work in certain contexts. Here are some concrete examples:

Basically C-o works so inconsistently, I have to try to forget about using it and find some more reliable method (SPC b b) of switching between buffers.

bmag commented 7 years ago

@JonathanReeve buffers where C-o doesn't work, are they all evilified buffers by any chance? We don't bind C-o for evilified buffers, so it remains at whatever it used to be. For example, in agenda buffer C-o calls open-line.

In the home buffer (*spacemacs*), going to a recent file doesn't add the buffer to the jump list. This can be a separate bug report.

Are there any other contexts?

(also, please add a description of your system - SPC h d s)

duianto commented 7 years ago

I just noticed that the Helm Mark Ring SPC r m, lists buffers that don't have files associated to them, that might also be an option.

JonathanReeve commented 7 years ago

@bmag, I don't know what an evilified buffer is, but don't you think certain keybindings should be universal across types of buffers? I mean, SPC TAB works in every type of buffer, as far as I can tell. Why can't C-o work the same way? It's like if I want to switch between buffers I have to remember what kind of buffer I'm in.

Here's my system info:

System Info :computer:

bmag commented 7 years ago

@JonathanReeve Of course certain keys should be universal. I don't know why C-o isn't part of those. It may have come up in an older discussion, or maybe it wasn't discussed at all. Currently we don't bind it, but we can change it. (following discussion, if there are any objectives)

You are welcome to open doc/DOCUMENTATION.org and read about evilified buffers.

SPC TAB and C-o work differently because they are different features and rely on different mechanisms behind the scenes.

I'm trying to understand if all the contexts you referred to in the original post are covered by evilified buffers and that *Spacemacs* part. Are there other contexts?

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

henriquenj commented 4 years ago

I think this issue should not be closed. I think C-o should be universal like @JonathanReeve suggests. However it seems that it should't be labeled as a bug, but an improvement, since we still have some discussion to do on how exactly it should behave.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!