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

New Vim key bindings for Magit #3592

Closed
syl20bnr opened this issue Oct 29, 2015 · 19 comments
Closed

New Vim key bindings for Magit #3592

syl20bnr opened this issue Oct 29, 2015 · 19 comments

Comments

@syl20bnr
Copy link
Owner

Commit 150e38e adds support for custom key bindings for Magit instead of the automatically defined evilified key bindings.

You can post your feedback here or in the official PR thread here: emacs-evil/evil-magit#2 (recommended)

@justbur
Copy link
Contributor

justbur commented Oct 29, 2015

I just noticed the new reset key, #, conflicts with magit-gh-pulls. I like # for reset, but I'm open to suggestions on how to resolve this.

@PierreR
Copy link
Contributor

PierreR commented Oct 29, 2015

I believe it is really useful to be able to switch branches without going through the status buffer and pressing bb. So I have this in my .spacemacs.

(evil-leader/set-key "gc" 'magit-checkout)

Could we offer something similar in the standard spacemacs ?

@justbur
Copy link
Contributor

justbur commented Oct 29, 2015

@PierreR just do a PR for it. Seems reasonable to me. I think this issue was more about the decisions made within evil-magit.

@cpaulik
Copy link
Contributor

cpaulik commented Oct 30, 2015

Having

 (evil-snipe
  :variables
  evil-snipe-enable-alternate-f-and-t-behaviors t)

activated breaks the keybindings for F and f in magit

@TheBB
Copy link
Collaborator

TheBB commented Oct 30, 2015

For magit-gh-pulls and gitflow: well, @ and & are available, if you want to stick to those kinds of keys.

@justbur
Copy link
Contributor

justbur commented Oct 30, 2015

The single letter keys are mostly taken and are more of a pain to move. There are lots of modifier keys available and the "symbols". I like # for reset because of the analogy to gmail but C-r also works for me. I have no idea what the "natural keys" for gh-pulls and gitflow are. If reset is moved the old ones can stay.

@syl20bnr
Copy link
Owner Author

# is the official key binding of magit-gh-pull, would be better to not touch it. We have plenty of room for a reset binding that does not conflict.

@syl20bnr
Copy link
Owner Author

The single letter keys are mostly take and are more of a pain to move.

This is the price to pay for a custom evilification but it seems to worth it.

@syl20bnr
Copy link
Owner Author

C-r also works for me

I like it too. I would not take a Google key binding as a good reference in this context :-D
Otherwise @TheBB proposition of another symbol on the shifted number line could do it.

@justbur
Copy link
Contributor

justbur commented Oct 30, 2015

I think I like C-r the best, but I don't have a strong opinion

@justbur
Copy link
Contributor

justbur commented Oct 30, 2015

for what it's worth reset was on x

@syl20bnr
Copy link
Owner Author

C-x is not available and C-r is more mnemonic, looks good to me.

@justbur
Copy link
Contributor

justbur commented Oct 30, 2015

Ok. I made the change. Doesn't mean I can't change it again.

@syl20bnr
Copy link
Owner Author

If it changes it is for the better :-D

@herbertjones
Copy link
Contributor

Does this mean evilification will be gone completely? Window bindings seem to be gone, if I M-1, instead of jumping to window 1, now it does a magit-section-show-level-1-all and a 2gt tries to switch to "Tracked files" instead of getting intercepted by the eyebrowse layer.

@justbur
Copy link
Contributor

justbur commented Oct 30, 2015

@herbertjones Those bindings were not provided by evilification. They just weren't being shadowed and now they are. It will be impossible to avoid all conflicts, so we'll just have to deal with the important cases. If you think "gt" for jump to tracked files is a bad binding, then propose an alternative. Otherwise we can disable that magit binding for the people who use the eyebrowse layer.

Same goes for the window select one, but it's worth pointing out that SPC 1 works fine

@herbertjones
Copy link
Contributor

No, I'll just override them in my personal config as eyebrowse isn't a default layer. M-1 to M-9 are important to me as shells do not respect SPC-1 but do respect the Alt key.

@justbur
Copy link
Contributor

justbur commented Oct 30, 2015

We can easily override the M-[number] ones in spacemacs, depending on what
@syl20bnr thinks

On Fri, Oct 30, 2015 at 11:20 AM Herbert Jones notifications@github.com
wrote:

No, I'll just override them in my personal config as eyebrowse isn't a
default layer. M-1 to M-9 are important to me as shells do not respect
SPC-1 but do respect the Alt key.


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

@syl20bnr
Copy link
Owner Author

TBH, I'm really divided on these custom evil bindings, for now I want to believe that it worth the work put on them because Magit is such a central piece of the Emacs ecosystem that it could work.

But instead of stopping the leaks I would rather make it possible to easily choose between Magit custom evil key bindings and auto-evilified buffer (which will be my choice obviously :-)).

I see that the work to adapt the help popup of Magit could be applied to the auto-evilifed buffer as well.

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

6 participants