Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evil equivalent for M-, (e.g. xref-pop-marker-stack) #3

Closed
jojojames opened this issue Nov 5, 2017 · 4 comments
Closed

Evil equivalent for M-, (e.g. xref-pop-marker-stack) #3

jojojames opened this issue Nov 5, 2017 · 4 comments

Comments

@jojojames
Copy link
Collaborator

jojojames/evil-integrations#1 (comment)

(3) So M-, is xref-pop-marker-stack and it's available in Evil. M-. is xref-find-definitions which is available in insert state, but in normal state, it's evil-repeat-pop-next.
Either way, this is an Evil's problem, I don't think it belongs to us to solve this.
This is how gd is used in my current bindings:

evil-calendar.el:65:    "gd" 'calendar-goto-date ; "gd" in evil-org-agenda, "gd" in Emacs.
evil-info.el:53:    "gd" 'Info-goto-node
evil-man.el:47:    "gd" 'Man-goto-section
evil-profiler.el:57:    "gd" 'profiler-report-find-entry

In those cases, the xref commands don't apply, so there is no problem. '' or C-o will do what you want.

I think we want a keybind to represent a pop from definition if we're going to use gd for go to definition. If some modes don't have a need for a pop definition, that's fine, but we'd still need one for modes that use it (almost all the programming modes). I don't think " or C-o suffices because they fulfill a different use case.

A quick scenario where you'd need a pop definition key is.

  1. Go To Definition on symbol
  2. Use a jump of some kind (G gg or something else)

" or C-o will go to the last location you were
M-, (Emacs) would bring you to the place where you called Go To Definition

Re: Evil

Yes, I think Evil should have an option to not override M-..

@jojojames
Copy link
Collaborator Author

@Ambrevar I believe the Vim equivalent is C-t.

C-t runs the command pop-tag-mark (found in evil-normal-state-map),
which is an alias for ‘xref-pop-marker-stack’ in ‘etags.el’.

It is bound to C-t.

(pop-tag-mark)

Pop back to where M-x xref-find-definitions was last invoked.

http://vim.wikia.com/wiki/Browsing_programs_with_tags

If there's an available 'pop', we should use C-t.

@Ambrevar
Copy link
Collaborator

Acknowledged, but can you think of any mode that has a dedicated function for popping back?

@jojojames
Copy link
Collaborator Author

Yes, almost all the programming related modes.

@Ambrevar
Copy link
Collaborator

OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants