Sort the properties of each rule in a CSS file using VimEdit
:g/{/ .+1,/}/-1 sort
Explanation:
:g/{/
: for all lines matching the pattern{
.+1
: start at the next line (.
is the line),
: and continue until/}/
: the next line matching the pattern}
-1
: but, specifically, the line before thatsort
: sort everything in that range
Alternatively, make a macro to do this wherever the cursor is:
?{<CR>kV/}<CR>k:sort<CR>