# fix trailing spaces
command! FixTrailingSpaces :exe 'normal! m`'<bar>
\ :keepj silent! :%s/\r\+$//g<bar>
\ :keepj silent! :%s/\v(\s+$)//g<bar>
\ :exe 'normal! ``'<bar>
\ :echom 'Remove trailing spaces and ^Ms.'
image.png (view on web)
@dkearns fyi
'v' shouldn't be highlighted as error.
9.1.1591
debian12,bash
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
As a workaround until it's fixed, a block can be used rather than line continuations. It's arguably the better approach anyway.
# fix trailing spaces command! FixTrailingSpaces { :exe 'normal! m`'<bar> :keepj silent! :%s/\r\+$//g<bar> :keepj silent! :%s/\v(\s+$)//g<bar> :exe 'normal! ``'<bar> :echom 'Remove trailing spaces and ^Ms.' }
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Yeah, thx! It is just quite old command I have, will change it to the block.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
FWIW | rather than <bar> works in :command too and should be highlighted correctly. "Two out of three ain't bad", as someone once sang.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
<bar> will need to be treated as a command prefix group in :command replacement strings when ex-commands are properly contained there.
It's not needed but as it's supported there's about 100 files using it on GitHub.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()