Created
October 7, 2017 01:03
-
-
Save steelcowboy/afcf344591658d2dc8148f3bec85ec01 to your computer and use it in GitHub Desktop.
VS Code -- Caps Lock to Backspace
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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "capslock", | |
"command": "replacePreviousChar", | |
"args": { | |
"text": "", | |
"replaceCharCnt": 1}, | |
"when": "editorTextFocus" | |
} | |
] |
It's good, but not perfect. Do you know how to remove a text that has been selected?
Edit:
[
{
"key": "capslock",
"command": "deleteLeft",
"when": "editorTextFocus && !editorReadonly"
}
]
Hmm this maps to deleteLeft
... in the editor only, that's nice :- )
and I'm wondering, is there no way to map it to Backspace, always, in each and every situation.
(I'm using Vim mode & Colemak, so caps-lock/backspace could be useful in many many more cases)
Edit 1 month later, this works fine this far, with VSCode and Vim and Colemak:
"key": "capslock",
"command": "extension.vim_backspace",
"when": "editorTextFocus && vim.active && !inDebugRepl"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed that, at least on Linux GNOME 3.26, Visual Studio Code uses the system keyboard layout -- with the exception of backspace not working. Digging through the sparse documentation on commands and looking at some code examples, I figured out that this config snippet will do to restore the functionality of the CapsLock key for other Colemak users!