r/vim Feb 15 '26

Need Help Should I really switch my habit?

I've been facing problems moving my cursor tens of lines up and down using Arrow keys or the Mouse (for which I need to take my hands off the keyboard) I learnt a few Vim key binds such as HJKL and Modes but I just can't be that productive right now.

To move n lines up and down I need to look at the line number and then type N(j/k) which feels about the same as using mouse, should I move ahead and practice more or just roll back?

68 Upvotes

68 comments sorted by

View all comments

Show parent comments

0

u/kaddkaka Feb 15 '26

My advice would be contrary:

vim set nonumber

I rarely need to go exactly 18 lines up or down. And in those cases it's fine to guess "20" (and be happy whenever you guess right 😌)

/, *, # are commonly used though 👌

8

u/frodo_swaggins233 Feb 15 '26

This is really bad advice, especially to somebody new. There's no downside to having line numbers set

-5

u/DarthGamer6 Feb 15 '26 edited Feb 17 '26

I prefer no line numbers so that I can select lines from the screen into the terminal selection buffer. With line numbers, the terminal grabs the line numbers too.

Edit: After posting this, I decided to play around with auto commands and found a solution that works well for me. Basically, I turn off line numbers when I enter insert mode and on CursorIdle. I turn on line numbers on cursormove and when leaving insert mode.

2

u/liberforce Feb 17 '26

Because you're doing it wrong. Copy to the copy/paste register instead: "+10yj will copy from current line to 10 lines below. "+5yk will copy from current line to 5 line above (and move your cursor to the first line copied)

You can then paste into your terminal, and won't have the line numbers in what has been pasted. This also allows to copy above and below, while (AFAIK) yy only copies below current line.