Define keymaps the right way.
This commit is contained in:
parent
e4aceaf6b8
commit
e19bea5bf1
1 changed files with 39 additions and 41 deletions
80
magit.el
80
magit.el
|
@ -206,33 +206,32 @@
|
|||
|
||||
;;; Mode
|
||||
|
||||
(defvar magit-mode-map nil)
|
||||
|
||||
(when (not magit-mode-map)
|
||||
(setq magit-mode-map (make-keymap))
|
||||
(suppress-keymap magit-mode-map)
|
||||
(define-key magit-mode-map (kbd "g") 'magit-status)
|
||||
(define-key magit-mode-map (kbd "s") 'magit-stage-thing-at-point)
|
||||
(define-key magit-mode-map (kbd "S") 'magit-stage-all)
|
||||
(define-key magit-mode-map (kbd "u") 'magit-unstage-thing-at-point)
|
||||
(define-key magit-mode-map (kbd "i") 'magit-ignore-thing-at-point)
|
||||
(define-key magit-mode-map (kbd "?") 'magit-describe-thing-at-point)
|
||||
(define-key magit-mode-map (kbd ".") 'magit-mark-thing-at-point)
|
||||
(define-key magit-mode-map (kbd "x") 'magit-reset-soft)
|
||||
(define-key magit-mode-map (kbd "X") 'magit-reset-hard)
|
||||
(define-key magit-mode-map (kbd "RET") 'magit-visit-thing-at-point)
|
||||
(define-key magit-mode-map (kbd "b") 'magit-switch-branch)
|
||||
(define-key magit-mode-map (kbd "B") 'magit-create-branch)
|
||||
(define-key magit-mode-map (kbd "m") 'magit-manual-merge)
|
||||
(define-key magit-mode-map (kbd "M") 'magit-automatic-merge)
|
||||
(define-key magit-mode-map (kbd "U") 'magit-pull)
|
||||
(define-key magit-mode-map (kbd "P") 'magit-push)
|
||||
(define-key magit-mode-map (kbd "c") 'magit-log-edit)
|
||||
(define-key magit-mode-map (kbd "C") 'magit-add-log)
|
||||
(define-key magit-mode-map (kbd "l") 'magit-browse-log)
|
||||
(define-key magit-mode-map (kbd "L") 'magit-browse-branch-log)
|
||||
(define-key magit-mode-map (kbd "d") 'magit-diff-with-branch)
|
||||
(define-key magit-mode-map (kbd "p") 'magit-display-process))
|
||||
(defvar magit-mode-map
|
||||
(let ((map (make-keymap)))
|
||||
(suppress-keymap map)
|
||||
(define-key map (kbd "g") 'magit-status)
|
||||
(define-key map (kbd "s") 'magit-stage-thing-at-point)
|
||||
(define-key map (kbd "S") 'magit-stage-all)
|
||||
(define-key map (kbd "u") 'magit-unstage-thing-at-point)
|
||||
(define-key map (kbd "i") 'magit-ignore-thing-at-point)
|
||||
(define-key map (kbd "?") 'magit-describe-thing-at-point)
|
||||
(define-key map (kbd ".") 'magit-mark-thing-at-point)
|
||||
(define-key map (kbd "x") 'magit-reset-soft)
|
||||
(define-key map (kbd "X") 'magit-reset-hard)
|
||||
(define-key map (kbd "RET") 'magit-visit-thing-at-point)
|
||||
(define-key map (kbd "b") 'magit-switch-branch)
|
||||
(define-key map (kbd "B") 'magit-create-branch)
|
||||
(define-key map (kbd "m") 'magit-manual-merge)
|
||||
(define-key map (kbd "M") 'magit-automatic-merge)
|
||||
(define-key map (kbd "U") 'magit-pull)
|
||||
(define-key map (kbd "P") 'magit-push)
|
||||
(define-key map (kbd "c") 'magit-log-edit)
|
||||
(define-key map (kbd "C") 'magit-add-log)
|
||||
(define-key map (kbd "l") 'magit-browse-log)
|
||||
(define-key map (kbd "L") 'magit-browse-branch-log)
|
||||
(define-key map (kbd "d") 'magit-diff-with-branch)
|
||||
(define-key map (kbd "p") 'magit-display-process)
|
||||
map))
|
||||
|
||||
(defvar magit-mode-hook nil)
|
||||
|
||||
|
@ -691,20 +690,19 @@ pushed.
|
|||
|
||||
;;; History browsing
|
||||
|
||||
(defvar magit-log-mode-map nil)
|
||||
|
||||
(when (not magit-log-mode-map)
|
||||
(setq magit-log-mode-map (make-keymap))
|
||||
(suppress-keymap magit-log-mode-map)
|
||||
(define-key magit-log-mode-map (kbd "RET") 'magit-show-commit)
|
||||
(define-key magit-log-mode-map (kbd ".") 'magit-mark-thing-at-point)
|
||||
(define-key magit-log-mode-map (kbd "=") 'magit-diff-with-mark)
|
||||
(define-key magit-log-mode-map (kbd "R") 'magit-revert-commit)
|
||||
(define-key magit-log-mode-map (kbd "P") 'magit-pick-commit)
|
||||
(define-key magit-log-mode-map (kbd "C") 'magit-checkout-commit)
|
||||
(define-key magit-log-mode-map (kbd "l") 'magit-log-commit)
|
||||
(define-key magit-log-mode-map (kbd "L") 'magit-browse-branch-log)
|
||||
(define-key magit-log-mode-map (kbd "q") 'magit-quit))
|
||||
(defvar magit-log-mode-map
|
||||
(let ((map (make-keymap)))
|
||||
(suppress-keymap map)
|
||||
(define-key map (kbd "RET") 'magit-show-commit)
|
||||
(define-key map (kbd ".") 'magit-mark-thing-at-point)
|
||||
(define-key map (kbd "=") 'magit-diff-with-mark)
|
||||
(define-key map (kbd "R") 'magit-revert-commit)
|
||||
(define-key map (kbd "P") 'magit-pick-commit)
|
||||
(define-key map (kbd "C") 'magit-checkout-commit)
|
||||
(define-key map (kbd "l") 'magit-log-commit)
|
||||
(define-key map (kbd "L") 'magit-browse-branch-log)
|
||||
(define-key map (kbd "q") 'magit-quit)
|
||||
map))
|
||||
|
||||
(defvar magit-log-mode-hook nil)
|
||||
|
||||
|
|
Loading…
Reference in a new issue