Hacker News new | past | comments | ask | show | jobs | submit login

No offence taken; there's always room to learn. Just curious, since I never use Vim, how exactly one navigates to (and/or selects) "aaa" part in the following string with just three keys in Vim?

    url = "https://example.com/keyword=aaa&name=john"



So many ways!

fa;

(f)find (a) (;)repeat

That would be the generic vim way. I could mash on semicolon to get to each instance of "a" in the line. Here's another.

2fa

2 (2nd instance) f (find) (a)

Most people use a plugin called easy motion instead.

You type some two character key command to start it. For me it's "ff".

After ff, i type any two characters. It will then highlight each place in the document that start with those two characters (think an inline table of contents) that I can then select.

https://github.com/easymotion/vim-easymotion

I write all this knowing it looks and sounds like madness, so again, don't take this as anything other than someone explaining their madness, but once you learn all this stuff (it takes about a month) you realize your mouse is actually the slowest way to do it.


if you are above, move there with three keys: t&b

select: t&vb

if you see below you'd do F&b, F&vb


I'd do `/aaa<enter>cw<replacement text>`




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: