6 ms·
I upvoted the parent and want to emphasize vim key bindings. This is not necessarily vim the editor, it's your editor of choice in vim mode. Learning to use vim
by caseymarquis 6y ago
I upvoted the parent and want to emphasize vim key bindings. This is not necessarily vim the editor, it's your editor of choice in vim mode. Learning to use vim is like learning to touch type: it's initially a pain, but it's hard to ever go back once you've mastered the basics.
If you haven't learned to touch type (it happens, I didn't learn until I was 22), then first learn that, then learn vim.
FYI: Remap your capslock key to escape to use Vim more effectively.
- mxschumacher 6y agoI recently had a revelation: When typing longer shell commands it can be time-consuming to go back and make changes, turns out you can use Vim style cursor movements within the Fish: https://stackoverflow.com/questions/28444740/how-to-use-vi-mode-in-fish-shell https://stackoverflow.com/questions/28444740/how-to-use-vi-m...
- slim 6y agoyou can do that in bash too, and any cli that uses readline library
- chrisweekly 6y agoalso zsh (tho it doesn't use readline per se)
- kadonoishi 6y agoset -o vi Starts you in insert mode. To go back to the usual command-line editing, set -o emacs
- HouseOfStairs 6y agoThis was a revelation for me as well. I also didn't realize that if you haven't configured vi keybindings, the default is Emacs (in bash or anything using readline). Even though Vim's my main editor, I found modal editing a bit too heavyweight on the commandline, so I prefer the default Emacs (most useful by far: C-b to go back one word and C-k to delete everything right of cursor).
- vivekkalyan 6y agoI prefer the emacs bindings for the command line such as C-A, C-U (mostly due to muscle memory), but have set up my $EDITOR as vim. This allows me to do C-X C-E, which opens the current command in vim to be edited. If you are using zsh, you need to add this to ur .zshrc autoload -z edit-command-line zle -N edit-command-line bindkey "^X^E" edit-command-line
- 7kay 6y agoOne other method to quickly exit insert mode if you can't remap keys is ^C. I did not know this even though I used gvim on Windows computers not under my control for years.
- alexjm 6y agoTrue and handy. However, Esc and ^C don't have exactly the same behavior -- from the documentation: <Esc> or CTRL-[ End insert or Replace mode, go back to Normal mode. Finish abbreviation. CTRL-C Quit insert mode, go back to Normal mode. Do not check for abbreviations. Does not trigger the InsertLeave autocommand event.
- tasuki 6y ago> FYI: Remap your capslock key to escape to use Vim more effectively. That's more one way of doing things rather than a "FYI". Eg I switched capslock with ctrl. There are many ways to exit insert mode, I prefer: inoremap jk <esc> inoremap kj <esc>
- boomerhackr 6y agoI use that mapping all of the time, it is also helpful to use inoremap <esc> <nop> as this helps you train your fingers to stop using <esc>
- nickbauman 6y agoYou don't need to know how to touchtype. Programmers are not a glorified typing pool. Furthermore, my father† has worked every job there is in a world class news organization since entering adulthood and never learned to touchtype. He could type 140 WPM.
- caseymarquis 6y agoLearning to touch type took roughly 10 hours over 2 weeks, and it made my life immeasurably better. Your (dad's?) mileage may vary.
- nickbauman 6y agoWhat exactly improved?
- caseymarquis 6y agoImagine having to look at your mouse every time you clicked on something. Now imagine you no longer have to do that. If you're really curious, just learn to touch type and find out. It doesn't take all that long if you're already a solid typist. I'd be fascinated to read an article from someone who learned how to touch type and thought it was a waste of time.
- nickbauman 6y agoOK so terminology: touchtype to me means that you learn the fingering the keyboard in a specific way. Not just that you can type by not looking at the keyboard. I can do that. I just never bothered with the "correct fingering".
- benhurmarcel 6y agoFor me it improved my physical comfort significantly. In particular it solved my back pain because I didn't spend so much time with my head looking down.