RE: Removing trailing spaces
- hmm.. i use the following:
" TODO: have this respect sigdashes and only do its work if not in insert
au BufWritePre * silent! call StripTrailingSpaces()
where 'Mark()' is simply what i use to save and restore the cursor position
without corrupting any of my actual marks. (it's a function by Benji Fisher
-- you could just do a normal ma and a normal `a at the end instead.)
basically, this will strip all trailing spaces from the current document
every time you save the file.
From: Ali Akcaagac [mailto:ali.akcaagac@...-wilhelmshaven.de]
Sent: Tuesday, January 29, 2002 2:29 PM
To: Vim Developer
Subject: Re: Removing trailing spaces
On Tue, 2002-01-29 at 20:20, Tomas Ogren wrote:
> > I while back, I believe someone posted a script or something that would
> > remove trailing spaces from a line.
> :s/ *$//
<TAB> = press tab button... removes either trailing spaces and tabs
from all lines :)
removes leading spaces e.g. if you have a sourcecode that has all lines
starting with 1-x spaces. then you can recall this as often to move the
lines back to 1st char.
Name....: Ali Akcaagac
Status..: Student Of Computer & Economic Science