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

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -