My environment
MacOS:
Catalina 10.15.5 (19F101)
VSCode:
Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.5.0
VSCode Vim:
v1.14.5
Issue
Often times, when I press the caps lock key in insert mode or command mode, I forget to press it again to turn it off when we enter normal mode, and that can cause a lot of trouble.
So there is a solution for it for the regular vim that you use in a terminal.
https://vim.fandom.com/wiki/Insert-mode_only_Caps_Lock
Question
- Is there a way to use this "Insert-mode only Caps Lock" with VSCode Vim(extension)?
- Is there anyway I can turn off caps lock when I go back to normal mode from insert/command mode?
- Is there anyway I can turn off caps lock whenever Esc key is pressed (on MacOS)?
https://unix.stackexchange.com/questions/61242/turn-off-caps-lock-when-escape-is-pressed
(Maybe withe a help of a software like Karabiner Elements?)
What I've tried that didn't work
- Since VSCode supports .
.vimrc
, I created it and put this code, but it didn't work. (This works with regular vim in the terminal)
for c in range(char2nr('A'), char2nr('Z'))
execute 'lnoremap ' . nr2char(c+32) . ' ' . nr2char(c)
execute 'lnoremap ' . nr2char(c) . ' ' . nr2char(c+32)
endfor
autocmd InsertLeave * set iminsert=0
- I looked for a "Karabiner-Elements complex_modifications rules", but couldn't find what I was looking for.
https://ke-complex-modifications.pqrs.org/