Sources/OrgCore/Keymap/PresetEmacs.swift

a81466b635dcb01c9617cb6b5572f5bed45963b9
orgstar/Sources/OrgCore/Keymap/PresetEmacs.swift
cmc #+PLOTa81466b635 1 month ago

581 lines · 15423 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 \\" g"
198        command = "app.plot"
199        [[bind]]
200        keys = "C-c C-x C-c"
201        command = "org.columns"
202        [[bind]]
203        keys = "S-<right>"
204        command = "org.item.bullet-next"
205        when = "item"
206        [[bind]]
207        keys = "S-<left>"
208        command = "org.item.bullet-previous"
209        when = "item"
210        [[bind]]
211        keys = "C-c C-x d"
212        command = "org.drawer.insert"
213        [[bind]]
214        keys = "M-<up>"
215        command = "org.element.drag-backward"
216        [[bind]]
217        keys = "M-<down>"
218        command = "org.element.drag-forward"
219        [[bind]]
220        keys = "S-<right>"
221        command = "org.property.next-value"
222        when = "property"
223        [[bind]]
224        keys = "S-<left>"
225        command = "org.property.previous-value"
226        when = "property"
227        [[bind]]
228        keys = "C-c C-x C-r"
229        command = "org.clock.report"
230        [[bind]]
231        keys = "C-c C-x C-u"
232        command = "org.dblock.update"
233        [[bind]]
234        keys = "C-c C-x e"
235        command = "org.effort.set"
236        [[bind]]
237        keys = "C-c C-c"
238        command = "org.dblock.update"
239        when = "dblock"
240        [[bind]]
241        keys = "C-c C-,"
242        command = "org.structure-template"
243        [[bind]]
244        keys = "C-c '"
245        command = "org.edit-special"
246        [[bind]]
247        keys = "C-c C-v t"
248        command = "org.babel.tangle"
249        [[bind]]
250        keys = "C-c C-v C-t"
251        command = "org.babel.tangle"
252        [[bind]]
253        keys = "C-c `"
254        command = "org.table.edit-field"
255        when = "table"
256        [[bind]]
257        keys = "C-x b"
258        command = "app.buffer.switch"
259        [[bind]]
260        keys = "C-x C-b"
261        command = "app.buffer.switch"
262        [[bind]]
263        keys = "C-x k"
264        command = "app.buffer.kill"
265        [[bind]]
266        keys = "C-x 2"
267        command = "app.split-below"
268        [[bind]]
269        keys = "C-x 3"
270        command = "app.split-right"
271        [[bind]]
272        keys = "C-x 0"
273        command = "app.pane-close"
274        [[bind]]
275        keys = "C-x 1"
276        command = "app.pane-only"
277        [[bind]]
278        keys = "C-x o"
279        command = "app.pane-next"
280        [[bind]]
281        keys = "C-x 5 2"
282        command = "app.window-new"
283        [[bind]]
284        keys = "C-x <right>"
285        command = "app.buffer.next"
286        [[bind]]
287        keys = "C-x <left>"
288        command = "app.buffer.previous"
289        [[bind]]
290        keys = "C-x s"
291        command = "app.save-all"
292        [[bind]]
293        keys = "C-x C-f"
294        command = "app.quick-open"
295        [[bind]]
296        keys = "M-x"
297        command = "app.palette"
298        [[bind]]
299        keys = "C-c a"
300        command = "app.agenda"
301        [[bind]]
302        keys = "C-c c"
303        command = "app.capture"
304        [[bind]]
305        keys = "C-c C-x C-i"
306        command = "app.clock.in"
307        [[bind]]
308        keys = "C-c C-x C-o"
309        command = "app.clock.out"
310        [[bind]]
311        keys = "C-c C-x C-q"
312        command = "app.clock.cancel"
313        [[bind]]
314        keys = "C-c C-x C-j"
315        command = "app.clock.goto"
316        [[bind]]
317        keys = "C-c C-x C-x"
318        command = "app.clock.in-last"
319        [[bind]]
320        keys = "C-c C-x C-z"
321        command = "app.clock.resolve"
322        [[bind]]
323        keys = "C-c C-e h h"
324        command = "app.export.html"
325        [[bind]]
326        keys = "C-c C-e h o"
327        command = "app.export.html-open"
328        [[bind]]
329        keys = "C-c C-e m m"
330        command = "app.export.markdown"
331        [[bind]]
332        keys = "C-c C-e l p"
333        command = "app.export.pdf"
334        [[bind]]
335        keys = "C-c C-e l l"
336        command = "app.export.latex"
337        [[bind]]
338        keys = "C-c C-e o o"
339        command = "app.export.odt"
340        [[bind]]
341        keys = "C-c C-e t u"
342        command = "app.export.text"
343        [[bind]]
344        keys = "C-c C-e c f"
345        command = "app.export.icalendar"
346        [[bind]]
347        keys = "C-c C-e c a"
348        command = "app.export.icalendar-agenda"
349        [[bind]]
350        keys = "C-c C-e c c"
351        command = "app.export.icalendar-combined"
352        [[bind]]
353        keys = "C-c C-e P x"
354        command = "app.publish"
355        [[bind]]
356        keys = "C-c C-e P a"
357        command = "app.publish.all"
358        [[bind]]
359        keys = "C-c C-e P f"
360        command = "app.publish.current-file"
361        [[bind]]
362        keys = "C-c C-e P p"
363        command = "app.publish.current-project"
364
365        # Org
366        [[bind]]
367        keys = "C-c C-t"
368        command = "org.todo.cycle"
369        [[bind]]
370        keys = "S-<right>"
371        command = "org.todo.next"
372        when = "heading"
373        [[bind]]
374        keys = "S-<left>"
375        command = "org.todo.previous"
376        when = "heading"
377        [[bind]]
378        keys = "S-<up>"
379        command = "org.priority.up"
380        when = "heading"
381        [[bind]]
382        keys = "S-<down>"
383        command = "org.priority.down"
384        when = "heading"
385        [[bind]]
386        keys = "M-<left>"
387        command = "org.heading.promote"
388        when = "heading"
389        [[bind]]
390        keys = "M-<right>"
391        command = "org.heading.demote"
392        when = "heading"
393        [[bind]]
394        keys = "M-S-<left>"
395        command = "org.subtree.promote"
396        when = "heading"
397        [[bind]]
398        keys = "M-S-<right>"
399        command = "org.subtree.demote"
400        when = "heading"
401        [[bind]]
402        keys = "M-<up>"
403        command = "org.subtree.up"
404        when = "heading"
405        [[bind]]
406        keys = "M-<down>"
407        command = "org.subtree.down"
408        when = "heading"
409        [[bind]]
410        keys = "M-RET"
411        command = "org.heading.insert"
412        [[bind]]
413        keys = "C-RET"
414        command = "org.heading.insert-after-subtree"
415        [[bind]]
416        keys = "M-S-RET"
417        command = "org.heading.insert-todo"
418        [[bind]]
419        keys = "C-c C-n"
420        command = "org.heading.next"
421        [[bind]]
422        keys = "C-c C-p"
423        command = "org.heading.previous"
424        [[bind]]
425        keys = "C-c C-f"
426        command = "org.heading.forward-same-level"
427        [[bind]]
428        keys = "C-c C-b"
429        command = "org.heading.backward-same-level"
430        [[bind]]
431        keys = "C-c C-u"
432        command = "org.heading.up"
433        [[bind]]
434        keys = "C-c C-q"
435        command = "org.tags.set"
436        [[bind]]
437        keys = "M-RET"
438        command = "org.item.insert"
439        when = "item"
440        [[bind]]
441        keys = "M-S-RET"
442        command = "org.item.insert-checkbox"
443        when = "item"
444        [[bind]]
445        keys = "M-<left>"
446        command = "org.item.outdent"
447        when = "item"
448        [[bind]]
449        keys = "M-<right>"
450        command = "org.item.indent"
451        when = "item"
452        [[bind]]
453        keys = "M-S-<left>"
454        command = "org.item.outdent-tree"
455        when = "item"
456        [[bind]]
457        keys = "M-S-<right>"
458        command = "org.item.indent-tree"
459        when = "item"
460        [[bind]]
461        keys = "M-<up>"
462        command = "org.item.up"
463        when = "item"
464        [[bind]]
465        keys = "M-<down>"
466        command = "org.item.down"
467        when = "item"
468        [[bind]]
469        keys = "C-c C-c"
470        command = "org.ctrl-c-ctrl-c"
471        when = "item"
472        [[bind]]
473        keys = "C-c C-x C-b"
474        command = "org.checkbox.toggle"
475        [[bind]]
476        keys = "C-c C-w"
477        command = "app.refile"
478        [[bind]]
479        keys = "C-u C-c C-w"
480        command = "app.refile.goto"
481        [[bind]]
482        keys = "C-c M-w"
483        command = "app.refile.copy"
484        [[bind]]
485        keys = "C-c C-x C-s"
486        command = "app.archive"
487        [[bind]]
488        keys = "C-c $"
489        command = "app.archive"
490        [[bind]]
491        keys = "C-c ."
492        command = "org.timestamp.active"
493        [[bind]]
494        keys = "C-c !"
495        command = "org.timestamp.inactive"
496        [[bind]]
497        keys = "C-c C-s"
498        command = "org.schedule"
499        [[bind]]
500        keys = "C-c C-d"
501        command = "org.deadline"
502        [[bind]]
503        keys = "M-q"
504        command = "org.fill-paragraph"
505        [[bind]]
506        keys = "C-c C-c"
507        command = "org.ctrl-c-ctrl-c"
508        when = "table"
509        [[bind]]
510        keys = "C-c C-c"
511        command = "org.table.recalc-all"
512        when = "tblfm"
513        [[bind]]
514        keys = "C-c *"
515        command = "org.table.recalc"
516        when = "table"
517        [[bind]]
518        keys = "C-c C-c"
519        command = "org.babel.execute"
520        when = "src"
521        [[bind]]
522        keys = "M-<up>"
523        command = "org.table.row-up"
524        when = "table"
525        [[bind]]
526        keys = "M-<down>"
527        command = "org.table.row-down"
528        when = "table"
529        [[bind]]
530        keys = "M-<left>"
531        command = "org.table.column-left"
532        when = "table"
533        [[bind]]
534        keys = "M-<right>"
535        command = "org.table.column-right"
536        when = "table"
537        [[bind]]
538        keys = "M-S-<right>"
539        command = "org.table.insert-column"
540        when = "table"
541        [[bind]]
542        keys = "M-S-<left>"
543        command = "org.table.delete-column"
544        when = "table"
545        [[bind]]
546        keys = "M-S-<up>"
547        command = "org.table.kill-row"
548        when = "table"
549        [[bind]]
550        keys = "M-S-<down>"
551        command = "org.table.insert-row"
552        when = "table"
553        [[bind]]
554        keys = "C-c -"
555        command = "org.table.insert-hline"
556        when = "table"
557        [[bind]]
558        keys = "C-c |"
559        command = "org.table.create"
560        [[bind]]
561        keys = "S-<up>"
562        command = "org.timestamp.up"
563        when = "timestamp"
564        [[bind]]
565        keys = "S-<down>"
566        command = "org.timestamp.down"
567        when = "timestamp"
568        [[bind]]
569        keys = "S-<right>"
570        command = "org.timestamp.day-later"
571        when = "timestamp"
572        [[bind]]
573        keys = "S-<left>"
574        command = "org.timestamp.day-earlier"
575        when = "timestamp"
576
577        """
578
579    /// Standard Mac text keys stay as they are; org commands use Control-Command chords, which
580    /// macOS text editing leaves free.
581}
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