Escape key alternatives in Vim
eduardobautista.com
eduardobautista.com
http://www.economyofeffort.com/2014/08/11/beyond-ctrl-remap-...
imap jj <Esc>
If you're interested in doing that, I'd strongly recommend you never do a plain `imap` and instead always do `inoremap` (this advice applies to `nmap`, `vmap`, and the like as well). The difference is that the noremap variant is non-recursive [0].Also, since we're on the subject of escape alternatives, I may as well mention mine. It really bothers me that exiting insert mode moves your cursor back a space. To remedy that, I've got a custom mapping that escapes and them jumps to the mark at which insert mode last was [1]. The mapping is:
inoremap jj <Esc>`^
[0]: http://learnvimscriptthehardway.stevelosh.com/chapters/05.ht...As a bonus, it works in readlines vi mode as well.
When I have to type all caps, I find myself chording a lot. The alternative is to always use the right shift for capital letters on the left and vice versa, but that doesn't work well for all caps words. Therefore I'm trying to learn to actually use caps lock.
Admittedly it's not going very well
Admittedly it doesn't help for non-Vim applications, but I don't find myself typing all caps outside Vim very often. It's usually to type something like FOO_BAR, but then you can just type FO<Ctrl-N> and that usually works.
"go Uppercase inside double quotes"
I use i3wm which lets you define your own modes and bind arbitrary keys to commands. Effecting a mode is a set of effective bindings wherein one binding in one mode can make a different mode active letting you define vim like sequences of keys to accomplish a goal.
I use xcape which lets you have a key produce a different key when pressed vs used as a modifier. I use the key produced by tapping right shift to start operations with my window manager. Eg vot opens appkey t in this case terminal in a vertical split. In Emacs I use the key produced by tapping left shift to start operations as a leader key eg to correct mispellings I use left shift c w.
I remap caps to escape. I would also just map escape to caps but some games seem to ignore what you have mapped and require you to press the real escape key to get out of a menu. So lacking an optimal key I just map right shift -> c to caps.
It also has the advantage of usually being a no-op in visual mode (kj moves up, then moves down). "jk" has the same advantage. Whereas "jj" will move you down.
I also have my caps-lock key mapped to escape.
(EDIT: learning from bilalq https://news.ycombinator.com/item?id=13101691)
"during insert, kj escapes, `^ is so that the cursor doesn't move
inoremap kj <Esc>`^
"during insert, lkj escapes and saves
inoremap lkj <Esc>`^:w<CR>
"during insert, lkj escapes and saves and QUITS
inoremap ;lkj <Esc>:wq<CR> vnoremap <C-c> <Esc>
inoremap <C-c> <Esc>
inoremap <Esc> <nop>
vnoremap <Esc> <nop>I'm getting by with the stock html syntax:
au BufNewFile,BufRead *.vue set filetype=html Bundle 'scrooloose/syntastic'
Plugin 'tmhedberg/SimpylFold'
Plugin 'ipartola/igor-vim'
Plugin 'othree/yajs.vim'
Plugin 'mxw/vim-jsx'
Plugin 'leafgarland/typescript-vim'
Plugin 'posva/vim-vue'
Plugin 'bronson/vim-trailing-whitespace'Does anyone here remap backspace to something else? My right wrist has been particularly RSI sensitive in the last month or so and I've noticed that reaching for backspace tends to set it off.
Highly recommended for Linux or Windows desktop computers if you have RSI trouble. A bit unwieldy for laptops though. I use both and switching isn't a big issue (unlike switching national keyboards, which drives me crazy). It doesn't quite have enough modifiers for Mac - can't have both left and right versions of shift, alt, ctrl and command.
Vi users have to swap the up-arrow and the down-arrow since they use the same fingers as j and k, but reversed. However, it's pretty easy to remap, and it happens in the keyboard so it works everywhere.
set timeout timeoutlen=1000 ttimeoutlen=10