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

Key bindings for moving lines up/down on Git rebase don't work #6971

Closed
carlosgaldino opened this issue Aug 31, 2016 · 10 comments
Closed

Key bindings for moving lines up/down on Git rebase don't work #6971

carlosgaldino opened this issue Aug 31, 2016 · 10 comments
Labels
- Bug tracker - Git Key Bindings stale marked as a stale issue/pr (usually by a bot) To be reproduced

Comments

@carlosgaldino
Copy link
Contributor

Description

Key bindings for moving lines up/down on Git rebase don't work.

Reproduction guide

  • Start Emacs
  • Visit any project using Git
  • SPC g s
  • r i to rebase interactively
  • C-c in a comit to start the rebase
  • K or J to try to move the commit line up or down, respectively.
    • M-k or M-j as the message in the rebase window show also do not do what is expected (move lines up/down).
    • M-p also does not move the line up

Observed behaviour:
If K is pressed: the command spacemacs/evil-smart-doc-lookup is executed.
If J is pressed: the command evil-join is executed.
If M-k is pressed: the command kill-this-buffer is executed.
If M-j is pressed: the command exchange-point-and-mark is executed.
If M-p is pressed: the command ns-print-buffer is executed.

Expected behaviour:
Move commit line up or down.

System Info

  • OS: darwin
  • Emacs: 24.5.1
  • Spacemacs: 0.105.22
  • Spacemacs branch: master (rev. 9f9faa4)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
((auto-completion :variables
                  '(auto-completion-enable-help-tooltip t))
 ruby haskell syntax-checking git github javascript c-c   markdown org go html rust
 (shell :variables shell-default-shell 'eshell)
 spell-checking themes-megapack erlang theming)

Thank you.

@TheBB
Copy link
Contributor

TheBB commented Aug 31, 2016

I cannot reproduce this on develop with updated packages.

@carlosgaldino
Copy link
Contributor Author

I tried with the develop branch as well and the same issues occur. Could it be the Emacs version I'm using?

Thanks.

@mbertheau
Copy link
Contributor

I have a similar issue: K is spacemacs/evil-smart-doc-lookup and J is evil-join. My window manager rightfully gets all key strokes with M-, so M-k and M-j don't get to emacs.

System Info 💻

  • OS: gnu/linux
  • Emacs: 24.5.1
  • Spacemacs: 0.200.7
  • Spacemacs branch: master (rev. c2774bc)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
((auto-completion :variables auto-completion-enable-help-tooltip t)
 clojure
 (colors :variables colors-colorize-identifiers 'all)
 emacs-lisp git gtags html ibuffer javascript markdown
 (python :variables python-test-runner 'pytest)
 sql syntax-checking version-control yaml)

@mbertheau
Copy link
Contributor

A tedious but functioning workaround is to call the commands directly using SPC : git-rebase-move-line-up and -down respectively.

@joyarzun
Copy link

The same happens to me

  • Spacemcas: 0.200.5
  • Emacs: 25.1.1
  • OS: darwin
  • Editing style: vim
  • Completion: helm
    markdown ruby yaml helm elm emacs-lisp git javascript syntax-checking react

@TheBB
Copy link
Contributor

TheBB commented Jun 14, 2017

I'm still unable to reproduce the original issue.

@mbertheau You have the correct bindings for J and K. M-k and M-j are supposed to move lines.

My window manager rightfully gets all key strokes with M-, so M-k and M-j don't get to emacs.

Rightfully? Common consensus is to keep window manager keys on super. I don't accept that it's a Spacemacs bug to have bindings on the meta key.

It's also easy to modify:

(with-eval-after-load 'git-rebase
  (evil-magit-define-key evil-magit-state 'git-rebase-mode-map "K" 'git-rebase-move-line-up)
  (evil-magit-define-key evil-magit-state 'git-rebase-mode-map "J" 'git-rebase-move-line-down))

@mbertheau
Copy link
Contributor

@TheBB Alright about Meta/Super. Thanks for the snippet. It feels great! :)

Since evil-smart-doc-lookup and evil-join are so much less useful in a rebase buffer than move-line-up/down, it'd make more sense to have the latter on J/K by default.

@Reefersleep
Copy link

I just want to give my thanks for your remapping tip, @TheBB!
I had lots of trouble getting the meta keystrokes to Emacs when I was trying to get work with magit interactive rebase, in trying to use git-rebase-move-line-up and git-rebase-move-line-down. I'm using Spacemacs in Evil mode, and so far, I don't have any other use case for the meta key, so this tip is a godsend! It feels much better and Vim-like to me than I'm sure the meta key combination would have felt :) 👍

@mbertheau
Copy link
Contributor

mbertheau commented Feb 13, 2019

On current develop this code works:

  (with-eval-after-load 'git-rebase
    (define-key git-rebase-mode-map "K" 'git-rebase-move-line-up)
    (define-key git-rebase-mode-map "J" 'git-rebase-move-line-down))

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Bug tracker - Git Key Bindings stale marked as a stale issue/pr (usually by a bot) To be reproduced
Projects
None yet
Development

No branches or pull requests

5 participants