Sources/OrgCore/Keymap/PresetEmacs.swift

d49c4332498ef3b0882640fcd0ff5d41990cd93b
orgstar/Sources/OrgCore/Keymap/PresetEmacs.swift

578 lines · 15350 bytes

  1extension KeymapPreset {
  2    static let emacsBindings = """
  3        # Movement and editing. With a mark set (C-SPC), movement extends the region.
  4        [[bind]]
  5        keys = "C-f"
  6        command = "edit.forward-char"
  7        [[bind]]
  8        keys = "C-b"
  9        command = "edit.backward-char"
 10        [[bind]]
 11        keys = "C-n"
 12        command = "edit.next-line"
 13        [[bind]]
 14        keys = "C-p"
 15        command = "edit.previous-line"
 16        [[bind]]
 17        keys = "C-a"
 18        command = "edit.beginning-of-line"
 19        [[bind]]
 20        keys = "C-e"
 21        command = "edit.end-of-line"
 22        [[bind]]
 23        keys = "M-f"
 24        command = "edit.forward-word"
 25        [[bind]]
 26        keys = "M-b"
 27        command = "edit.backward-word"
 28        [[bind]]
 29        keys = "M-<"
 30        command = "edit.beginning-of-buffer"
 31        [[bind]]
 32        keys = "M->"
 33        command = "edit.end-of-buffer"
 34        [[bind]]
 35        keys = "C-v"
 36        command = "edit.scroll-up"
 37        [[bind]]
 38        keys = "M-v"
 39        command = "edit.scroll-down"
 40        [[bind]]
 41        keys = "C-l"
 42        command = "edit.recenter"
 43        [[bind]]
 44        keys = "C-d"
 45        command = "edit.delete-char"
 46        [[bind]]
 47        keys = "M-d"
 48        command = "edit.kill-word"
 49        [[bind]]
 50        keys = "M-DEL"
 51        command = "edit.backward-kill-word"
 52        [[bind]]
 53        keys = "C-k"
 54        command = "edit.kill-line"
 55        [[bind]]
 56        keys = "C-y"
 57        command = "edit.yank"
 58        [[bind]]
 59        keys = "C-SPC"
 60        command = "edit.set-mark"
 61        [[bind]]
 62        keys = "C-M-i"
 63        command = "editor.complete"
 64        [[bind]]
 65        keys = "C-x h"
 66        command = "edit.select-all"
 67        [[bind]]
 68        keys = "C-w"
 69        command = "edit.kill-region"
 70        [[bind]]
 71        keys = "M-w"
 72        command = "edit.copy-region"
 73        [[bind]]
 74        keys = "C-/"
 75        command = "edit.undo"
 76        [[bind]]
 77        keys = "C-_"
 78        command = "edit.undo"
 79        [[bind]]
 80        keys = "C-x u"
 81        command = "edit.undo"
 82        [[bind]]
 83        keys = "C-g"
 84        command = "edit.keyboard-quit"
 85        [[bind]]
 86        keys = "C-t"
 87        command = "edit.transpose-chars"
 88        [[bind]]
 89        keys = "C-s"
 90        command = "edit.find"
 91        [[bind]]
 92        keys = "C-r"
 93        command = "edit.find"
 94        [[bind]]
 95        keys = "M-%"
 96        command = "edit.replace"
 97
 98        # Files and commands
 99        [[bind]]
100        keys = "C-x C-s"
101        command = "app.save"
102        [[bind]]
103        keys = "C-c C-o"
104        command = "org.link.open"
105        [[bind]]
106        keys = "C-c C-l"
107        command = "org.link.insert"
108        [[bind]]
109        keys = "C-c l"
110        command = "org.link.store"
111        [[bind]]
112        keys = "C-c ;"
113        command = "org.heading.toggle-comment"
114        [[bind]]
115        keys = "C-c *"
116        command = "org.heading.toggle"
117        [[bind]]
118        keys = "C-c -"
119        command = "org.item.toggle"
120        [[bind]]
121        keys = "C-c @"
122        command = "org.subtree.mark"
123        [[bind]]
124        keys = "C-c C-x C-w"
125        command = "org.subtree.cut"
126        [[bind]]
127        keys = "C-c C-x M-w"
128        command = "org.subtree.copy"
129        [[bind]]
130        keys = "C-c C-x C-y"
131        command = "org.subtree.paste"
132        [[bind]]
133        keys = "C-c C-x c"
134        command = "org.subtree.clone"
135        [[bind]]
136        keys = "C-c ^"
137        command = "org.sort"
138        [[bind]]
139        keys = "C-c C-c"
140        command = "org.ctrl-c-ctrl-c"
141        [[bind]]
142        keys = "C-c C-y"
143        command = "org.timestamp.evaluate-range"
144        [[bind]]
145        keys = "C-c C-x f"
146        command = "org.footnote.action"
147        [[bind]]
148        keys = "C-c ="
149        command = "org.table.column-formula"
150        [[bind]]
151        keys = "C-c TAB"
152        command = "org.table.toggle-column-width"
153        when = "table"
154        [[bind]]
155        keys = "C-x n s"
156        command = "org.narrow.subtree"
157        [[bind]]
158        keys = "C-x n b"
159        command = "org.narrow.block"
160        [[bind]]
161        keys = "C-x n w"
162        command = "org.widen"
163        [[bind]]
164        keys = "C-x x t"
165        command = "editor.toggle-truncate-lines"
166        [[bind]]
167        keys = "C-c C-j"
168        command = "org.goto"
169        [[bind]]
170        keys = "C-c /"
171        command = "org.sparse-tree"
172        [[bind]]
173        keys = "C-c ,"
174        command = "org.priority.set"
175        [[bind]]
176        keys = "C-c C-x p"
177        command = "org.property.read-and-set"
178        [[bind]]
179        keys = "C-c C-x i"
180        command = "org.columns.insert-dblock"
181        [[bind]]
182        keys = "C-c C-x a"
183        command = "org.archive.toggle-tag"
184        [[bind]]
185        keys = "C-c C-x A"
186        command = "org.archive.to-sibling"
187        [[bind]]
188        keys = "C-c C-x o"
189        command = "org.property.toggle-ordered"
190        [[bind]]
191        keys = "C-c C-x C-v"
192        command = "org.toggle-inline-images"
193        [[bind]]
194        keys = "C-c C-x C-l"
195        command = "org.latex-preview"
196        [[bind]]
197        keys = "C-c C-x C-c"
198        command = "org.columns"
199        [[bind]]
200        keys = "S-<right>"
201        command = "org.item.bullet-next"
202        when = "item"
203        [[bind]]
204        keys = "S-<left>"
205        command = "org.item.bullet-previous"
206        when = "item"
207        [[bind]]
208        keys = "C-c C-x d"
209        command = "org.drawer.insert"
210        [[bind]]
211        keys = "M-<up>"
212        command = "org.element.drag-backward"
213        [[bind]]
214        keys = "M-<down>"
215        command = "org.element.drag-forward"
216        [[bind]]
217        keys = "S-<right>"
218        command = "org.property.next-value"
219        when = "property"
220        [[bind]]
221        keys = "S-<left>"
222        command = "org.property.previous-value"
223        when = "property"
224        [[bind]]
225        keys = "C-c C-x C-r"
226        command = "org.clock.report"
227        [[bind]]
228        keys = "C-c C-x C-u"
229        command = "org.dblock.update"
230        [[bind]]
231        keys = "C-c C-x e"
232        command = "org.effort.set"
233        [[bind]]
234        keys = "C-c C-c"
235        command = "org.dblock.update"
236        when = "dblock"
237        [[bind]]
238        keys = "C-c C-,"
239        command = "org.structure-template"
240        [[bind]]
241        keys = "C-c '"
242        command = "org.edit-special"
243        [[bind]]
244        keys = "C-c C-v t"
245        command = "org.babel.tangle"
246        [[bind]]
247        keys = "C-c C-v C-t"
248        command = "org.babel.tangle"
249        [[bind]]
250        keys = "C-c `"
251        command = "org.table.edit-field"
252        when = "table"
253        [[bind]]
254        keys = "C-x b"
255        command = "app.buffer.switch"
256        [[bind]]
257        keys = "C-x C-b"
258        command = "app.buffer.switch"
259        [[bind]]
260        keys = "C-x k"
261        command = "app.buffer.kill"
262        [[bind]]
263        keys = "C-x 2"
264        command = "app.split-below"
265        [[bind]]
266        keys = "C-x 3"
267        command = "app.split-right"
268        [[bind]]
269        keys = "C-x 0"
270        command = "app.pane-close"
271        [[bind]]
272        keys = "C-x 1"
273        command = "app.pane-only"
274        [[bind]]
275        keys = "C-x o"
276        command = "app.pane-next"
277        [[bind]]
278        keys = "C-x 5 2"
279        command = "app.window-new"
280        [[bind]]
281        keys = "C-x <right>"
282        command = "app.buffer.next"
283        [[bind]]
284        keys = "C-x <left>"
285        command = "app.buffer.previous"
286        [[bind]]
287        keys = "C-x s"
288        command = "app.save-all"
289        [[bind]]
290        keys = "C-x C-f"
291        command = "app.quick-open"
292        [[bind]]
293        keys = "M-x"
294        command = "app.palette"
295        [[bind]]
296        keys = "C-c a"
297        command = "app.agenda"
298        [[bind]]
299        keys = "C-c c"
300        command = "app.capture"
301        [[bind]]
302        keys = "C-c C-x C-i"
303        command = "app.clock.in"
304        [[bind]]
305        keys = "C-c C-x C-o"
306        command = "app.clock.out"
307        [[bind]]
308        keys = "C-c C-x C-q"
309        command = "app.clock.cancel"
310        [[bind]]
311        keys = "C-c C-x C-j"
312        command = "app.clock.goto"
313        [[bind]]
314        keys = "C-c C-x C-x"
315        command = "app.clock.in-last"
316        [[bind]]
317        keys = "C-c C-x C-z"
318        command = "app.clock.resolve"
319        [[bind]]
320        keys = "C-c C-e h h"
321        command = "app.export.html"
322        [[bind]]
323        keys = "C-c C-e h o"
324        command = "app.export.html-open"
325        [[bind]]
326        keys = "C-c C-e m m"
327        command = "app.export.markdown"
328        [[bind]]
329        keys = "C-c C-e l p"
330        command = "app.export.pdf"
331        [[bind]]
332        keys = "C-c C-e l l"
333        command = "app.export.latex"
334        [[bind]]
335        keys = "C-c C-e o o"
336        command = "app.export.odt"
337        [[bind]]
338        keys = "C-c C-e t u"
339        command = "app.export.text"
340        [[bind]]
341        keys = "C-c C-e c f"
342        command = "app.export.icalendar"
343        [[bind]]
344        keys = "C-c C-e c a"
345        command = "app.export.icalendar-agenda"
346        [[bind]]
347        keys = "C-c C-e c c"
348        command = "app.export.icalendar-combined"
349        [[bind]]
350        keys = "C-c C-e P x"
351        command = "app.publish"
352        [[bind]]
353        keys = "C-c C-e P a"
354        command = "app.publish.all"
355        [[bind]]
356        keys = "C-c C-e P f"
357        command = "app.publish.current-file"
358        [[bind]]
359        keys = "C-c C-e P p"
360        command = "app.publish.current-project"
361
362        # Org
363        [[bind]]
364        keys = "C-c C-t"
365        command = "org.todo.cycle"
366        [[bind]]
367        keys = "S-<right>"
368        command = "org.todo.next"
369        when = "heading"
370        [[bind]]
371        keys = "S-<left>"
372        command = "org.todo.previous"
373        when = "heading"
374        [[bind]]
375        keys = "S-<up>"
376        command = "org.priority.up"
377        when = "heading"
378        [[bind]]
379        keys = "S-<down>"
380        command = "org.priority.down"
381        when = "heading"
382        [[bind]]
383        keys = "M-<left>"
384        command = "org.heading.promote"
385        when = "heading"
386        [[bind]]
387        keys = "M-<right>"
388        command = "org.heading.demote"
389        when = "heading"
390        [[bind]]
391        keys = "M-S-<left>"
392        command = "org.subtree.promote"
393        when = "heading"
394        [[bind]]
395        keys = "M-S-<right>"
396        command = "org.subtree.demote"
397        when = "heading"
398        [[bind]]
399        keys = "M-<up>"
400        command = "org.subtree.up"
401        when = "heading"
402        [[bind]]
403        keys = "M-<down>"
404        command = "org.subtree.down"
405        when = "heading"
406        [[bind]]
407        keys = "M-RET"
408        command = "org.heading.insert"
409        [[bind]]
410        keys = "C-RET"
411        command = "org.heading.insert-after-subtree"
412        [[bind]]
413        keys = "M-S-RET"
414        command = "org.heading.insert-todo"
415        [[bind]]
416        keys = "C-c C-n"
417        command = "org.heading.next"
418        [[bind]]
419        keys = "C-c C-p"
420        command = "org.heading.previous"
421        [[bind]]
422        keys = "C-c C-f"
423        command = "org.heading.forward-same-level"
424        [[bind]]
425        keys = "C-c C-b"
426        command = "org.heading.backward-same-level"
427        [[bind]]
428        keys = "C-c C-u"
429        command = "org.heading.up"
430        [[bind]]
431        keys = "C-c C-q"
432        command = "org.tags.set"
433        [[bind]]
434        keys = "M-RET"
435        command = "org.item.insert"
436        when = "item"
437        [[bind]]
438        keys = "M-S-RET"
439        command = "org.item.insert-checkbox"
440        when = "item"
441        [[bind]]
442        keys = "M-<left>"
443        command = "org.item.outdent"
444        when = "item"
445        [[bind]]
446        keys = "M-<right>"
447        command = "org.item.indent"
448        when = "item"
449        [[bind]]
450        keys = "M-S-<left>"
451        command = "org.item.outdent-tree"
452        when = "item"
453        [[bind]]
454        keys = "M-S-<right>"
455        command = "org.item.indent-tree"
456        when = "item"
457        [[bind]]
458        keys = "M-<up>"
459        command = "org.item.up"
460        when = "item"
461        [[bind]]
462        keys = "M-<down>"
463        command = "org.item.down"
464        when = "item"
465        [[bind]]
466        keys = "C-c C-c"
467        command = "org.ctrl-c-ctrl-c"
468        when = "item"
469        [[bind]]
470        keys = "C-c C-x C-b"
471        command = "org.checkbox.toggle"
472        [[bind]]
473        keys = "C-c C-w"
474        command = "app.refile"
475        [[bind]]
476        keys = "C-u C-c C-w"
477        command = "app.refile.goto"
478        [[bind]]
479        keys = "C-c M-w"
480        command = "app.refile.copy"
481        [[bind]]
482        keys = "C-c C-x C-s"
483        command = "app.archive"
484        [[bind]]
485        keys = "C-c $"
486        command = "app.archive"
487        [[bind]]
488        keys = "C-c ."
489        command = "org.timestamp.active"
490        [[bind]]
491        keys = "C-c !"
492        command = "org.timestamp.inactive"
493        [[bind]]
494        keys = "C-c C-s"
495        command = "org.schedule"
496        [[bind]]
497        keys = "C-c C-d"
498        command = "org.deadline"
499        [[bind]]
500        keys = "M-q"
501        command = "org.fill-paragraph"
502        [[bind]]
503        keys = "C-c C-c"
504        command = "org.ctrl-c-ctrl-c"
505        when = "table"
506        [[bind]]
507        keys = "C-c C-c"
508        command = "org.table.recalc-all"
509        when = "tblfm"
510        [[bind]]
511        keys = "C-c *"
512        command = "org.table.recalc"
513        when = "table"
514        [[bind]]
515        keys = "C-c C-c"
516        command = "org.babel.execute"
517        when = "src"
518        [[bind]]
519        keys = "M-<up>"
520        command = "org.table.row-up"
521        when = "table"
522        [[bind]]
523        keys = "M-<down>"
524        command = "org.table.row-down"
525        when = "table"
526        [[bind]]
527        keys = "M-<left>"
528        command = "org.table.column-left"
529        when = "table"
530        [[bind]]
531        keys = "M-<right>"
532        command = "org.table.column-right"
533        when = "table"
534        [[bind]]
535        keys = "M-S-<right>"
536        command = "org.table.insert-column"
537        when = "table"
538        [[bind]]
539        keys = "M-S-<left>"
540        command = "org.table.delete-column"
541        when = "table"
542        [[bind]]
543        keys = "M-S-<up>"
544        command = "org.table.kill-row"
545        when = "table"
546        [[bind]]
547        keys = "M-S-<down>"
548        command = "org.table.insert-row"
549        when = "table"
550        [[bind]]
551        keys = "C-c -"
552        command = "org.table.insert-hline"
553        when = "table"
554        [[bind]]
555        keys = "C-c |"
556        command = "org.table.create"
557        [[bind]]
558        keys = "S-<up>"
559        command = "org.timestamp.up"
560        when = "timestamp"
561        [[bind]]
562        keys = "S-<down>"
563        command = "org.timestamp.down"
564        when = "timestamp"
565        [[bind]]
566        keys = "S-<right>"
567        command = "org.timestamp.day-later"
568        when = "timestamp"
569        [[bind]]
570        keys = "S-<left>"
571        command = "org.timestamp.day-earlier"
572        when = "timestamp"
573
574        """
575
576    /// Standard Mac text keys stay as they are; org commands use Control-Command chords, which
577    /// macOS text editing leaves free.
578}
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form