conventions: better evilified buffers section

This commit is contained in:
syl20bnr 2015-09-29 21:35:21 -04:00
parent 96ef3d1e9a
commit ab6ebd0348
1 changed files with 54 additions and 45 deletions

View File

@ -9,7 +9,7 @@
- [[#user-prefix][User prefix]]
- [[#major-mode-prefix][Major mode prefix]]
- [[#micro-state][Micro-state]]
- [[#evilify-buffers][Evilify buffers]]
- [[#evilified-buffers][Evilified buffers]]
- [[#navigation][Navigation]]
- [[#n-and-n][n and N]]
- [[#code-navigation][Code Navigation]]
@ -71,25 +71,34 @@ buffers are good candidates to be put on ~M-SPC~ and ~s-M-SPC~.
It is recommended to add ~q~ to leave the micro-state.
*** Evilify buffers
=Spacemacs= offers convenient functions to /evilify/ a buffer.
*** Evilified buffers
/Evilifying/ a buffer is to set the =evilified state= as the default
state for the major mode of the buffer.
The =evilified state= is derived from the =emacs state= and modify the
map to: - add ~hjkl~ navigation - add incremental search with ~/~, ~n~
and ~N~ - add =visual state= and =visual line state= - add yank (copy)
with ~y~ - activate evil-leader key
map to:
- add ~hjkl~ navigation
- add scrolling feature on ~C-f~, ~C-b~, ~C-d~ and ~C-u~
- ~G~ and ~gg~ to go to the end and beginning of the buffer
- add incremental search with ~/~, ~n~ and ~N~
- enabling =evil-ex= on ~:~
- add =visual state= and =visual line state= on ~v~ and ~V~
- add yank on ~y~ _in visual state only_
- activate evil-leader key on ~SPC~
Setting the =evilified state= to a mode is done by calling the macro
=evilify= which takes optional parameters to fix the key bindings
shadowed by the above modifications.
=spacemacs|evilify-map=.
To fix the shadowed bindings we capitalize them, for instance: shadowed
~h~ is transposed to ~H~, if ~H~ is taken then it is transposed to ~C-h~
and so on...
/Evilification/ rebinds shadowed key bindings according to the following
rules:
- alphabetic key bindings: ~x~ -> ~X~ -> ~C-x~ -> ~C-X~
- ~SPC~ -> ~'~
- ~/~ -> ~\~
- ~:~ -> ~|~
- ~C-g~ cannot be shadowed
Example of /evilified/ buffers are =magit status=, =paradox buffer=.
If a key binding cannot be remapped then it is ignored and a warning message
is displayed in =*Messages*=.
*** Navigation
**** n and N