Created
June 1, 2023 20:26
-
-
Save isaksky/94128cda6297e560dbe75650611993c1 to your computer and use it in GitHub Desktop.
Calva Keybindings, WASD movement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
// Disable crazy VSCode default bindings | |
{ | |
"key": "ctrl+shift+w", | |
"command": "-workbench.action.closeWindow" | |
}, | |
{ | |
"key": "ctrl+w", | |
"command": "-workbench.action.closeActiveEditor" | |
}, | |
// Paredit movement with WASD | |
{ | |
"key": "ctrl+shift+w", | |
"command": "paredit.backwardUpSexp", | |
"when": "calva:replWindowActive || editorLangId == clojure && editorTextFocus && paredit:keyMap =~ /original|strict/" | |
}, | |
{ | |
"key": "ctrl+shift+d", | |
"command": "paredit.forwardSexpOrUp", | |
"when": "calva:replWindowActive || editorLangId == clojure && editorTextFocus && paredit:keyMap =~ /original|strict/" | |
}, | |
{ | |
"key": "ctrl+shift+a", | |
"command": "paredit.backwardSexpOrUp", | |
"when": "calva:replWindowActive || editorLangId == clojure && editorTextFocus && paredit:keyMap =~ /original|strict/" | |
}, | |
{ | |
"key": "ctrl+shift+s", | |
"command": "paredit.forwardDownSexp", | |
"when": "calva:replWindowActive || editorLangId == clojure && editorTextFocus && paredit:keyMap =~ /original|strict/" | |
}, | |
// ---------------------------------- | |
// Paredit manipulation with WASD | |
// ---------------------------------- | |
// Useful for wrapping something e.g., `(when|) (do-something) ==> (when| (do-something))` | |
{ | |
"key": "ctrl+alt+d", | |
"command": "paredit.slurpSexpForward", | |
"when": "calva:keybindingsEnabled && editorTextFocus && !calva:cursorInComment && editorLangId == 'clojure' && paredit:keyMap =~ /original|strict/" | |
}, | |
// Useful for taking something out of a form. e.g., `(comment |(do-something!))` ==> `|(do-something!)` | |
{ | |
"key": "ctrl+alt+w", | |
"command": "paredit.spliceSexpKillBackward", | |
"when": "calva:keybindingsEnabled && editorTextFocus && !calva:cursorInComment && editorLangId == 'clojure' && paredit:keyMap =~ /original|strict/" | |
}, | |
// Nice to haves from cursive | |
{ | |
"key": "ctrl+k", | |
"command": "paredit.killSexpForward", | |
"when": "calva:keybindingsEnabled && editorTextFocus && !calva:cursorInComment && editorLangId == 'clojure' && paredit:keyMap =~ /original|strict/" | |
}, | |
{ | |
"key": "ctrl+w", | |
"command": "paredit.sexpRangeExpansion", | |
"when": "calva:keybindingsEnabled && editorTextFocus && !calva:cursorInComment && editorLangId == 'clojure' && paredit:keyMap =~ /original|strict/" | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment