When editing code in Vim, I will often use caps lock when writing stuff in ALL CAPS. However, I often forget to turn off caps lock when I'm done with the capitalized portion. This causes no end of pain (since, ie, j moves down, but J joins the current line with the line below).
Usually, I want to turn off caps lock when I exit insert mode. How can I add something to my .vimrc so that it will either turn caps lock off when exiting insert mode? Alternately, how could I add something to my .vimrc so that it will alert me (status line? beep? any alert is fine) if I have caps lock on when exiting insert mode?
Thanks!
autocmd InsertLeave
to perform an action when leaving insert mode but I don't think there's a way to turn caps on/off from within vim since it's a modifier key (you might be able to do it in an OS specific way though). – Benjnnoremap <C-u> gUiw
andinoremap <C-u> <esc>gUiwea
to uppercase single words; additionally i use autocomplpop-plugin so any word i already typed is suggested in the way i typed it. – epsilonhalbe