Skip to content

Instantly share code, notes, and snippets.

@Anderson-Juhasc
Created December 5, 2011 11:06
Show Gist options
  • Save Anderson-Juhasc/1433241 to your computer and use it in GitHub Desktop.
Save Anderson-Juhasc/1433241 to your computer and use it in GitHub Desktop.
Auto compile lesscss with VIM
" Less compile
autocmd FileWritePost,BufWritePost *.less :call LessCSSCompress()
function! LessCSSCompress()
let cwd = expand('<afile>:p:h')
let name = expand('<afile>:t:r')
if (executable('lessc'))
cal system('lessc '.cwd.'/'.name.'.less > '.cwd.'/'.name.'.css &')
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment