Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun magit-jump-to-section (jump-fn)
- "Generic jump magit jump function."
- (magit-section-show-level-3-all)
- (with-suppressed-warnings ((interactive-only))
- (unless (funcall jump-fn)
- (forward-line 2)
- (magit-section-show (magit-current-section))
- (recenter-top-bottom 2))))
- (defun magit-jump-to-unstaged+ ()
- "Better jump command. Closes the hunks, jumps to the section head, moves that
- header to the top of the screen."
- (interactive)
- (magit-jump-to-section #'magit-jump-to-unstaged))
- (defun magit-jump-to-staged+ ()
- "Better jump command. Closes the hunks, jumps to the section head, moves that
- header to the top of the screen."
- (interactive)
- (magit-jump-to-section #'magit-jump-to-staged))
- (define-key magit-mode-map (kbd "C-c m u") #'magit-jump-to-unstaged+)
- (define-key magit-mode-map (kbd "C-c m s") #'magit-jump-to-staged+)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement