krz/orgstar

A native macOS editor for org-mode files. editor org-mode swift

Sources/OrgCore/Keymap/Presets.swift

abca8dc581329472f7fb8ccd3af147e5fb882f29
orgstar/Sources/OrgCore/Keymap/Presets.swift history · blame · raw

903 lines · 25165 bytes

  1/// The keymaps the app ships. The user's `keymap.toml` is layered on top of the chosen one.
  2public enum KeymapPreset: String, Sendable, CaseIterable {
  3    case emacs, mac, doom
  4
  5    public var title: String {
  6        switch self {
  7        case .emacs: "Emacs"
  8        case .mac: "Mac"
  9        case .doom: "Doom (Vim keys)"
 10        }
 11    }
 12
 13    /// Whether the preset edits modally.
 14    public var isModal: Bool { self == .doom }
 15
 16    public var keymap: Keymap {
 17        var problems: [String] = []
 18        let map = try! Keymap(toml: toml, problems: &problems)
 19        precondition(problems.isEmpty, "preset \(rawValue): \(problems)")
 20        return map
 21    }
 22
 23    public var toml: String {
 24        switch self {
 25        case .emacs: Self.common + Self.emacsBindings
 26        case .mac: Self.common + Self.macBindings
 27        case .doom: Self.doomToml
 28        }
 29    }
 30
 31    /// Doom: the Emacs preset's org bindings in every evil state (as org-mode-map's are), with
 32    /// evil-org's `M-h/j/k/l` forms, then Doom's leader, localleader and evil-org keys.
 33    static var doomToml: String {
 34        var problems: [String] = []
 35        let emacs = try! Keymap(toml: common + emacsBindings, problems: &problems)
 36        let translations: [String: String] = ["<left>": "h", "<right>": "l", "<up>": "k", "<down>": "j"]
 37        var out = ""
 38        func bind(_ keys: String, _ command: String, when: String?, mode: String) {
 39            out += "[[bind]]\nkeys = \"\(keys.replacingOccurrences(of: "\\", with: "\\\\"))\"\ncommand = \"\(command)\"\n"
 40            if let when { out += "when = \"\(when)\"\n" }
 41            out += "mode = \"\(mode)\"\n"
 42        }
 43        for binding in emacs.bindings {
 44            let first = binding.keys[0]
 45            let keys = KeySequence.format(binding.keys)
 46            let orgKey = first.key == "c" && first.modifiers == [.control] || first.key == "x" && first.modifiers == [.control]
 47                || (first.modifiers.contains(.meta) && ["<left>", "<right>", "<up>", "<down>", "RET"].contains(first.key))
 48                || (first.modifiers.contains(.shift) && ["<left>", "<right>", "<up>", "<down>"].contains(first.key))
 49                || (first.modifiers == [.control] && first.key == "RET")
 50                || keys == "M-x"
 51            guard orgKey else { continue }
 52            for mode in ["normal", "insert", "visual"] { bind(keys, binding.command, when: binding.when, mode: mode) }
 53            // evil-org: M-h/j/k/l and M-H/J/K/L in normal, visual and insert.
 54            if binding.keys.count == 1, first.modifiers.contains(.meta), let letter = translations[first.key] {
 55                let shifted = first.modifiers.contains(.shift)
 56                let key = "M-" + (shifted ? letter.uppercased() : letter)
 57                for mode in ["normal", "insert", "visual"] { bind(key, binding.command, when: binding.when, mode: mode) }
 58            }
 59            // Doom: C-S-h/j/k/l are org-shift* in normal and insert.
 60            if binding.keys.count == 1, first.modifiers == [.shift], let letter = translations[first.key] {
 61                for mode in ["normal", "insert"] { bind("C-" + letter.uppercased(), binding.command, when: binding.when, mode: mode) }
 62            }
 63            // evil-org insert state: C-t demotes, C-d promotes.
 64            if binding.keys.count == 1, first.modifiers == [.meta], first.key == "<right>" || first.key == "<left>" {
 65                bind(first.key == "<right>" ? "C-t" : "C-d", binding.command, when: binding.when, mode: "insert")
 66            }
 67        }
 68        return out + doomBindings
 69    }
 70
 71    static let doomBindings = """
 72        # Leader
 73        [[bind]]
 74        keys = "SPC SPC"
 75        command = "app.quick-open"
 76        mode = "normal"
 77        [[bind]]
 78        keys = "SPC q q"
 79        command = "app.quit"
 80        mode = "normal"
 81        [[bind]]
 82        keys = "SPC ."
 83        command = "app.quick-open"
 84        mode = "normal"
 85        [[bind]]
 86        keys = "SPC f f"
 87        command = "app.quick-open"
 88        mode = "normal"
 89        [[bind]]
 90        keys = "SPC b b"
 91        command = "app.quick-open"
 92        mode = "normal"
 93        [[bind]]
 94        keys = "SPC f s"
 95        command = "app.save"
 96        mode = "normal"
 97        [[bind]]
 98        keys = "SPC s s"
 99        command = "edit.find"
100        mode = "normal"
101        [[bind]]
102        keys = "SPC /"
103        command = "app.search"
104        mode = "normal"
105        [[bind]]
106        keys = "SPC s p"
107        command = "app.search"
108        mode = "normal"
109        [[bind]]
110        keys = "SPC :"
111        command = "app.palette"
112        mode = "normal"
113        [[bind]]
114        keys = "SPC o a"
115        command = "app.agenda"
116        mode = "normal"
117        [[bind]]
118        keys = "SPC X"
119        command = "app.capture"
120        mode = "normal"
121        [[bind]]
122        keys = "SPC z t"
123        command = "app.clock.report"
124        mode = "normal"
125        [[bind]]
126        keys = "SPC h r r"
127        command = "app.reload-keymap"
128        mode = "normal"
129
130        # Localleader (SPC m)
131        [[bind]]
132        keys = "SPC m t"
133        command = "org.todo.cycle"
134        mode = "normal"
135        [[bind]]
136        keys = "SPC m q"
137        command = "org.tags.set"
138        mode = "normal"
139        [[bind]]
140        keys = "SPC m x"
141        command = "org.checkbox.toggle"
142        mode = "normal"
143        [[bind]]
144        keys = "SPC m A"
145        command = "app.archive"
146        mode = "normal"
147        [[bind]]
148        keys = "SPC m e h h"
149        command = "app.export.html"
150        mode = "normal"
151        [[bind]]
152        keys = "SPC m e h o"
153        command = "app.export.html-open"
154        mode = "normal"
155        [[bind]]
156        keys = "SPC m e m m"
157        command = "app.export.markdown"
158        mode = "normal"
159        [[bind]]
160        keys = "SPC m e l p"
161        command = "app.export.pdf"
162        mode = "normal"
163        [[bind]]
164        keys = "SPC m d d"
165        command = "org.deadline"
166        mode = "normal"
167        [[bind]]
168        keys = "SPC m d s"
169        command = "org.schedule"
170        mode = "normal"
171        [[bind]]
172        keys = "SPC m d t"
173        command = "org.timestamp.active"
174        mode = "normal"
175        [[bind]]
176        keys = "SPC m d T"
177        command = "org.timestamp.inactive"
178        mode = "normal"
179        [[bind]]
180        keys = "SPC m r r"
181        command = "app.refile"
182        mode = "normal"
183        [[bind]]
184        keys = "SPC m s r"
185        command = "app.refile"
186        mode = "normal"
187        [[bind]]
188        keys = "SPC m s A"
189        command = "app.archive"
190        mode = "normal"
191        [[bind]]
192        keys = "SPC m s h"
193        command = "org.subtree.promote"
194        mode = "normal"
195        [[bind]]
196        keys = "SPC m s l"
197        command = "org.subtree.demote"
198        mode = "normal"
199        [[bind]]
200        keys = "SPC m s j"
201        command = "org.subtree.down"
202        mode = "normal"
203        [[bind]]
204        keys = "SPC m s k"
205        command = "org.subtree.up"
206        mode = "normal"
207        [[bind]]
208        keys = "SPC m c i"
209        command = "app.clock.in"
210        mode = "normal"
211        [[bind]]
212        keys = "SPC m c o"
213        command = "app.clock.out"
214        mode = "normal"
215        [[bind]]
216        keys = "SPC m c c"
217        command = "app.clock.cancel"
218        mode = "normal"
219        [[bind]]
220        keys = "SPC m c g"
221        command = "app.clock.goto"
222        mode = "normal"
223        [[bind]]
224        keys = "SPC m c R"
225        command = "app.clock.report"
226        mode = "normal"
227        [[bind]]
228        keys = "SPC m p u"
229        command = "org.priority.up"
230        mode = "normal"
231        [[bind]]
232        keys = "SPC m p d"
233        command = "org.priority.down"
234        mode = "normal"
235        [[bind]]
236        keys = "SPC m b -"
237        command = "org.table.insert-hline"
238        mode = "normal"
239        [[bind]]
240        keys = "SPC m b a"
241        command = "org.table.align"
242        mode = "normal"
243        [[bind]]
244        keys = "SPC m b r"
245        command = "org.table.recalc-all"
246        mode = "normal"
247        [[bind]]
248        keys = "SPC m b d c"
249        command = "org.table.delete-column"
250        mode = "normal"
251        [[bind]]
252        keys = "SPC m b d r"
253        command = "org.table.kill-row"
254        mode = "normal"
255        [[bind]]
256        keys = "SPC m b i c"
257        command = "org.table.insert-column"
258        mode = "normal"
259        [[bind]]
260        keys = "SPC m b i r"
261        command = "org.table.insert-row"
262        mode = "normal"
263        [[bind]]
264        keys = "SPC m b i h"
265        command = "org.table.insert-hline"
266        mode = "normal"
267
268        # evil-org and Doom's org keys
269        [[bind]]
270        keys = "TAB"
271        command = "org.cycle"
272        mode = "normal"
273        [[bind]]
274        keys = "S-TAB"
275        command = "org.cycle-global"
276        mode = "normal"
277        [[bind]]
278        keys = "RET"
279        command = "org.dwim"
280        mode = "normal"
281        [[bind]]
282        keys = "z a"
283        command = "org.cycle"
284        mode = "normal"
285        [[bind]]
286        keys = "z c"
287        command = "org.cycle"
288        mode = "normal"
289        [[bind]]
290        keys = "z o"
291        command = "org.cycle"
292        mode = "normal"
293        [[bind]]
294        keys = "z A"
295        command = "org.cycle-global"
296        mode = "normal"
297        [[bind]]
298        keys = "g h"
299        command = "org.heading.up"
300        mode = "normal"
301        [[bind]]
302        keys = "g j"
303        command = "org.heading.forward-same-level"
304        mode = "normal"
305        [[bind]]
306        keys = "g k"
307        command = "org.heading.backward-same-level"
308        mode = "normal"
309        [[bind]]
310        keys = "] h"
311        command = "org.heading.forward-same-level"
312        mode = "normal"
313        [[bind]]
314        keys = "[ h"
315        command = "org.heading.backward-same-level"
316        mode = "normal"
317        [[bind]]
318        keys = "RET"
319        command = "org.table.next-row"
320        when = "table"
321        mode = "insert"
322        [[bind]]
323        keys = "TAB"
324        command = "org.cycle"
325        mode = "visual"
326        [[bind]]
327        keys = "S-TAB"
328        command = "org.cycle-global"
329        mode = "visual"
330
331        # Insert state: org-cycle and org-shifttab with Doom's +org-indent-maybe-h, which
332        # demotes or promotes a heading and indents or outdents an item tree.
333        [[bind]]
334        keys = "S-TAB"
335        command = "org.cycle-global"
336        mode = "insert"
337        [[bind]]
338        keys = "TAB"
339        command = "org.table.next-field"
340        when = "table"
341        mode = "insert"
342        [[bind]]
343        keys = "S-TAB"
344        command = "org.table.previous-field"
345        when = "table"
346        mode = "insert"
347        [[bind]]
348        keys = "TAB"
349        command = "org.item.indent-tree"
350        when = "item"
351        mode = "insert"
352        [[bind]]
353        keys = "S-TAB"
354        command = "org.item.outdent-tree"
355        when = "item"
356        mode = "insert"
357        [[bind]]
358        keys = "TAB"
359        command = "org.heading.demote"
360        when = "heading"
361        mode = "insert"
362        [[bind]]
363        keys = "S-TAB"
364        command = "org.heading.promote"
365        when = "heading"
366        mode = "insert"
367
368        """
369
370
371    static let common = """
372        [[bind]]
373        keys = "TAB"
374        command = "org.cycle"
375        when = "heading"
376
377        [[bind]]
378        keys = "S-TAB"
379        command = "org.cycle-global"
380        [[bind]]
381        keys = "TAB"
382        command = "org.table.next-field"
383        when = "table"
384        [[bind]]
385        keys = "S-TAB"
386        command = "org.table.previous-field"
387        when = "table"
388        [[bind]]
389        keys = "RET"
390        command = "org.table.next-row"
391        when = "table"
392
393        """
394
395    static let emacsBindings = """
396        # Movement and editing. With a mark set (C-SPC), movement extends the region.
397        [[bind]]
398        keys = "C-f"
399        command = "edit.forward-char"
400        [[bind]]
401        keys = "C-b"
402        command = "edit.backward-char"
403        [[bind]]
404        keys = "C-n"
405        command = "edit.next-line"
406        [[bind]]
407        keys = "C-p"
408        command = "edit.previous-line"
409        [[bind]]
410        keys = "C-a"
411        command = "edit.beginning-of-line"
412        [[bind]]
413        keys = "C-e"
414        command = "edit.end-of-line"
415        [[bind]]
416        keys = "M-f"
417        command = "edit.forward-word"
418        [[bind]]
419        keys = "M-b"
420        command = "edit.backward-word"
421        [[bind]]
422        keys = "M-<"
423        command = "edit.beginning-of-buffer"
424        [[bind]]
425        keys = "M->"
426        command = "edit.end-of-buffer"
427        [[bind]]
428        keys = "C-v"
429        command = "edit.scroll-up"
430        [[bind]]
431        keys = "M-v"
432        command = "edit.scroll-down"
433        [[bind]]
434        keys = "C-l"
435        command = "edit.recenter"
436        [[bind]]
437        keys = "C-d"
438        command = "edit.delete-char"
439        [[bind]]
440        keys = "M-d"
441        command = "edit.kill-word"
442        [[bind]]
443        keys = "M-DEL"
444        command = "edit.backward-kill-word"
445        [[bind]]
446        keys = "C-k"
447        command = "edit.kill-line"
448        [[bind]]
449        keys = "C-y"
450        command = "edit.yank"
451        [[bind]]
452        keys = "C-SPC"
453        command = "edit.set-mark"
454        [[bind]]
455        keys = "C-x h"
456        command = "edit.select-all"
457        [[bind]]
458        keys = "C-w"
459        command = "edit.kill-region"
460        [[bind]]
461        keys = "M-w"
462        command = "edit.copy-region"
463        [[bind]]
464        keys = "C-/"
465        command = "edit.undo"
466        [[bind]]
467        keys = "C-_"
468        command = "edit.undo"
469        [[bind]]
470        keys = "C-x u"
471        command = "edit.undo"
472        [[bind]]
473        keys = "C-g"
474        command = "edit.keyboard-quit"
475        [[bind]]
476        keys = "C-t"
477        command = "edit.transpose-chars"
478        [[bind]]
479        keys = "C-s"
480        command = "edit.find"
481        [[bind]]
482        keys = "C-r"
483        command = "edit.find"
484
485        # Files and commands
486        [[bind]]
487        keys = "C-x C-s"
488        command = "app.save"
489        [[bind]]
490        keys = "C-x C-f"
491        command = "app.quick-open"
492        [[bind]]
493        keys = "C-x b"
494        command = "app.quick-open"
495        [[bind]]
496        keys = "M-x"
497        command = "app.palette"
498        [[bind]]
499        keys = "C-c a"
500        command = "app.agenda"
501        [[bind]]
502        keys = "C-c c"
503        command = "app.capture"
504        [[bind]]
505        keys = "C-c C-x C-i"
506        command = "app.clock.in"
507        [[bind]]
508        keys = "C-c C-x C-o"
509        command = "app.clock.out"
510        [[bind]]
511        keys = "C-c C-x C-q"
512        command = "app.clock.cancel"
513        [[bind]]
514        keys = "C-c C-x C-j"
515        command = "app.clock.goto"
516        [[bind]]
517        keys = "C-c C-e h h"
518        command = "app.export.html"
519        [[bind]]
520        keys = "C-c C-e h o"
521        command = "app.export.html-open"
522        [[bind]]
523        keys = "C-c C-e m m"
524        command = "app.export.markdown"
525        [[bind]]
526        keys = "C-c C-e l p"
527        command = "app.export.pdf"
528        [[bind]]
529        keys = "C-c C-e l l"
530        command = "app.export.latex"
531        [[bind]]
532        keys = "C-c C-e o o"
533        command = "app.export.odt"
534        [[bind]]
535        keys = "C-c C-e t u"
536        command = "app.export.text"
537
538        # Org
539        [[bind]]
540        keys = "C-c C-t"
541        command = "org.todo.cycle"
542        [[bind]]
543        keys = "S-<right>"
544        command = "org.todo.cycle"
545        when = "heading"
546        [[bind]]
547        keys = "S-<up>"
548        command = "org.priority.up"
549        when = "heading"
550        [[bind]]
551        keys = "S-<down>"
552        command = "org.priority.down"
553        when = "heading"
554        [[bind]]
555        keys = "M-<left>"
556        command = "org.heading.promote"
557        when = "heading"
558        [[bind]]
559        keys = "M-<right>"
560        command = "org.heading.demote"
561        when = "heading"
562        [[bind]]
563        keys = "M-S-<left>"
564        command = "org.subtree.promote"
565        when = "heading"
566        [[bind]]
567        keys = "M-S-<right>"
568        command = "org.subtree.demote"
569        when = "heading"
570        [[bind]]
571        keys = "M-<up>"
572        command = "org.subtree.up"
573        when = "heading"
574        [[bind]]
575        keys = "M-<down>"
576        command = "org.subtree.down"
577        when = "heading"
578        [[bind]]
579        keys = "M-RET"
580        command = "org.heading.insert"
581        [[bind]]
582        keys = "C-RET"
583        command = "org.heading.insert-after-subtree"
584        [[bind]]
585        keys = "M-S-RET"
586        command = "org.heading.insert-todo"
587        [[bind]]
588        keys = "C-c C-n"
589        command = "org.heading.next"
590        [[bind]]
591        keys = "C-c C-p"
592        command = "org.heading.previous"
593        [[bind]]
594        keys = "C-c C-f"
595        command = "org.heading.forward-same-level"
596        [[bind]]
597        keys = "C-c C-b"
598        command = "org.heading.backward-same-level"
599        [[bind]]
600        keys = "C-c C-u"
601        command = "org.heading.up"
602        [[bind]]
603        keys = "C-c C-q"
604        command = "org.tags.set"
605        [[bind]]
606        keys = "M-RET"
607        command = "org.item.insert"
608        when = "item"
609        [[bind]]
610        keys = "M-S-RET"
611        command = "org.item.insert-checkbox"
612        when = "item"
613        [[bind]]
614        keys = "M-<left>"
615        command = "org.item.outdent"
616        when = "item"
617        [[bind]]
618        keys = "M-<right>"
619        command = "org.item.indent"
620        when = "item"
621        [[bind]]
622        keys = "M-S-<left>"
623        command = "org.item.outdent-tree"
624        when = "item"
625        [[bind]]
626        keys = "M-S-<right>"
627        command = "org.item.indent-tree"
628        when = "item"
629        [[bind]]
630        keys = "M-<up>"
631        command = "org.item.up"
632        when = "item"
633        [[bind]]
634        keys = "M-<down>"
635        command = "org.item.down"
636        when = "item"
637        [[bind]]
638        keys = "C-c C-c"
639        command = "org.checkbox.toggle"
640        when = "item"
641        [[bind]]
642        keys = "C-c C-x C-b"
643        command = "org.checkbox.toggle"
644        [[bind]]
645        keys = "C-c C-w"
646        command = "app.refile"
647        [[bind]]
648        keys = "C-c C-x C-s"
649        command = "app.archive"
650        [[bind]]
651        keys = "C-c $"
652        command = "app.archive"
653        [[bind]]
654        keys = "C-c ."
655        command = "org.timestamp.active"
656        [[bind]]
657        keys = "C-c !"
658        command = "org.timestamp.inactive"
659        [[bind]]
660        keys = "C-c C-s"
661        command = "org.schedule"
662        [[bind]]
663        keys = "C-c C-d"
664        command = "org.deadline"
665        [[bind]]
666        keys = "M-q"
667        command = "org.fill-paragraph"
668        [[bind]]
669        keys = "C-c C-c"
670        command = "org.table.align"
671        when = "table"
672        [[bind]]
673        keys = "C-c C-c"
674        command = "org.table.recalc-all"
675        when = "tblfm"
676        [[bind]]
677        keys = "C-c *"
678        command = "org.table.recalc"
679        when = "table"
680        [[bind]]
681        keys = "C-c C-c"
682        command = "org.babel.execute"
683        when = "src"
684        [[bind]]
685        keys = "M-<up>"
686        command = "org.table.row-up"
687        when = "table"
688        [[bind]]
689        keys = "M-<down>"
690        command = "org.table.row-down"
691        when = "table"
692        [[bind]]
693        keys = "M-<left>"
694        command = "org.table.column-left"
695        when = "table"
696        [[bind]]
697        keys = "M-<right>"
698        command = "org.table.column-right"
699        when = "table"
700        [[bind]]
701        keys = "M-S-<right>"
702        command = "org.table.insert-column"
703        when = "table"
704        [[bind]]
705        keys = "M-S-<left>"
706        command = "org.table.delete-column"
707        when = "table"
708        [[bind]]
709        keys = "M-S-<up>"
710        command = "org.table.kill-row"
711        when = "table"
712        [[bind]]
713        keys = "M-S-<down>"
714        command = "org.table.insert-row"
715        when = "table"
716        [[bind]]
717        keys = "C-c -"
718        command = "org.table.insert-hline"
719        when = "table"
720        [[bind]]
721        keys = "C-c |"
722        command = "org.table.create"
723        [[bind]]
724        keys = "S-<up>"
725        command = "org.timestamp.up"
726        when = "timestamp"
727        [[bind]]
728        keys = "S-<down>"
729        command = "org.timestamp.down"
730        when = "timestamp"
731        [[bind]]
732        keys = "S-<right>"
733        command = "org.timestamp.day-later"
734        when = "timestamp"
735        [[bind]]
736        keys = "S-<left>"
737        command = "org.timestamp.day-earlier"
738        when = "timestamp"
739
740        """
741
742    /// Standard Mac text keys stay as they are; org commands use Control-Command chords, which
743    /// macOS text editing leaves free.
744    static let macBindings = """
745        [[bind]]
746        keys = "C-s-t"
747        command = "org.todo.cycle"
748        [[bind]]
749        keys = "C-s-<up>"
750        command = "org.priority.up"
751        [[bind]]
752        keys = "C-s-<down>"
753        command = "org.priority.down"
754        [[bind]]
755        keys = "C-s-<left>"
756        command = "org.heading.promote"
757        [[bind]]
758        keys = "C-s-<right>"
759        command = "org.heading.demote"
760        [[bind]]
761        keys = "C-M-s-<left>"
762        command = "org.subtree.promote"
763        [[bind]]
764        keys = "C-M-s-<right>"
765        command = "org.subtree.demote"
766        [[bind]]
767        keys = "C-M-s-<up>"
768        command = "org.subtree.up"
769        [[bind]]
770        keys = "C-M-s-<down>"
771        command = "org.subtree.down"
772        [[bind]]
773        keys = "s-RET"
774        command = "org.heading.insert"
775        [[bind]]
776        keys = "C-s-RET"
777        command = "org.heading.insert-after-subtree"
778        [[bind]]
779        keys = "s-S-RET"
780        command = "org.heading.insert-todo"
781        [[bind]]
782        keys = "M-s-<down>"
783        command = "org.heading.next"
784        [[bind]]
785        keys = "M-s-<up>"
786        command = "org.heading.previous"
787        [[bind]]
788        keys = "C-s-q"
789        command = "org.tags.set"
790        [[bind]]
791        keys = "s-RET"
792        command = "org.item.insert"
793        when = "item"
794        [[bind]]
795        keys = "s-S-RET"
796        command = "org.item.insert-checkbox"
797        when = "item"
798        [[bind]]
799        keys = "C-s-<left>"
800        command = "org.item.outdent"
801        when = "item"
802        [[bind]]
803        keys = "C-s-<right>"
804        command = "org.item.indent"
805        when = "item"
806        [[bind]]
807        keys = "C-M-s-<left>"
808        command = "org.item.outdent-tree"
809        when = "item"
810        [[bind]]
811        keys = "C-M-s-<right>"
812        command = "org.item.indent-tree"
813        when = "item"
814        [[bind]]
815        keys = "C-M-s-<up>"
816        command = "org.item.up"
817        when = "item"
818        [[bind]]
819        keys = "C-M-s-<down>"
820        command = "org.item.down"
821        when = "item"
822        [[bind]]
823        keys = "C-s-c"
824        command = "org.checkbox.toggle"
825        [[bind]]
826        keys = "C-s-w"
827        command = "app.refile"
828        [[bind]]
829        keys = "C-s-a"
830        command = "app.archive"
831        [[bind]]
832        keys = "C-s-."
833        command = "org.timestamp.active"
834        [[bind]]
835        keys = "C-M-s-."
836        command = "org.timestamp.inactive"
837        [[bind]]
838        keys = "C-s-s"
839        command = "org.schedule"
840        [[bind]]
841        keys = "C-s-d"
842        command = "org.deadline"
843        [[bind]]
844        keys = "C-s-p"
845        command = "org.fill-paragraph"
846        [[bind]]
847        keys = "C-s-<up>"
848        command = "org.table.row-up"
849        when = "table"
850        [[bind]]
851        keys = "C-s-<down>"
852        command = "org.table.row-down"
853        when = "table"
854        [[bind]]
855        keys = "C-s-<left>"
856        command = "org.table.column-left"
857        when = "table"
858        [[bind]]
859        keys = "C-s-<right>"
860        command = "org.table.column-right"
861        when = "table"
862        [[bind]]
863        keys = "C-M-s-<right>"
864        command = "org.table.insert-column"
865        when = "table"
866        [[bind]]
867        keys = "C-M-s-<left>"
868        command = "org.table.delete-column"
869        when = "table"
870        [[bind]]
871        keys = "C-M-s-<up>"
872        command = "org.table.kill-row"
873        when = "table"
874        [[bind]]
875        keys = "C-M-s-<down>"
876        command = "org.table.insert-row"
877        when = "table"
878        [[bind]]
879        keys = "C-s--"
880        command = "org.table.insert-hline"
881        when = "table"
882        [[bind]]
883        keys = "C-s-\\\\"
884        command = "org.table.create"
885        [[bind]]
886        keys = "C-s-<up>"
887        command = "org.timestamp.up"
888        when = "timestamp"
889        [[bind]]
890        keys = "C-s-<down>"
891        command = "org.timestamp.down"
892        when = "timestamp"
893        [[bind]]
894        keys = "C-s-<right>"
895        command = "org.timestamp.day-later"
896        when = "timestamp"
897        [[bind]]
898        keys = "C-s-<left>"
899        command = "org.timestamp.day-earlier"
900        when = "timestamp"
901
902        """
903}