DEV Community 👩‍💻👨‍💻

Discussion on: You're using Vim Wrong - Relative Line Numbers

Collapse
 
vonheikemen profile image
Heiker • Edited on

I don't use line numbers anymore. To move around in the same screen I use sneak.vim in "label-mode".

sneak demo

In here I press s and then look for the ar and move to the one I want.

Collapse
 
mainendra profile image
Mainendra

If you are using neovim and coc, I would suggest github.com/neoclide/coc-smartf

Collapse
 
ug02fast profile image
Arthur Zhuk

This has its advantages. I'm using coc outside of work environment.

Collapse
 
ug02fast profile image
Arthur Zhuk

This looks good. Have you noticed if you're making fewer keystrokes overall to get your cursor where you want to be more consistently? Strong discipline using sneak could be better than relative line number jumping. I need to try it for a week at least and see how it plays out.

Collapse
 
vonheikemen profile image
Heiker • Edited on

Yes, when I use it really does save keystrokes. I find it particularly useful when I randomly notice a typo but it is really far away from where my cursor is, what I do is press s, search the term (that's just two keys), fix the typo, then I press ctrl + o to move back where I was, and I just keep working. Everything happens fast and I don't lose my train of thought.

I do sometimes find myself "playing snake" to move around... but that's just because it's very hard to "unlearn" that habit.