Vim, css clean key map convert to function -
i got map formating css 1 liner.
map <silent> <leader>cssclean :%s@\v/\*([^*]\|[\r\n]\|(\*+([^*/]\|[\r\n])))*\*+/@@g<bar>:call csspretty()<bar> :%le<bar>:%s/{\_.\{-}}/\=substitute(submatch(0), '\n', '', 'g')/<bar>:nohl<cr>gdd this map requires csspretty.
now want call :call cssclean() . tried putting 1 reading this vim tip, didn't work.
what code of function?
function cssclean() %s@\v/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/@@g call csspretty() %le %s/{\_.\{-}}/\=substitute(submatch(0), '\n', '', 'g')/ nohl normal! gdd endfunction should work fine.
Comments
Post a Comment