-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuser.keymap
205 lines (190 loc) · 12.1 KB
/
user.keymap
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
202
203
204
205
[
[:app "alt-d" :dev-inspector]
[:app "alt-t o" :tabs.move-new-tabset]
[:app "alt-space" :user.commandbar]
[:app "alt-l" :user.def-let]
[:app "cmd-b" :user.open-buffers]
;; needs to be in :app to print actual context
[:app "alt-t c" :user.print-context]
[:app "alt-tab" :tabset.next]
[:app "alt-x" :tabset.close]
[:app "cmd-k" :clear-inline-results]
[:app "alt-t r" :tabs.move-next-tabset]
[:app "-ctrl-x ctrl-f" :claire-show]
;; Broken alt combos: i,e
[:editor "alt-g" :gitbeam.out-with-external-browser]
;; here instead of <Space> vim/map-keys b/c of selection limitation
[:editor "alt-," :user.toggle-current-inline-result]
[:editor "ctrl-j" :editor.sublime.selectLinesDownward]
[:editor "alt-shift-w" :editor.watch.unwatch]
[:editor "ctrl-k" :editor.sublime.selectLinesUpward]
[:editor "cmd-=" :paredit.select.parent :smart-indent-selection :paredit.select.clear]
[:editor "alt-v" :user.view-current-inline-result]
[:editor "alt-w" :editor.watch.watch-selection]
;;Eval the parent ( ... )
[:editor "alt-enter" (:paredit.select.parent "(") :eval-editor-form :paredit.select.clear]
[:editor "alt-shift-c" :user.copy-current-inline-result]
[:editor "alt-;" :user.comment-let]
[:editor "alt-shift-g" :gitbeam.out-with-internal-browser]
[:editor "alt-=" :smart-indent-selection]
[:editor "alt-c" :gitbeam.out-with-clipboard-copy]
;; Thanks to https://github.com/jamii/lt-config/ for most watches
[:editor.clj "alt-shift-p" (:eval.custom "(with-out-str (clojure.pprint/write __SELECTION__ :suppress-namespaces false :dispatch clojure.pprint/code-dispatch))" {:verbatim true, :result-type :replace})]
[:editor.clj "alt-m" (:eval.custom "(with-out-str (clojure.pprint/write (macroexpand-1 '__SELECTION__) :suppress-namespaces false :dispatch clojure.pprint/code-dispatch))" {:verbatim true, :result-type :inline})]
[:editor.clj "alt-p" (:eval.custom "(with-out-str (clojure.pprint/write __SELECTION__ :suppress-namespaces false :dispatch clojure.pprint/code-dispatch))" {:verbatim true, :result-type :inline})]
[:editor.clj "alt-r" (:eval.custom "(clojure.test/run-tests)" {:result-type :statusbar})]
[:editor.clj "alt-shift-b" (:eval.custom "(do (require '[criterium.core]) (with-out-str (criterium.core/bench (do __SELECTION__))))" {:verbatim true, :result-type :inline})]
[:editor.clj "alt-b" (:eval.custom "(with-out-str (time (do __SELECTION__)))" {:verbatim true, :result-type :inline})]
;; watches
[:editor.clj "alt-t" (:editor.watch.custom-watch-selection
"(let [start (java.lang.System/nanoTime)
res (do __SELECTION__)]
__|(str (float (/ (- (java.lang.System/nanoTime) start) 1000000)) \" ms\")|__
res)"
{:verbatim true, :class "timed"})]
[:editor.clj "alt-shift-t" (:editor.watch.custom-watch-selection "(let [result (do __SELECTION__)] (prn __SELECTION*__ result) __|result|__ result)" {})]
;; requires lein-kibit
;; from https://github.com/danielribeiro/LightTableKibit
[:editor.clj "alt-k" (:eval.custom
"(do
(require 'kibit.check)
(prn :WOW)
(if-let [better (kibit.check/check-expr '__SELECTION__)]
(with-out-str
(clojure.pprint/write (:alt better)
:suppress-namespaces true
:dispatch clojure.pprint/code-dispatch))
__SELECTION*__))"
{:verbatim true, :result-type :replace})]
[:editor.cljs "alt-p" (:eval.custom "(.log js/console __SELECTION__)" {:verbatim true, :result-type :inline})]
[:editor.cljs "alt-shift-p" (:eval.custom "(prn __SELECTION__)" {:verbatim true, :result-type :inline})]
;; Sorts a clojure :require statement. Doesn't pretty print it yet
[:editor.cljs "alt-r" (:eval.custom "(cons (first '__SELECTION__) (sort (rest '__SELECTION__)))" {:verbatim false, :result-type :replace})]
[:editor.javascript "alt-enter" (:paredit.select.parent "{") :eval-editor-form :paredit.select.clear]
[:editor.keys.vim.normal "cmd-;" :user.vim-toggle-comment-selection]
[:editor.keys.vim.normal "alt-q" :lt.plugins.reflow/reflow]
;;Select the parent expression, whether that's [], {}, or ()
[:editor.keys.vim.normal "cmd-," :paredit.select.parent]
;; Satisfied having as a default. Can always make this more specific - https://github.com/LightTable/LightTable/issues/1379
[:editor.keys.vim.normal "backspace" :paredit-plus.backward-delete]
;; CodeMirror keys
[:editor.keys.vim.normal.cm "-" :user.find-next-clojure-word]
[:editor.keys.vim.normal.cm "j" "gj"]
[:editor.keys.vim.normal.cm "k" "gk"]
[:editor.keys.vim.normal.cm "gJ" :user.smart-join]
;; <Space> is a leader key in normal mode
[:editor.keys.vim.normal.cm "<Space>b" :behaviors.modify-user]
[:editor.keys.vim.normal.cm "<Space>B" :behaviors.view-default]
; c - for cancel/clear/kill actions
[:editor.keys.vim.normal.cm "<Space>cc" :clear-console]
[:editor.keys.vim.normal.cm "<Space>cC" :editor.disconnect-clients]
[:editor.keys.vim.normal.cm "<Space>ce" :eval.cancel-all!]
[:editor.keys.vim.normal.cm "<Space>ct" :tabset.next :user.close-current-tabs :tabset.close]
[:editor.keys.vim.normal.cm "<Space>cw" :editor.watch.remove-all]
[:editor.keys.vim.normal.cm "<Space>cs" :reset-working]
;; (d)ev
[:editor.keys.vim.normal.cm "<Space>dc" :user.jump-to-command]
[:editor.keys.vim.normal.cm "<Space>db" :user.jump-to-behavior]
[:editor.keys.vim.normal.cm "<Space>do" :user.jump-to-object]
[:editor.keys.vim.normal.cm "<Space>ds" :user.clojurescript-spy]
[:editor.keys.vim.normal.cm "<Space>dS" :user.clojurescript-unspy]
;; (f)ind
[:editor.keys.vim.normal.cm "<Space>fd" :user.search-current-directory]
[:editor.keys.vim.normal.cm "<Space>ff" :user.search-current-file]
[:editor.keys.vim.normal.cm "<Space>fF" :user.search-current-folder]
[:editor.keys.vim.normal.cm "<Space>fu" :user.search-current-folder-for-fn-usage]
[:editor.keys.vim.normal.cm "<Space>fw" :user.search-current-file-with-current-word] ; same as vim's [I
[:editor.keys.vim.normal.cm "<Space>fW" :user.search-current-folder-with-current-word]
[:editor.keys.vim.normal.cm "<Space>gi" :gitbeam.in-with-clipboard]
[:editor.keys.vim.normal.cm "<Space>gI" :gitbeam.in-with-current-word]
[:editor.keys.vim.normal.cm "<Space>go" :gitbeam.out-with-external-browser]
[:editor.keys.vim.normal.cm "<Space>gn" :lt.plugins.modific.commands/goto-next-change]
[:editor.keys.vim.normal.cm "<Space>gp" :lt.plugins.modific.commands/goto-prev-change]
[:editor.keys.vim.normal.cm "<Space>gr" :lt.plugins.modific.commands/revert-change]
[:editor.keys.vim.normal.cm "<Space>gs" :lt.plugins.modific.commands/show-original]
[:editor.keys.vim.normal.cm "<Space>k" :keymap.modify-user]
[:editor.keys.vim.normal.cm "<Space>K" :keymap.view-default]
[:editor.keys.vim.normal.cm "<Space>l" :user.connect-to-lt-ui]
; (m) misc
[:editor.keys.vim.normal.cm "<Space>mc" :user.jump-to-ctag]
[:editor.keys.vim.normal.cm "<Space>me" :sancho.open-grimoire-examples]
[:editor.keys.vim.normal.cm "<Space>mE" :sancho.open-grimoire-url]
[:editor.keys.vim.normal.cm "<Space>mo" :user.eval-once]
[:editor.keys.vim.normal.cm "<Space>ms" :user.print-fn-source]
[:editor.keys.vim.normal.cm "<Space>mu" :sancho.open-crossclj-url]
; (o)pen
[:editor.keys.vim.normal.cm "<Space>ob" :add-browser-tab :browser.url-bar.focus]
[:editor.keys.vim.normal.cm "<Space>od" :show-connect]
[:editor.keys.vim.normal.cm "<Space>op" :photon.add-folder]
[:editor.keys.vim.normal.cm "<Space>oP" :photon.remove-folder]
[:editor.keys.vim.normal.cm "<Space>oc" :user.rotate-console]
[:editor.keys.vim.normal.cm "<Space>oC" :user.ensure-and-focus-second-tabset :console-tab :console.show]
[:editor.keys.vim.normal.cm "<Space>of" :claire-show]
[:editor.keys.vim.normal.cm "<Space>oF" :user.ensure-and-focus-second-tabset :editor.open-current-file-in-browser]
[:editor.keys.vim.normal.cm "<Space>ok" :user.keybinding-bar]
[:editor.keys.vim.normal.cm "<Space>or" :user.show-registers]
[:editor.keys.vim.normal.cm "<Space>ot" :tabset.new]
[:editor.keys.vim.normal.cm "<Space>ou" :user.system-open-current-url]
[:editor.keys.vim.normal.cm "<Space>oU" :user.tab-open-current-url]
[:editor.keys.vim.normal.cm "<Space>ov" :user.vertical-split-current-file] ; sams as vim's C-w v
[:editor.keys.vim.normal.cm "<Space>ow" :workspace.show-recents]
[:editor.keys.vim.normal.cm "<Space>oz" :tabs.close-others :window.fullscreen] ; (z)oom
[:editor.keys.vim.normal.cm "<Space>pc" :user.system-open-plugin-changelog]
[:editor.keys.vim.normal.cm "<Space>pm" :plugin-manager.show]
[:editor.keys.vim.normal.cm "<Space>r" :user.refresh-current-workspace-folder]
; s - kukui
[:editor.keys.vim.normal.cm "<Space>sc" :kukui.types-counts]
[:editor.keys.vim.normal.cm "<Space>sC" :kukui.all-types-counts]
[:editor.keys.vim.normal.cm "<Space>sd" :kukui.toggle-descs]
[:editor.keys.vim.normal.cm "<Space>si" :kukui.input-query-and-open-file]
[:editor.keys.vim.normal.cm "<Space>sj" :kukui.jump-to-entity]
[:editor.keys.vim.normal.cm "<Space>sJ" :kukui.jump-to-query-result-source]
[:editor.keys.vim.normal.cm "<Space>sl" :kukui.query-with-local-type]
[:editor.keys.vim.normal.cm "<Space>soe" :kukui.open-entity]
[:editor.keys.vim.normal.cm "<Space>son" :kukui.open-regex-name-search]
[:editor.keys.vim.normal.cm "<Space>sos" :kukui.open-regex-search]
[:editor.keys.vim.normal.cm "<Space>sot" :kukui.open-entity-tagged]
[:editor.keys.vim.normal.cm "<Space>soT" :kukui.open-entity-type]
[:editor.keys.vim.normal.cm "<Space>sp" :kukui.previous-query]
[:editor.keys.vim.normal.cm "<Space>sq" :kukui.query-and-open-file]
[:editor.keys.vim.normal.cm "<Space>sQ" :kukui.query-and-print]
[:editor.keys.vim.normal.cm "<Space>sr" :kukui.reset-sync]
[:editor.keys.vim.normal.cm "<Space>sR" :kukui.reset-sync-and-sync-all]
[:editor.keys.vim.normal.cm "<Space>ss" :kukui.sync-file-to-db]
[:editor.keys.vim.normal.cm "<Space>sS" :kukui.stamp-children]
; (t)oggle
[:editor.keys.vim.normal.cm "<Space>tc" :toggle-console]
[:editor.keys.vim.normal.cm "<Space>tl" :user.toggle-line-numbers]
[:editor.keys.vim.normal.cm "<Space>to" :user.toggle-open-in-current-editor]
[:editor.keys.vim.normal.cm "<Space>tw" :user.toggle-strip-whitespace]
[:editor.keys.vim.normal.cm "<Space>w" :workspace.show]
[:editor.keys.vim.normal.cm "<Space>x" :user.smart-tab-close]
;; \\ is leader key for paredit
;; loosely inspired by https://groups.google.com/forum/#!topic/light-table-discussion/BIyWHnRcoWc
[:editor.keys.vim.normal.cm "\\." :paredit.grow.right]
[:editor.keys.vim.normal.cm "\\," :paredit.shrink.right]
[:editor.keys.vim.normal.cm "\\<" :paredit.grow.left]
[:editor.keys.vim.normal.cm "\\>" :paredit.shrink.left]
[:editor.keys.vim.normal.cm "\\b" :user.paredit-kill-backword]
[:editor.keys.vim.normal.cm "\\d" :paredit-plus.delete-pair-contents]
[:editor.keys.vim.normal.cm "\\f" :paredit.move.down.forward]
[:editor.keys.vim.normal.cm "\\j" :paredit-plus.join-sexps]
[:editor.keys.vim.normal.cm "\\k" :user.paredit-kill]
[:editor.keys.vim.normal.cm "\\n" :user.paredit-newline-before-pair-close]
[:editor.keys.vim.normal.cm "\\N" :paredit-plus.new-line-after-pair-close]
[:editor.keys.vim.normal.cm "\\u" :paredit.move.up.backward]
[:editor.keys.vim.normal.cm "\\r" :paredit-plus.raise-sexp]
;; handles top-level case that paredit doesn't
[:editor.keys.vim.normal.cm "\\s" :paredit-plus.splice-sexp]
[:editor.keys.vim.normal.cm "\\|" :paredit-plus.split-sexp]
[:editor.keys.vim.normal.cm "\\(" :paredit-plus.wrap-round]
[:editor.keys.vim.normal.cm "\\{" :paredit-plus.wrap-curly]
[:editor.keys.vim.normal.cm "\\[" :paredit-plus.wrap-square]
[:editor.keys.vim.normal.cm "\\'" :paredit-plus.wrap-quote]
;; avoid going too out of the way keys for command bar
[:filter-list.input "ctrl-n" (:filter-list.input.move-selection 1)]
[:filter-list.input "ctrl-p" (:filter-list.input.move-selection -1)]
[:tabs "ctrl-tab" :snippet.select]
[:workspace.focused "ctrl-n" :lt.plugins.workspace-nav/navigate-south]
[:workspace.focused "ctrl-p" :lt.plugins.workspace-nav/navigate-north]
]