6 ms·
I've been using vim for 20 years and never knew about this. It's a life changer! (I should have looked it up ages ago...)
by tasn 4y ago
I've been using vim for 20 years and never knew about this. It's a life changer! (I should have looked it up ages ago...)
- bspammer 4y agoYou may also want to know about zt and zb, which move the current line to the top and bottom of the screen respectively.
- tasn 4y agoYeah, saw them in the post!
- nurettin 4y agoThere are a lot of us dinos out there who haven't even used hjkl to navigate. All I do is yy, dd, p, ctrl-v to rectangle select, shift-v to line select, g or G to navigate c and the occasional s/^/#
- WastingMyTime89 4y agoAnd it's a perfectly fine way to use vi or vim as a basic editor present on every POSIX system. Yet, as a long time user, I regret that beginners are often presented with a list of commandes to memorize and are never introduced to what makes vim actually nice: composing scopes and actions. I have the same issue with the s command. Most people treat the parameters as something slightly magical to be googled when needed. Meanwhile, reading the ed manual was eyes-opening for me. It really helped me understand both where vim comes from and what sed does.
- michaelteter 4y ago> hjkl These movement keys are at least 40% the reason I love and use vim or vim plugins. Not having to move my hand, and being able to “drive” with only one hand are immensely beneficial. With cursor keys, it feels like half of my editing time is spent finding the arrow keys and then finding the home typing position. Emacs ctrl n/p/f/b are better than cursor keys often, but they require two hands.
- R0flcopt3r 4y agoC-f, C-e, C-b, C-a only require one hand. But I see your point. The best part of evil-mode in Emacs is that I get to use Emacs bindings in insert mode, and then vim keys in normal mode. For instance when writing function signatures, I can hit C-f to easily jump over the closing parenthesis, or C-e to easily jump to the end of line, usually also to skip the closing parenthesis. I'm not sure how you would do that in vim without exiting back into normal mode and using for instance S-a to append at the end of the line.
- julesnp 4y agoYou can use this plugin to get the same mappings in insert mode for Vim: https://github.com/tpope/vim-rsi https://github.com/tpope/vim-rsi
- nudome_lata 4y agoI'm a long-term emacs user who recently learned vim for fun. Deciding when to exit insert mode has been part of the learning curve. From insert mode, vim lets you run one command without explicitly switching back to normal mode. :he i_ctrl-o for details. It's very handy for positioning the cursor for more input, for example ctrl-o f) Also works in evil.
- aidenn0 4y agoAnd other dinos who use "hjkl" because they are significantly faster than arrow keys over a 120cps terminal...