| > If there are other words in the function that contain foo How would you know that??? So that's the first roundabout eliminated: - set word selection by default not to have to worry about substrings But otherwise you're describing a different workflow: while there is no semantic meaning in the "next 5 lines", you actually don't know whether that would be 5 of 7, that's the whole point/benefit of incrementalism, there is in "this function", so block operations are a valid contender and I could also select the function and search&replace within the selection instead of doing word-by-word. But then the original also works in a more direct way (maybe you actually don't want to replace all "foo" in a function, but skip some of them): So you would skip your two roundabouts: - go to the beginning of a function - go+select to the end of a function Then proceed with the "direct" way: - go to your desired word anywhere within the function - invoke select forward/backward commands until visually reaching the beginning/end of said function (the candidates will all be highlighted) |
> How would you know that???
Typically I'm working on code that I wrote, or I've been studying it enough that I've gotten to the point that I'm refactoring and editing it. It isn't like a gameshow where I have a blinder on and then the blinder is removed and I'm given a task to perform.
> - set word selection by default not to have to worry about substrings
So you have to do another step? I can pick word selection or not dynamically on a case by case basis without having to go somewhere else and turn word mode on or off. Or maybe I'm misunderstanding how your editor works. At any rate, I don't see how my approach is roundabout -- I directly express if I want complete word matching or not, and I can even mix both types in a single search/replace operation.
I don't understand your next point -- I can select the body of a function without knowing how many lines it has. It isn't clear to me what your approach is, "incrementalism". Are you doing a word search and replace one at a time? I thought we were discussing multi-cursor editing.
> Then proceed with the "direct" way: > - go to your desired word anywhere within the function > - invoke select forward/backward commands until visually reaching the beginning/end of said function (the candidates will all be highlighted)
What you've described is just another way of doing it, not fewer steps.