5 ms·
This is actually a really good guide. I use vim daily at work, and my .vimrc shares most of these settings. One big productivity boost for me was remapping the
by kgroll 16y ago
This is actually a really good guide. I use vim daily at work, and my .vimrc shares most of these settings.
One big productivity boost for me was remapping the Escape key to something a little more convenient. I just remapped the ESC key altogether, but this can throw you off if you find yourself working at lots of different computers. If you prefer something less permanent, you can map a key sequence to ESC. I like this one, which maps 'sdf' to ESC if you're in insert mode:
imap sdf <ESC>
jkjk is also a sequence I've seen used.
- swah 16y agoSo you can't type sdf in your code?
- stralep 16y agoYou can type it... Just slowly My combination is just kj.
- cageface 16y agoI have jj in my .vimrc.
- zem 16y agovf is the easiest-to-type two-letter sequence i could find that doesn't appear in any english word. other languages' mileages may, of course, vary. (and if some chavfucker wants to object, well...)
- fortes 16y agoI use ;;
- cageface 16y agoNot a lisp programmer, I take it.
- telemachos 16y agoI'm less learned: the first thing I thought was case branches in Bash scripts.
- X-Istence 16y agoThis would suck if one is also Dutch. We have kj appear rather frequently in words.
- judofyr 16y agoYou can also use Ctrl-C to get out of insert mode.
- ptn 16y agoYes, but that's not equivalent to Esc, use this: inoremap <C-c> <Esc>
- bsergean 16y ago99% of the time it's equivalent, I think it's only when I'm in colon mode that Ctrl-C is not working. Ctrl^[ is another escape. But the sdf trick might be handy.
- graywh 16y agoThat bypasses any InsertLeave autocmds.
- pge 16y agoctrl-[ is also equivalent to Esc
- edanm 16y agoWhy jk twice? I just use jk. Almost never appears in actual writing, and it makes vim much easier to use.
- zem 16y agoDijkstra would disapprove (:
- hasenj 16y agoweird I use <C-j> in insert mode (not to be confused with <C-j> in command mode, which jumps to the buffer below).
- junkbit 16y agoFinally! A use for caps-lock
- graywh 16y agoEmacs and Vim users sometimes return Caps Lock to its previous function: Control. It's more useful than Escape.
- jjcm 16y agoI typically just remap the escape key to capslock at the OS level. Even though it can through you off like you said, I still find it more convenient than key walks to generate an escape.
- bsergean 16y agoUnfortunately I don't think you can do that on a Mac. Because it would be the most portable way (would work with the shell command line too).