112409Re: mass delete words based on spell
- Mar 1, 2010I'm new here, but I tend to use macro based solutions. Is there a
problem with that?
For this I would use:
On Mar 1, 5:07 pm, Bee <200...@...> wrote:
> On Mar 1, 1:00 pm, Bee <200...@...> wrote:
> > On Mar 1, 12:47 pm, Tim Chase <v...@...> wrote:
> > > Christian Brabandt wrote:
> > > > this should have been
> > > > :%s/\w\+/\=printf("%s", !empty(spellbadword(submatch(0)))?submatch(0):'')/
> > > Lovely solution and introduction to spellbadword() (which I've
> > > not seen/used before). However, I'm curious why you chose to use
> > > printf("%s", ...) instead of just using the contents.
> > > So my reworking of Christian's idea:
> > > :%s/\w\+/\=empty(spellbadword(submatch(0))))?'':submatch(0)/g
> > > The other catch (at least in English) is that words like "can't"
> > > aren't found whole by "\w\+", so you might have to tweak the
> > > regexp or 'iskeyword' to include apostrophes.
> > Yes wonderful introduction to spellbadword()
> > I tried your solution and got errors, counted parens and found one too
> > many closing, and this works.
> > :%s/\w\+/\=empty(spellbadword(submatch(0)))?'':submatch(0)/g
> Thank you Tim and Christian
> Since I had one word per line, having grabbed the words from a book a
> friend is writing, sorted to keep only unique, this works great:
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 Next post in topic >>