If it is purely mechanical type changes I would just use sed or find and replace, otherwise I think scrolling with a mouse and clicking tends to be fast enough. Could you explain a bit more about how it could be faster?
If it is purely mechanical type changes I would just use sed or find and replace, otherwise I think scrolling with a mouse and clicking tends to be fast enough. Could you explain a bit more about how it could be faster?
Probably best to see it in action to fully appreciate it.
But it really is a lot of faster. I've watched colleagues edit code with the mouse (e.g. move this "if" block under that "else" clause or what have you) and I will say it's much, much slower than I would do in vi. They are not incompetent or clumsy; I would have been slow with the mouse too. In fact, I'm editing this comment with a keyboard and trackpad and it feels awkward and slow.
Here are a few ways in which these actions just happens faster vi:
1. jumping around in the file using your keyboard. Taking your hand off the keyboard, moving the mouse to the right spot, clicking there, putting your hands on the keyboard, and then typing is a lot of movement. In vi, you have lots of tools to just move around, i.e. to do the part you do with the mouse. You have incremental search, bookmarks, jumplists, keys for jumping to the delimiter match, or the next code block, or jumping to a line number or function definition. There are EasyMotion-style plugins that let you jump quickly to whatever you're looking at on the screen. And many more. These are all optimized to be just a couple keystrokes away. They take time to learn and become fluid with but they give you a kind of total, effortless control over what part of the file you are editing.
2. Just good keyboard-centric editing basics. Putting aside all the ways you can move around a file (or files!) and all the ways you can repeat similar actions in different parts of the file, you also just get to be quicker making specific edits. You can _probably_ do all of this with readline-style keyboard shortcuts in other editors (e.g. replace this word with another word without double-cliking it with a mouse), but vi forms a sort of interactive language for doing these edits, and the way vi works just causes you to learn them and use them consistently.
3. Fine-grained control of editing actions. This is the hardest one to explain. Modal editing has the property that your actions are sort of transactions. You are in normal mode, you take some action that puts you in edit mode, you do some typing, and then you leave edit mode and the thing you did is now a block of action. It can be undone as a block and applied again elsewhere as a block. So for example, if I want to replace "}," with ");" on like four lines, I can do that by doing it once and applying it three more times to each line (using "."). Sure, you could also do that with a find-and-replace tool, but just operating that menu isn't worth the overhead for four lines. In vi, that's just how you edit; it's by-the-by, with no special effort required.
4. For more complex repeatable actions, you have macros (which is sort of like a second-level of text editing transaction), vi's strong regex support, actions that work on rectangular selections, and plugins for multiple cursors. One way to think about the sed case is: what if you didn't have to reach for another tool and it was instead sort of conceptually integrated into your everyday editing experience? It would be much lower friction to reach for, so you'd use it more and more efficiently.
There's more, but I think that's the important ones, or at least the ones I think have given me the most mileage. It's all easier to show than tell, and of course YMMV.