Switch to original buffer after chasing tags in Emacs

后端 未结 3 628
无人共我
无人共我 2021-01-22 14:33

I use M-. to jump to definitions of class/functions. Sometimes there are multiple classes with the same tag, so I need to use C-u M-. to jump to multip

3条回答
  •  无人及你
    2021-01-22 15:24

    I use winner-mode for this (and other similar situations).

    Add (winner-mode 1) to your init file, and then when you wish to return to the window configuration that you were in before jumping to the tags, you just type:

    C-c to call winner-undo (repeating as many times as necessary)

    If you had visited multiple tags in another buffer, this will get you back to your original buffer (or the previous buffer, at any rate) in a single step, rather than stepping back through the individual tags one by one.

    If the tags have taken you through multiple buffers, then you'll need to type C-c once for each buffer (or C-cC-xzzz... if you'd gone on quite a long detour :)

提交回复
热议问题