Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Add support for forge
Browse files Browse the repository at this point in the history
Put forge on "F", moving pull to "p" and push to "P".

Fixes #54
  • Loading branch information
justbur committed Jan 16, 2019
1 parent f5da27d commit 49978d0
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 58 deletions.
120 changes: 62 additions & 58 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,30 @@ commits to master. Any help is welcomed.

* Recent Changes (most recent first)

1. [2018-05-22] Added =evil-magit-use-z-for-folds=. See docstring for more
1. [2019-01-16] Add support for forge commands.
2. [2018-05-22] Added =evil-magit-use-z-for-folds=. See docstring for more
information.
2. [2018-03-13] Added basic evil support for =magit-list-repositories=.
3. [2016-07-27] Moved submodules popup to ' and added the new subtree popup at
3. [2018-03-13] Added basic evil support for =magit-list-repositories=.
4. [2016-07-27] Moved submodules popup to ' and added the new subtree popup at
". This is not mnemonic in any way but easy to reach and keeps the two keys
together.
4. [2016-03-24] Moved =magit-diff-less-context= to = to fix conflict with
5. [2016-03-24] Moved =magit-diff-less-context= to = to fix conflict with
moved revert.
5. [2016-03-21] Moved revert commands from =o= and =O= to =-= and
6. [2016-03-21] Moved revert commands from =o= and =O= to =-= and
=_=. Rationale is that you are subtracting a commit. This makes room for
=o= and =O= to be reset and the new reset popup command. Think of resetting
to an "old" state. =¯\_(ツ)_/¯=
6. Added =evil-magit-want-horizontal-movement=. Use =h= and =l= for movement
7. Added =evil-magit-want-horizontal-movement=. Use =h= and =l= for movement
like vim, moving =h= to =H=, =l= to =L=, and =L= to =C-l=.
7. Added =evil-magit-toggle-text-mode= on =C-t=. This is a quick way to enter
8. Added =evil-magit-toggle-text-mode= on =C-t=. This is a quick way to enter
text mode in a magit buffer, which allows arbitrary movement, copying, etc.
Use =C-t= to return to the previous magit mode.
8. When =evil-magit-use-y-for-yank= is non nil, =C-w= will prefix the evil
9. When =evil-magit-use-y-for-yank= is non nil, =C-w= will prefix the evil
window switching functions from magit buffers.
9. =evil-magit-use-y-for-yank= is now the default. It has worked well for me so
far, and I've had good feedback, but please let me know if you see issues.
You can use the original behavior with =(setq evil-magit-use-y-for-yank
nil)=. See the table below for a summary of differences.
10. =evil-magit-use-y-for-yank= is now the default. It has worked well for me so
far, and I've had good feedback, but please let me know if you see issues.
You can use the original behavior with =(setq evil-magit-use-y-for-yank
nil)=. See the table below for a summary of differences.


* Installation and Use
Expand Down Expand Up @@ -95,52 +96,55 @@ mode is the best that I have come up with.
The basic key binding scheme for evil-magit (EM) is described in the following
tables. Blank columns indicate that the key is carried over from the left.

