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

magit keybindings for interactive rebase #2174

Closed
justbur opened this issue Jul 2, 2015 · 15 comments
Closed

magit keybindings for interactive rebase #2174

justbur opened this issue Jul 2, 2015 · 15 comments

Comments

@justbur
Copy link
Contributor

justbur commented Jul 2, 2015

Is there some way to change the key binding hints at the bottom since they're wrong? They say "k" for delete commit or something like that for example. But "k" is now move one line up. Also, I couldn't figure out where "k" got remapped to.

@syl20bnr
Copy link
Owner

syl20bnr commented Jul 2, 2015

They are remapped via the macro spacemacs/evilify-map which automatically set wrappers on the next available bindings like k --> K. The wrappers takes care of emacs and evilify state (emacs state key bindings should not be altered).

@justbur
Copy link
Contributor Author

justbur commented Jul 2, 2015

@syl20bnr Can you try it? "K" is not mapped for me, and there's no emacs state to go into ("C-z" does nothing). It seems like a special "magit select" buffer. I don't have time right now to dig into what's going on, but it doesn't seem to be working.

I'm on develop with emacs25.

@justbur
Copy link
Contributor Author

justbur commented Jul 2, 2015

I got in through SPC g s then r e

@syl20bnr
Copy link
Owner

syl20bnr commented Jul 2, 2015

This is because I overload it when passing additonal bindings :-(
https://github.com/syl20bnr/spacemacs/blob/develop/contrib/!source-control/git/packages.el#L191-L201

Weird that it does nothing for you though.

We should put the additional bindings on C-k and C-j then.

@justbur
Copy link
Contributor Author

justbur commented Jul 2, 2015

Some more information. I didn't notice these messages before, although they may not be relevant to this exactly. These are recorded right after SPC g s

(Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-mode-map':
   - `magit-git-command' originally mapped on `:''
(Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-mode-map':
   - `magit-diff-show-or-scroll-up' originally mapped on `SPC''
(Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-blame-mode-map':
   - `magit-diff-show-or-scroll-up' originally mapped on `SPC''
(Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-diff-mode-map':
   - `scroll-up' originally mapped on `SPC''
(Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-log-read-revs-map':
   - `self-insert-command' originally mapped on `SPC''
(Spacemacs) Warning: Auto-evilication could not remap these functions in map `git-rebase-mode-map':
   - `scroll-up-command' originally mapped on `SPC''
(Spacemacs) Warning: Auto-evilication could not remap these functions in map `git-rebase-mode-map':
   - `scroll-up-command' originally mapped on `SPC''

@syl20bnr
Copy link
Owner

syl20bnr commented Jul 2, 2015

This is not related. I'm aware of these warnings, I have to find good
replacements keys for SPC, : and /, for letters it was easy. Any ideas is
welcome.

Le jeudi 2 juillet 2015, Justin Burkett notifications@github.com a écrit :

Some more information. I didn't notice these messages before, although
they may not be relevant to this exactly. These are recorded right after SPC
g s

(Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-mode-map':

  • magit-git-command' originally mapped on:''
    (Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-mode-map':
  • magit-diff-show-or-scroll-up' originally mapped onSPC''
    (Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-blame-mode-map':
  • magit-diff-show-or-scroll-up' originally mapped onSPC''
    (Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-diff-mode-map':
  • scroll-up' originally mapped onSPC''
    (Spacemacs) Warning: Auto-evilication could not remap these functions in map `magit-log-read-revs-map':
  • self-insert-command' originally mapped onSPC''
    (Spacemacs) Warning: Auto-evilication could not remap these functions in map `git-rebase-mode-map':
  • scroll-up-command' originally mapped onSPC''
    (Spacemacs) Warning: Auto-evilication could not remap these functions in map `git-rebase-mode-map':
  • scroll-up-command' originally mapped onSPC''


Reply to this email directly or view it on GitHub
#2174 (comment)
.

-syl20bnr-

@justbur
Copy link
Contributor Author

justbur commented Jul 2, 2015

I don't mind too much where the keybindings go (although I wish "k" for kill could be remapped to "d"). I was more interested in doing something with the comment section, so that it's not completely wrong. Unfortunately it seems to be hardcoded: https://github.com/magit/magit/blob/fb3e25dd776d83d5cb459a183bc128c652375d9e/lisp/git-rebase.el#L341-L367

@syl20bnr
Copy link
Owner

syl20bnr commented Jul 2, 2015

You know like me that there is no such thing has "hardcoded" in elisp ;-)
We can advice it.

If d is free then I see no problem to tweak the map to include it. We can
do it with :bindings of the macro.

Le jeudi 2 juillet 2015, Justin Burkett notifications@github.com a écrit :

I don't mind too much where the keybindings go (although I wish "k" for
kill could be remapped to "d"). I was more interested in doing something
with the comment section, so that it's not completely wrong. Unfortunately
it seems to be hardcoded:
https://github.com/magit/magit/blob/fb3e25dd776d83d5cb459a183bc128c652375d9e/lisp/git-rebase.el#L341-L367


Reply to this email directly or view it on GitHub
#2174 (comment)
.

-syl20bnr-

@justbur
Copy link
Contributor Author

justbur commented Jul 2, 2015

Yes, of course :-)

Any ideas on C-z not working? It would be nice to be able to quickly revert to the default behavior if you get lost in the evil keybindings. Or is it not supposed to work in this case

@syl20bnr
Copy link
Owner

syl20bnr commented Jul 2, 2015

I guess evil has a dedicated variable for the temporary state, we can support it in the wrappers.

@justbur
Copy link
Contributor Author

justbur commented Jul 2, 2015

I'm not sure a temporary state is what I'm thinking about. I can't explain why, but sometimes the vim-like keybindings are more natural to me but other times the emacs-like ones are. Could we maybe have a variable that prevents certain maps from being evilified? I appreciate the effort you put into making a consistent interface, but I still find myself getting lost and confused (maybe that's my problem and not yours).

@justbur
Copy link
Contributor Author

justbur commented Jul 2, 2015

Never mind. That's probably going to make it more complicated.

There's just so many different states now that it's hard to keep track of what's going on sometimes.

@syl20bnr
Copy link
Owner

syl20bnr commented Jul 2, 2015

@justbur you can remove the magit modes from evil-evilified-state-modes and add them to evil-emacs-state-modes so you'll be in emacs state by default and then you'll get stock emacs bindings.
Note that this behavior has not changed, the evilified magit buffers were already in 102 and prior versions.

@justbur
Copy link
Contributor Author

justbur commented Jul 2, 2015

Oh, I didn't know about those variables. Thanks.

Sorry, I wasn't saying something had changed. I was just reporting that the message in the rebase buffer was wrong about the keybindings and that I was having trouble figuring out the right ones. Thanks for your help

@justbur
Copy link
Contributor Author

justbur commented Oct 28, 2015

Resolved with #3578

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

2 participants