I haven't seen this asked on stackoverflow, and this is my biggest pain point in vim:
How do you all navigate within a file? I found myself using the hjkl too much, or too repetitively, and I want to get better at this. This is frustrating when you're on a large monitor.
I installed EasyMotion - and so far it's been good for me - I just want to know if there's something better...
Thanks!
It depends on how you want to move around, but generally,
A
puts you in insert mode at the end of a lineI
at the beginningo
inserts a line below O
aboveand more powerfully, searching with /<thing you want to jump to>
is very handy. In a c file where the functions are formatted
int
funcname()
/^funcname
will jump you to the start of the function. There's a bunch more, but this shold be a good start for someone new to vim.
I like the cheatsheet of Ted Naleid. It's like a reticle so you can easily find the horizontal and vertical movements. Put it on a wall next to your monitor and you will soon pick up new movements on the fly.
The movements that I liked recently are:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With