News for hackers. Stuff that matters.
Re:What Is Vim? by stevebmark on Saturday December 14, 2024 @10:00PM (#42421159)
Agree that Vim is a language to talk to your computer, but it's not necessarily efficient. Vim is famously an imperative editor: You have to tell Vim the sequence of steps to perform. Clicking your mouse on a position on the screen is declarative: You declare you want the cursor here. With Vim you have to imperatively walk the cursor to where you want to go, or god forbid use something like easymotion.
Re:What Is Vim? by tolciho on Sunday December 15, 2024 @12:05AM (#42421611)
It is imperative in certain editors that you fumble for the mouse whilst in vi one can simply declare 3ff to get to the third f on the line. Granted, I mostly do not use certain editors, and accidentally compiled mouse click support out of the terminal—brushing the trackpad risked spamming programs with mouse noise, and some programs would sometimes do silly things with it. The mouse is fine for focusing terminals, I guess. (No, not vim, vi.)
Re:What Is Vim? by rwiggins on Saturday December 14, 2024 @10:24PM (#42421240)
Setting aside that you can enable mouse mode in vim and use the mouse to your heart's desire --

and setting aside the "declarative" vs "imperative" nomenclature debate --

vim is pretty dang efficient. Typing `gg` to go to the beginning of a file, or `G` to go the end. Or all the other variety of motions. There are a lot.

Also, there is not necessarily any need to move the cursor anywhere. For example, if I'm in the middle of writing some string and I've decided to change the whole thing, `<ESC>ci"` does that, with no cursor movement required.

Re:What Is Vim? by eloisius on Saturday December 14, 2024 @10:15PM (#42421214)
You can, in fact, click to set the cursor position and even click and drag to select.
Re:What Is Vim? by dylan604 on Saturday December 14, 2024 @10:03PM (#42421174)
That's like telling some small child they are lesser because they can't walk because they're still learning to crawl. The systems that vim worked on didn't even know what a mouse was.
Re:What Is Vim? by cassepipe on Sunday December 15, 2024 @06:11AM (#42422835)
set incsearch

Now use / (+ n or N) + Enter to move around

Done

Re:What Is Vim? by brewmarche on Sunday December 15, 2024 @01:16PM (#42424944)
Incremental search in vim is great, you can also cycle through results with CTRL-G/T while typing.

This even works as a motion (e.g. d / foo, then ctrl G until you hit the right foo, then enter to delete until there).

Re:What Is Vim? by cassepipe on Wednesday December 18, 2024 @05:05AM (#42449324)
That is great! Thanks
Re:What Is Vim? by Lio on Sunday December 15, 2024 @06:18AM (#42422854)
> With Vim you have to imperatively walk the cursor to where you want to go, or god forbid use something like easymotion.

If you prefer to use a mouse you can do that in Vim too.

It even works over SSH.

Re:What Is Vim? by n144q on Sunday December 15, 2024 @10:49AM (#42424042)
> With Vim you have to imperatively walk the cursor to where you want to go

I used to use vscode with mouse. Then vscode + vim with mouse. Then I forced myself to actually learn how to "properly" use vim, including all the motions plus enabling smart line numbers.

As a result, my right hand switches between keyboard and mouse much less than they used to, and I can do development work with my hands stay on the keyboard for minutes or longer. It made me more efficient, and RSI was much less of a problem.