-
Notifications
You must be signed in to change notification settings - Fork 10
/
clojure_keybindings.sublime-keymap
84 lines (61 loc) · 4.09 KB
/
clojure_keybindings.sublime-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
[
////////////////////////////////////////////////////////////
// Clojure setup
// SublimeREPL bindings:
// =====================
// Start a new clojure repl. Leaves existing open. Note that SublimeREPL doesn't handle multiple
// REPLs very well. They will work but it's not clear which repl will receive commands sent from
// another clojure editor.
{ "keys": ["alt+super+l"], "command": "run_existing_window_command", "args":{"id": "repl_clojure",
"file": "config/Clojure/Main.sublime-menu"}},
{ "keys": ["alt+super+b"], "command": "repl_transfer_current", "args": {"scope": "block"}},
// Commands located in ClojureHelpers.py
{ "keys": ["alt+super+s"], "command": "load_selection_in_repl"},
// Replaces a built in command in Sublime REPL (it's faster)
// Press ctrl and comma, release then press f to laod the current file in the repl.
{ "keys": ["ctrl+,", "f"], "command": "load_file_in_repl"},
// Refreshes all code. Handle compilation errors correctly where user/reset will disappear.
{ "keys": ["alt+super+r"], "command": "refresh_namespaces_in_repl", "args": {"clean": false}},
// Refreshes all code after running (clojure.tools.namespace.repl/clear).
// This can fix problems if some of the namespaces have been removed etc.
{"keys": ["alt+super+shift+r"], "command": "refresh_namespaces_in_repl", "args": {"clean": true}},
// Exit the repl
{ "keys": ["ctrl+d"], "command": "run_command_in_repl", "args": {"command": "(System/exit 0)"}},
// Pretty print the last returned value
{ "keys": ["alt+super+p"], "command": "run_command_in_repl", "args": {"command": "(pp)"}},
// Refresh code then run tests from the current namespace in repl
{ "keys": ["alt+super+x"], "command": "run_command_in_namespace_in_repl", "args": {"command": "(do (require 'clojure.test) (clojure.test/run-tests))", "refresh_namespaces": true}},
// Runs the single selected test. You must select the test name.
{ "keys": ["alt+super+t"], "command": "test_selected_var_in_repl", "args": {"refresh_namespaces": false}},
// Refresh code then run all tests in in the project in the repl in a future.
// Cancelling all running tests can be done by issuing the reset command. (cmd + alt + r)
{ "keys": ["alt+super+a"], "command": "run_command_in_repl", "args": {"command": "(def all-tests-future (future (time (run-all-tests))))", "refresh_namespaces": true}},
// Print documentation for selected function call.
{ "keys": ["alt+super+d"], "command": "run_on_selection_in_repl", "args": {"function": "clojure.repl/doc"}},
// Print source code for selected function call.
{ "keys": ["alt+super+c"], "command": "run_on_selection_in_repl", "args": {"function": "clojure.repl/source"}},
// List functions in a namespace
{ "keys": ["alt+super+n"], "command": "list_vars_in_selected_ns"},
// List functions with documentation in a namespace
{ "keys": ["alt+super+shift+n"], "command": "list_vars_with_docs_in_selected_ns"},
// Open the file and line containing a var that is currently selected
{ "keys": ["alt+super+o"], "command": "open_file_containing_var"},
// BracketHighlighter bindings:
// ===========================
// Swap bracket type
{ "keys": ["ctrl+shift+]"],
"command": "swap_brackets"},
// Swap quotes (only goes boths ways in supported languages...)
{ "keys": ["ctrl+shift+'"],
"command": "bh_key", "args": {"lines" : true, "plugin": {"type": ["single_quote", "double_quote", "py_single_quote", "py_double_quote"], "command": "bh_modules.swapquotes"} }},
// Select text between brackets
// Jason Note: I found ctrl+shift+m works better for selecting text in brackets. It keeps expanding too.
{ "keys": ["ctrl+alt+a"],
"command": "bh_key", "args": {"lines" : true, "plugin": {"type": ["__all__"], "command": "bh_modules.bracketselect"} } },
// Select tag name of HTML/XML tag (both opening name and closing)
{ "keys": ["ctrl+alt+t"],
"command": "bh_key", "args": {"plugin": {"type": ["cfml", "html", "angle"], "command": "bh_modules.tagnameselect"} } },
// Toggle high visibility mode
{ "keys": ["alt+super+="],
"command": "bh_toggle_high_visibility"}
]