[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] End-of-line whitespace.
From: |
Ralph Corderoy |
Subject: |
Re: [Groff] End-of-line whitespace. |
Date: |
Sun, 09 May 2010 01:09:53 +0100 |
Hi Ted,
> Using the 'vim' editor, I can easily strip trailing spaces from a file
> I am editing with the command
>
> :1,$s/ [ ]*$//
I'm not sure why the second space is a character class, but I do the
same thing with
:%s/ *$
`%' is a shorthand for `1,$'. And since I want to delete the matched
text, there's no need to specify a replacement. I could match / *$ but
it seems more logical to insist on an least one space being present, as
you do.
> (which I could have done with that posting to the list, if I had been
> alert to the possible presence of trailing spaces).
If you've syntax highlighting turned on in vim then you can specify that
end of line spaces are an `error' and they'd be highlighted, e.g. with a
red background. See `:he nroff.vim' for something similar, although I
don't agree with its advice to only have one space after end of sentance
punctuation.
Cheers,
Ralph.