| Category | Default | EM w/o yank opt | w/ yank opt (default) | w/ horiz move | w/ folds |
|------------------------+---------+------------------------+-----------------------+---------------+----------|
| cherry pick | =a/A= | | | | |
| branch | =b= | | | | |
| bisect | =B= | | | | |
| commit | =c= | | | | |
| diff | =d/D= | | | | |
| ediff | =e/E= | | | | |
| fetch | =f= | | | | |
| pull | =F= | | | | |
| refresh | =g= | =gr/gR= (=g= in popup) | | | |
| help | =h/?= | | | =H/?= | |
| ignore | =i/I= | | | | |
| jump | =j= | =g= | | | |
| delete | =k= | =x= | | | |
| untrack | =K= | =X= | | | |
| log | =l/L= | | | =L/C-l= | |
| merge | =m= | | | | |
| remote | =M= | | | | |
| next section | =n= | =C-j= | | | |
| next section sibling | =M-n= | =gj= or =]= | | | |
| submodule | =o= | ' | | | |
| subtree | =O= | " | | | |
| prev section | =p= | =C-k= | | | |
| prev section sibling | =M-p= | =gk= or =[= | | | |
| push | =P= | =P= or =p= | | | |
| quit | =q= | =q= or =ESC= | | | |
| rebase | =r= | | | | |
| rename | =R= | | | | |
| stage | =s/S= | | | | |
| tag | =t= | | | | |
| notes | =T= | | | | |
| unstage | =u/U= | | | | |
| revert | =v/V= | =-/_= | | | |
| am | =w= | | | | |
| patch | =W= | | | | |
| reset | =x/X= | =o/O= | | | |
| show-refs | =y= | | =yr= (=y= in popup) | | |
| cherry | =Y= | | | | |
| stash | =z/Z= | | | | =Z= |
| git-cmd | =:= | =¦= | | | |
| run | =!= | | | | |
| diff less/more context | =-/+= | = / + | | | |
| copy section info | =C-w= | | =ys= | | |
| copy buffer info | =M-w= | | =yb= | | |

| Category | Default | EM w/o yank opt | w/ yank opt (default) | w/ horiz move | w/ folds | w/ forge |
|------------------------+---------+------------------------+-----------------------+---------------+----------+-----------|
| cherry pick | =a/A= | | | | | |
| branch | =b= | | | | | |
| bisect | =B= | | | | | |
| commit | =c= | | | | | |
| diff | =d/D= | | | | | |
| ediff | =e/E= | | | | | |
| fetch | =f= | | | | | |
| forge | | | | | | =F= |
| pull | =F= | | | | | =p= |
| refresh | =g= | =gr/gR= (=g= in popup) | | | | |
| help | =h/?= | | | =H/?= | | |
| ignore | =i/I= | | | | | |
| jump | =j= | =g= | | | | |
| delete | =k= | =x= | | | | |
| untrack | =K= | =X= | | | | |
| log | =l/L= | | | =L/C-l= | | |
| merge | =m= | | | | | |
| remote | =M= | | | | | |
| next section | =n= | =C-j= | | | | |
| next section sibling | =M-n= | =gj= or =]= | | | | |
| submodule | =o= | ' | | | | |
| subtree | =O= | " | | | | |
| prev section | =p= | =C-k= | | | | |
| prev section sibling | =M-p= | =gk= or =[= | | | | |
| push | =P= | =P= or =p= | | | | =P= |
| quit | =q= | =q= or =ESC= | | | | |
| rebase | =r= | | | | | |
| rename | =R= | | | | | |
| stage | =s/S= | | | | | |
| tag | =t= | | | | | |
| notes | =T= | | | | | |
| unstage | =u/U= | | | | | |
| revert | =v/V= | =-/_= | | | | |
| am | =w= | | | | | |
| patch | =W= | | | | | |
| reset | =x/X= | =o/O= | | | | |
| show-refs | =y= | | =yr= (=y= in popup) | | | |
| cherry | =Y= | | | | | |
| stash | =z/Z= | | | | =Z= | |
| git-cmd | =:= | =¦= | | | | |
| run | =!= | | | | | |
| diff less/more context | =-/+= | = / + | | | | |
| copy section info | =C-w= | | =ys= | | | |
| copy buffer info | =M-w= | | =yb= | | | |

Note that the forge commands will take affect after forge is loaded, e.g.,
with =(require 'forge)=.
** New Commands

| Command | EM w/o yank opt | EM w/ yank opt (default) | w/ horiz move |
Expand Down
10 changes: 10 additions & 0 deletions evil-magit.el
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,16 @@ using `evil-magit-toggle-text-mode'"
(t
(user-error "evil-magit-toggle-text-mode unexpected state"))))

;; Make room for forge popup when loaded
(eval-after-load 'forge
'(progn
(evil-magit-define-key evil-magit-state 'magit-mode-map "p" 'magit-pull-popup)
(evil-magit-define-key evil-magit-state 'magit-mode-map "P" 'magit-push-popup)
(evil-magit-define-key evil-magit-state 'magit-mode-map "F" 'forge-dispatch)
(magit-change-popup-key 'magit-dispatch-popup :actions ?p ?P)
(magit-change-popup-key 'magit-dispatch-popup :actions ?F ?p)
(magit-define-popup-action 'magit-dispatch-popup ?F "Forge" 'forge-dispatch ?f)))

;;; evil-magit.el ends soon
(provide 'evil-magit)
;; Local Variables:
Expand Down

0 comments on commit 49978d0

Please sign in to comment.