News for hackers. Stuff that matters.
Re:Moving Fast with the Core Vim Motions by scubbo on Wednesday June 14, 2023 @09:18PM (#36335212)
When claims like this are made, I'm skeptical people have retrained their minds such that "press this combination of keys repeatedly until the cursor is where you want it to be" is easier and more accurate than "mentally count the number of word boundaries your cursor is away from where you want it to be, then enter the command to get it there".

I don't disagree that vim's movement commands have greater precision, but I find it hard to believe that that precision is actually useful in practice.

EDIT: Oh, my bad, you specifically called out that efficiency is not the actual goal. In which case - yes, for "feeling like a badass", I am wholly on-board :)

Re:Moving Fast with the Core Vim Motions by xwdv on Wednesday June 14, 2023 @09:53PM (#36335467)
People who never master vim will never know the high of pounding combo after combo and watching lines of code morph and manifest before their eyes at the speed of thought. Once you’ve experienced this, no other editor will satisfy you. Combine this with the sounds of a clicky keyboard, and it feels like heaven.
Re:Moving Fast with the Core Vim Motions by baq on Thursday June 15, 2023 @02:34AM (#36337122)
This is absolutely true but I myself converted to vscode after getting fed up with having to maintain my vimrc… I miss the combos and no, vim key bindings are nowhere near the same, there are conflicts and missing verbs and motions.

Haven’t tried embedded neovim yet. Is it the best or the worst of both worlds?

Re:Moving Fast with the Core Vim Motions by bongobingo1 on Thursday June 15, 2023 @05:57AM (#36338322)
It's reasonable. You have "true nvim" managing the buffer. Most plugins will work and it sets a `g:vscode` or whatever variable so you can conditionally enable bits of your config.

Its better than any vim emulation mode that's for sure.

Re:Moving Fast with the Core Vim Motions by scubbo on Friday June 16, 2023 @05:10PM (#36363937)
I've used my fair share of macros to transform text. Vim's great for that. But that's less than 1% of my work as a developer. Much more often, I'm wanting an IDE to do things like:

* Run/debug code

* Jump to a declaration of a function/variables, or find it's uses

* Extract some code as a function

* Rename a variable (and all uses of it)

I bet vim probably _could_ do all of that with the right plugins - but dedicated IDEs do it out-of-the-box. Even something as simple as indent/dedent a block of code is "click-and-drag, tab/shift-tab" in an IDE, vs. ":<range declaration>s/^[^$]/ /" in vim.

Re:Moving Fast with the Core Vim Motions by bottlero_cket on Saturday June 17, 2023 @07:26AM (#36369253)
Indent? Use a code formatter or just select the lines with visual mode and press >
Re:Moving Fast with the Core Vim Motions by scubbo on Tuesday June 20, 2023 @10:43PM (#36413747)
> just select the lines with visual mode and press >

TIL, thank you! Unfortunately it seems to think that a

Re:Moving Fast with the Core Vim Motions by sofal on Wednesday June 14, 2023 @09:56PM (#36335496)
I don't think anyone actually does counting like that, or at least if they did I agree it would be silly. If I have my eye on a character I'd like to get to, I usually just 'f' + character and then ';' if necessary until I'm in the right place.

The only time I use numbers to specifically target a location is when jumping to a line. I have relative line numbers turned on (line numbers are relative to the cursor) so I always know the exact number I need to type to move to the line I'm looking at.

Re:Moving Fast with the Core Vim Motions by lizardking on Thursday June 15, 2023 @02:20AM (#36337057)
Mentally counting words to move your cursor to right spot isn't a great way to move horizontally. I would usually do something like "/someVariable" and hop my cursor to the exact spot I'm looking for. If it's further in the line, just hit "n". It's pretty fast. But if you just need to move one word over w and b are nice.

Even with vertical movement I never count lines. Relative line numbers make it so you don't have to. Counting is not part of my vim experience.

Re:Moving Fast with the Core Vim Motions by scubbo on Friday June 16, 2023 @05:06PM (#36363882)
Agreed, I do the same.

But in an IDE, that motion is "Cmd-F, <type>, Enter". Vim's not inherently superior there.

Re:Moving Fast with the Core Vim Motions by lizardking on Tuesday June 20, 2023 @06:44AM (#36402123)
My point wasn’t that the ability to search a file is unique to vim, but that counting words to use w or b isn’t really part of the work flow.
Re:Moving Fast with the Core Vim Motions by scubbo on Tuesday June 20, 2023 @10:42PM (#36413738)
OK, but then I'm not clear what part of the workflow is claimed to be unique to Vim, then.
Re:Moving Fast with the Core Vim Motions by lizardking on Thursday June 22, 2023 @12:26PM (#36434610)
I was explaining what the workflow in question is, not claiming that is was unique to Vim necessarily.
Re:Moving Fast with the Core Vim Motions by erfgh on Thursday June 15, 2023 @02:28AM (#36337091)
Numbers are mostly useful in macros and scripts.
Re:Moving Fast with the Core Vim Motions by svalorzen on Thursday June 15, 2023 @05:39AM (#36338225)
There is a Vim plugin called EasyMotion, which I absolutely love, which when invoked creates a simple 1 or 2-key "checkpoint" at the start of every word on your screen, and super imposes them on the text. Then it's only a matter of looking at the point where you wanted to move, and press the two keys written there, and there you are!

It's also fairly customizable in that you can specify which characters are actually allowed (so you don't end up with very weird keys to press), and some other stuff. So every time I need to move somewhere I can't be bothered to figure out the standard keys it would take me to get there, it saves me.