Sources/OrgCore/Keymap/PresetEmacs.swift

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

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