syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.67k stars 4.89k forks source link

[question] how to make the magit-diff buffer to accept vim-keybinds in commit window? #7080

Closed ninrod closed 8 years ago

ninrod commented 8 years ago

i love the magit commit window. It splits the frame and shows me two windows: one for the commit msg and one with a magit-diff showing me the diffs of my current proposed staged changes. Lovely.

Now suppose that I want to copy a little text snippet that lies in the magit-diff window. I can easily navigate to the magit-diff buffer with SPC w j. But when I choose to copy a word with yiw or simply navigate a char to the right with l, all hell breaks loose because l is bound to some magit hunk staging thing.

So how can I tell magit-diff buffer to behave like a normal buffer, but leave those lovely highlighted diffs untouched?

nixmaniack commented 8 years ago

Two ways:

  1. Set evil-magit-want-horizontal-movement
  2. Toggle magit buffer to text-mode with C-t

If you set evil-magit-want-horizontal-movement to t, you'll get horizontal movement using h/l in magit buffers. It moves other bindings accordingly - h to H, l to L, and L to C-l.

Other option is to toggle the magit buffer temporarily to text-mode using C-t which allows normal movement, copying etc.

Check evil-magit for more information on this.

TheBB commented 8 years ago

@ninrod Considering your enthusiastic response, does this answer your question?

ninrod commented 8 years ago

Oh yes, C-t nailed it.