Skip to content

Instantly share code, notes, and snippets.

@antifuchs
Created August 6, 2015 00:35
Show Gist options
  • Save antifuchs/28e0c012dc7004dbeaf1 to your computer and use it in GitHub Desktop.
Save antifuchs/28e0c012dc7004dbeaf1 to your computer and use it in GitHub Desktop.

Flip “b c” and “b B” to do the opposite of each other

(which is what I expect them to do, finger-memorily)

(defun asf--set-magit-action (popup action-name new-key)
  (let* ((actions (plist-get popup :actions))
         (action-defn (-find (lambda (elt) (eq (caddr elt) action-name)) actions))
         (existing-action (assoc new-key actions)))
;;    (assert (null existing-action) "Not a great idea to set this to an existing key")
;;    (assert (not (null action-defn)) "Couldn't find action %s in %s" action-name actions)

    (rplaca action-defn new-key)))

(asf--set-magit-action magit-branch-popup 'magit-branch ?P)
(asf--set-magit-action magit-branch-popup 'magit-branch-and-checkout ?c)

Also get us non-prompting “P P” back

(asf--set-magit-action magit-push-popup 'magit-push-current ?p)
(asf--set-magit-action magit-push-popup 'magit-push-quickly ?P)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment