Why does VIM say there is trailing whitespace on this command?

Posted by Jesse Atkinson on Super User See other posts from Super User or by Jesse Atkinson
Published on 2012-10-12T15:35:28Z Indexed on 2012/10/12 15:39 UTC
Read the original article Hit count: 415

Filed under:
|
|
|

I am trying to write a beautify CSS command in vim that sorts and alphabetizes all of the CSS properties as well as checks to see if there is not a space after the colon and inserts one.

Here is my code:

nnoremap <leader>S :g#\({\n\)\@<=#.,/}/sort | %s/:\(\S\)/: \1/g<CR>
:command! SortCSSBraceContents :g#\({\n\)\@<=#.,/}/sort | %s/:\(\S\)/: \1/g                                                                  

These work independently. However, I am trying to pipe them into one command.

On save VIM says:

Error detected while processing /var/home/jesse-atkinson/.vimrc:
line  196:
E488: Trailing characters

Any ideas?

© Super User or respective owner

Related posts about command-line

Related posts about unix