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

Rationale: Debugging #16

Closed
jojojames opened this issue Nov 7, 2017 · 7 comments
Closed

Rationale: Debugging #16

jojojames opened this issue Nov 7, 2017 · 7 comments

Comments

@jojojames
Copy link
Collaborator

It'd be good to make some requests too. :)

I'd like to see realgud (especially the shortkey mode keymap) set up for evil.

I don't use realgud yet because I don't have bindings set up and setting it up just to set up bindings for the future is a little daunting.

It'd be great if anyone already had something for realgud. I think the DOOM config might have something for it...

@Ambrevar
Copy link
Collaborator

Ambrevar commented Nov 7, 2017

I recently heard about it and I'm going to give it a try real soon once I leave the realm of Elisp...

@Ambrevar
Copy link
Collaborator

Ambrevar commented Nov 7, 2017

Also see the link of the DOOM config in the readme: it will lead you directly to a file full of bindings.

@jojojames jojojames changed the title Request: realgud Rationale: Debugging Jan 11, 2018
@jojojames
Copy link
Collaborator Author

Hmnn, I'm starting to want to set up some debugger keys. The problem with is really precedence. When a debugger is in play, how much precedence should it have over regular keys (even navigation keys)?

For example, playing with indium today,

(evil-define-key 'normal indium-debugger-mode-map
  "n" 'indium-debugger-step-over
  "i" 'indium-debugger-step-into
  "o" 'indium-debugger-step-out
  "c" 'indium-debugger-resume
  "l" 'indium-debugger-locals
  "s" 'indium-debugger-stack-frames
  "q" 'indium-debugger-resume
  "h" 'indium-debugger-here
  "e" 'indium-debugger-evaluate
  "M-n" 'indium-debugger-next-frame
  "M-p" 'indium-debugger-previous-frame)

The short keys takes over n, i, o, c, l, s, q, h, e (all very good keys in normal state). But you could make the case when a debugger is up, most likely that's the highest priority thing in your workflow.

Some options:

  1. Make these keys longer.

Pro: navigation keys are in tact
Con: I doubt anyone will actually use these keys, they'll probably be too long.

  1. For this particular case (and probably many other), using the capitalized version of these keys might be doable.
    Pro: Same as above (mostly)
    Con: Still seems too long for something that should be relatively easy to do.

  2. Move the common ones like step over/into /next into function keys like popular ides (e.g. F8-F12)

Pro: Mostly helps with the above
Con: Quite a few keys will still have to live somewhere.

  1. Allow debugger keys to take precedence but try to keep the most common keys (e.g. hjkl) intact.

As described above already.

I'm thinking 4 is probably ideal but open to opinions. At some point I'll take a look and add debugger keys for modes that I actually use.

@fbergroth
Copy link
Contributor

Have you considered a separate state or a hydra, rather than hijacking movement keys in normal state?

@jojojames
Copy link
Collaborator Author

The separate state thing I was thinking about before but the number of states might be too excessive. Dunno.

The debug mode being on is already some kind of extra transient state already so I was thinking it might be overkill to use another one.

As for hydra, I use hydra myself but I find launching the hydra and using it not as nice an experience as single key debugging. That and not wanting to use hydra as a dependency is another reason why I didn't consider it.

Overriding some normal keys (maybe not the highest priority keys) have some precedence in emacs already though with edebug, realgud, gdb-mi?, etc kinda taking over in that way.

@jojojames
Copy link
Collaborator Author

Added first pass of both realgud/debugger rationale/debugger keys for indium/realgud.

It actually works fairly well when the given constraints are consistent.

@jojojames
Copy link
Collaborator Author

Closing this for now, if anyone had any other opinions on debugger bindings, feel free to reopen.

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

No branches or pull requests

3 participants