logoalt Hacker News

swyxyesterday at 5:43 PM5 repliesview on HN

> single keystroke could move the cursor halfway across the file to exactly the right spot.

sorry what is this? exaggeration?


Replies

tuanyesterday at 6:00 PM

I can see how that could work depends on the setup and the context. For example: People might use `. to jump to the last edit, or to a mark they set manually. Or simply `ciq` to edit inside the next quote without any manual cursor movements. I see people use plugin like harpoon to jump to their favorite location quickly. If you don't know about such setup, seeing people type <leader>1 to jump not just within a file, but across files, seems magical.

show 1 reply
lelanthranyesterday at 6:25 PM

>> single keystroke could move the cursor halfway across the file to exactly the right spot.

> sorry what is this? exaggeration?

It is indeed. I need two keystrokes to move from an arbitrary positions in an arbitrarily long file to the exact spot I need to be.

I use it all the time, in fact. Multiple times an hour. It's muscle memory now for me, while reading/navigating code, to automatically do `ma` or `mb` etc.

At some later point I realise "let me read the function definition again" and then I do `'a` or `'b`, etc.

show 1 reply
slimyesterday at 8:31 PM

This can happen if you hit * when cursor is on say a function name. it gets you to the next occurance of that word. very useful

astrobe_yesterday at 5:52 PM

Nope! "G" moves the cursor to the end of the file. Very useful. Inferior editors have ctrl-end or alt-end, but with Vim, 90% of your lazy fingers stay on the home row!

show 3 replies
GrowingSidewaysyesterday at 5:56 PM

Yes, it's exaggeration. Modal editing cannot read your mind.