112458Re: mass delete words based on spell
- Mar 2, 2010On Mar 2, 1:49 pm, Christian Brabandt <cbli...@...> wrote:
> Hi corykendall!
> Certainly not. Use whatever works best for you. I personally dislike
> macros, because usually I have problems decrypting them. Therefore I
> prefer ex commands and functions which I find more readable.
On Mar 2, 9:49 am, Tim Chase <v...@...> wrote:
> The problems I'd have with doing that are mostly "I have to think
> about things" issues:
> - do I have more than 1000 items and may need to re-execute the
> macro? (having 'ruler' showing the number of lines in the file
> might help)
> - does "]s" break the repeated macro execution if there isn't a
> bad-spell match, or does it continue to delete the remainder of
> the 1000 things after the last bad-spelling is found?
> - do I have something valuable in register "a" that I don't want
> to tromp with my macro; or the flip side of "what register do I
> have that's available"?
> - if there's a bad-spell word as the first line, does issuing "k"
> ("go up from line #1", possibly an error-ish condition) after
> deleting it trigger the macro-recording to stop?
> - can I issue this from anywhere in the file or do I have to do
> it from the top (and does my 'wrapscan' setting change its behavior)?
> That's a lot more thinking than I like to do ;-)
> The :g or :s versions can be used in a mapping and trusted to do
> what they should without any of the above issues (except perhaps
> tromping the search register).
Good responses both, thanks guys.
I think I agree that if you want as repeatable solution, an ex
expression is better because it's more readable, and rememberable.
But if I need a one-off solution, I find it easier to record a
macro... Fix the first occurance, navigate to the next occurance in a
repeatable way, and then execute as many times as necessary. I also
like that I can run a macro once... twice... three times... each time
making sure it worked correctly, and then launch it on the whole file.
Perhaps once I get more comfortable with regular expressions I'll
change my tune :)
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
- << Previous post in topic