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

I use the mouse a lot, even for (typing) coding.

I'm pretty "fluent" with navigation shortcuts, things like Ctrl/Alt/Shift combined with arrow keys, PgUp/PgDn/Home/End etc. and I do use them extensively. And yeah, constantly switching between the keyboard and mouse with my right hand is a bit annoying.

But still, in many cases, using the mouse is just faster. 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.

(This is also one thing I really hate about using terminals: you can't just click to move the cursor quickly! Editing part of a long string without spaces is a pain in the ass, and it's something I have to do surprisingly often.)

When it comes to shortcuts, I prefer one- or two-key combinations whenever possible. Three-key shortcuts, however, depend on their layout: many just aren’t that convenient. Sometimes I’ll just click through the menu manually, even if I know the shortcut.



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


> I really hate about using terminals: you can't just click to move the cursor quickly!

alt-click?


Doesn't seem to work for any emulators I have (cmd, Windows Terminal, Git Bash, etc.) :(


Use a different terminal and/or editor. Mouse support is absolutely a common feature and has been for a while. xterm, konsole, tmux, emacs, GNU screen, etc., etc. all let you do a variety of things with the mouse.

For instance I use helix and can move the cursor with the mouse just fine in WezTerm, iTerm, and Apple's Terminal.app. tmux has a mouse mode where you can select and scroll with the mouse.




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

Search: