Tuesday, March 2, 2010

Re: mass delete words based on spell

corykendall wrote:
> I'm new here, but I tend to use macro based solutions. Is there a
> problem with that?
>
> For this I would use:
> qa]sddkq1000@a

[please don't top-post]

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).

-tim

--
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

No comments:

Post a Comment