5
2
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?
There are about 30 trailing spaces at the end of your
:command!
line. – Excellll – 2012-10-12T15:37:30.140Bad copy & paste job. I promise you that in my .vimrc there isn't. And it pukes on the line above, not the line with the command in it. – Jesse Atkinson – 2012-10-12T15:52:53.430
I suspect that
<CR>
is not supposed to be there. – Michael Hampton – 2012-10-12T17:21:33.1332@JesseAtkinson, it is not easy to find line 196 in your two lines example. – romainl – 2012-10-12T18:31:01.403
Line 196 is the first line I posted. – Jesse Atkinson – 2012-10-18T14:51:38.623