Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> For example, jumping to a specific position in a source code file, scrolling and clicking gets me there much quicker than navigating with the keyboard alone

I say this with the intention of providing context, not to say the way you do things is bad. It's all user preference in the end and there is no wrong way.

Lots of folks consider your "fast" example with a mouse as their "slow" example that forced them into learning more advanced features of their editor. For example. Most Vim users can get to any character or partial string, or parameter, or line, or paragraph, or function start or what you have within three quick keys on their home row. They do this quickly, and can immediately start doing other things right after because their hands never moved.

The mouse is fast because people don't need to memorize things. The keyboard is fast because the keyboard is fast.

It's like the old joke from the movie Heist. "What do you mean you don't like money? That's why they call it money".



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>`




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

Search: