summaryrefslogtreecommitdiff
path: root/doc/keythemes.org
blob: 7bd755be2934e5f3c11a55a8663770162c5c6d4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
* Key themes
  
  The config is set up in key themes.

  To enable all bindings use:

  #+begin_src emacs-lisp
  (evil-org-set-key-theme '(textobjects insert navigation additional shift todo heading))
  #+end_src

** Basic
   These keys are always enabled
   
   |-------+-------------------------------+--------------------------------------------|
   | key   | function                      | explanation                                |
   |-------+-------------------------------+--------------------------------------------|
   | =TAB= | org-cycle                     | change folding level of current heading    |
   | =0=   | evil-org-beginning-of-line    | like 0 but can be special*                 |
   | =$=   | evil-org-end-of-line          | like $ but can be special*                 |
   | =I=   | evil-org-insert-line          | like I but can be special*                 |
   | =A=   | evil-org-append-line          | like A but can be special*                 |
   | =o=   | evil-org-open-below           | like o but continue tables and items*      |
   | =O=   | evil-org-open-above           | like O but continue tables and items*      |
   | =d=   | evil-org-delete               | like d but keep tags aligned and fix lists |
   | =x=   | evil-org-delete-char          | like x but keep tables and tags aligned    |
   | =X=   | evil-org-delete-previous-char | like X but keep tables and tags aligned    |
   | =(=   | org-forward-sentence          | next cell in table                         |
   | =)=   | org-backward-sentence         | previous cell in table                     |
   | ={=   | org-backward-paragraph        | beginning of table                         |
   | =}=   | org-forward-paragraph         | end of table                               |
   |-------+-------------------------------+--------------------------------------------|

   * Set =org-special-ctrl-a/e= to =t= to make =org-beginning-of-line= and =org-end-of-line= ignore leading stars or tags on headings. Repeat to toggle. By default it's set to ~nil~.
   * =evil-org-insert-line= and =evil-org-append-line= also respect the setting of =org-special-ctrl-a/e=.
   * The cases in which =o= and =O= should behave special can be controlled using =evil-org-special-o/O=. By default it's set to ~'(table-row item)~.

*** Operators
    Context dependent dwim operators for:
    - promoting/demoting on headings and items
    - moving table columns
    - changing indent in other contexts (when editing source code)

    |-----+------------+-------------------------------------|
    | key | function   | explanation                         |
    |-----+------------+-------------------------------------|
    | =<= | evil-org-< | Promote all headings in marked area |
    | =>= | evil-org-< | Demote all headings in marked area  |
    |-----+------------+-------------------------------------|
    
    Variable =evil-org-retain-visual-state-on-shift= controls whether the selection should be restored after promoting / indenting, which is helpful if you want to promote / indent multiple times. By default this variable is set to =nil=.

    Examples:
    - =>>= to promote a heading
    - =>ar= to promote a tree
    - =<(= to swap a table column with the one on the left
    - =vie2>= to move a table column two places to the right

    If you want =<= and =>= to promote / demote headings and items on a single press, add the following to your org setup:

    #+begin_src emacs-lisp
    (evil-define-key 'normal evil-org-mode-map
                     (kbd ">") 'org-meta-right
                     (kbd "<") 'org-meta-left)
    #+end_src
    Or enable the additional key binding theme and use =M-h= and =M-l.=
    
** Return
   Experimental function bound to =RET=.
   Disabled by default. If enabled, it's active in insert and emacs state.

   Depending on context, it performs one of the following actions:
   - When on an empty item or table row, abort or split the item list or table.
   - When on a non-empty item or table row, continue the item list or table.
   - Otherwise, insert a newline and indent.

   This makes =RET= more consistent with =evil-org-open-above/below= (which are bound to =o= and =O= by default).
   
   |-------+-----------------|
   | key   | function        |
   |-------+-----------------|
   | =RET= | evil-org-return |
   |-------+-----------------|
   
   Based on the following earlier work:
   - https://github.com/calvinwyoung/org-autolist
   - http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/

   * The cases in which =RET= should behave special can be controlled using =evil-org-special-o/O=. By default it's set to ~'(table-row item)~.

** Navigation
   If you don't want to use =h/j/k/l,= you can customize =evil-org-movement-bindings=.

   |------+----------------------+-------------------|
   | key  | function             | explanation       |
   |------+----------------------+-------------------|
   | =gh= | org-element-up       | parent of element |
   | =gj= | org-forward-element  | next element      |
   | =gk= | org-backward-element | previous element  |
   | =gl= | org-down-element     | first subelement  |
   | =gH= | evil-org-top         | top-level heading |
   |------+----------------------+-------------------|

** Text objects
   
   |-------------+-----------------------------------+----------------------------------|
   | key         | function                          | examples                         |
   |-------------+-----------------------------------+----------------------------------|
   | =ae= / =ie= | evil-org-an/inner-object          | link, markup, table cell         |
   | =aE= / =iE= | evil-org-an/inner-element         | paragraph, code block, table row |
   | =ar= / =ir= | evil-org-an/inner-greater-element | item list, table                 |
   | =aR= / =iR= | evil-org-an/inner-subtree         | subtree starting with a header   |
   |-------------+-----------------------------------+----------------------------------|
  
  - =ae/ie= select the smallest object or element at point. Can be repeated to select adjacent objects / elements.
  - =aE/iE= select the smallest element at point. Elements build up the structure of the document, so there is always an element at any point. Can be repeated to select adjacent elements.
  - =ar/ir= select smallest element that is a container of other elements. Can be repeated to select greater elements
    
  Examples:
   - =vae= to select a paragraph
   - =daR= to delete a subtree
   - =yiR= to yank the contents of a subtree

** Calendar
   Disabled by default.
   When enabled, these bindings are available in org-calendar in both Evil and Emacs mode.

   |-------------------+--------------------------+-----------------------|
   | evil-org key      | emacs key                | explanation           |
   |-------------------+--------------------------+-----------------------|
   | =M-h= / =M-l=     | =S-left= / =S-right=     | next / previous day   |
   | =M-j= / =M-k=     | =S-down= / =S-up=        | next / previous week  |
   | =M-S-h= / =M-S-l= | =M-S-left= / =M-S-right= | next / previous month |
   | =M-S-j= / =M-S-k= | =M-S-down= / =M-S-up=    | next / previous year  |
   | =C-f= / =C-b=     | =M-v= / =C-v=            | scroll down /up       |
   |-------------------+--------------------------+-----------------------|

** Additional
   If you don't want to use hjkl, you can customize =evil-org-movement-bindings=.
   If you want to use these bindings even in insert mode, you can customize =evil-org-use-additional-insert=.

   |-------+--------------------+-------------------+-------------------|
   | key   | function           | On headings       | On tables         |
   |-------+--------------------+-------------------+-------------------|
   | =M-h= | org-metaleft       | promote heading   | move column left  |
   | =M-l= | org-metaright      | demote heading    | move column right |
   | =M-k= | org-metaup         | move subtree up   | move column up    |
   | =M-j= | org-metadown       | move subtree down | move column down  |
   | =M-H= | org-shiftmetaleft  | promote subtree   | delete column     |
   | =M-L= | org-shiftmetaright | demote subtree    | insert column     |
   | =M-K= | org-shiftmetaup    | move heading up   | delete row        |
   | =M-J= | org-shiftmetadown  | move heading down | insert row        |
   |-------+--------------------+-------------------+-------------------|

** Shift
   Disabled by default.
   If you don't want to use hjkl, you can customize =evil-org-movement-bindings=.

   |-----+----------------+--------------------|
   | key | function       | explanation        |
   |-----+----------------+--------------------|
   | =H= | org-shiftleft  | previous todo item |
   | =L= | org-shiftright | next todo item     |
   | =J= | org-shiftdown  | decrease priority  |
   | =K= | org-shiftup    | increase priority  |
   |-----+----------------+--------------------|

   When point is not at a heading or item, these keys fall back on their binding in non-org modes. For example, you can still use =J= to join lines when not at a heading. This behaviour can be configured using =evil-org-want-hybrid-shift=. By default this option is set to ~t~.

** Todo
   Disabled by default.

   |-------+----------------------------|
   | key   | function                   |
   |-------+----------------------------|
   | =t=   | org-todo                   |
   | =T=   | org-insert-todo-heading    |
   | =M-t= | org-insert-todo-subheading |
   |-------+----------------------------|
  
** Heading
   Disabled by default.

   |-------+-----------------------|
   | key   | function              |
   |-------+-----------------------|
   | =O=   | org-insert-heading    |
   | =M-o= | org-insert-subheading |
   |-------+-----------------------|

** Commands without default binding
   These functions don't have any bindings by default and aren't well-maintained. You can bind them under =C-c= or another leader key.

   |----------------------------------------+----------------------------------------|
   | function                               | explanation                            |
   |----------------------------------------+----------------------------------------|
   | evil-org-open-links                    | opens links in selection               |
   | evil-org-open-incognito                | open link at point in incognito window |
   |----------------------------------------+----------------------------------------|

   =evil-org-open-links= opens all links in a selection. Use =RET= to open a single link.
   =evil-org-open-incognito= tries to open a link in a private window.