4 ms·
I'm not sure exactly what your plugin does, but are you aware of the "c" flag to substitute, eg :%s/debug/dbg/c vim will show the text which is about to be mo
by tasty_freeze 6y ago
I'm not sure exactly what your plugin does, but are you aware of the "c" flag to substitute, eg
:%s/debug/dbg/c
vim will show the text which is about to be modified, and you have a prompt to confirm, skip, or quit (and some others).
- nightcracker 6y agoYes, I am aware, but it's not nearly as flexible and quick. It doesn't allow me to in the meantime move my cursor around, switch buffers, undo, open/close a fold, etc. It takes complete control of your workflow to temporarily put you in some special 'search/replace mode' in a very non-Vimlike manner. My plugin has a simple operation (if cursor is on a match, replace, regardless jump to next match) that gets repeated with ., combined with nN and u and you have complete control while also rapidly doing search/replace. And you would still need some nice mappings to substitute the word/selection underneath the cursor with :%s///gc.
- chrismorgan 6y agoIf using the [c] flag and you want to interrupt it, a convenient way of continuing where you left off (and not touching previous lines, which may have new matches, depending on the nature of the replacement) may be :.,$&&<Enter>, which means “operating on the range current line (.) to end of file ($), execute the last substitution (&) with the same flags as last time (&)”. (This is very unlikely to interest you, but I mention it for the sake of others. I’ve commonly seen people not really know about ranges especially, never stopping and thinking about what the % means (see `:help :%` if you don’t know), beyond possibly having encountered '<,'> by accident when pressing : in Visual mode (for explanation of these, see the help for :', '< and '>).)