Tugqi Biz
  • Home
  • Categories
  • Tags
  • Archives

让Vim自动编译lessc > css

将下列代码放到.vimrc即可¶

" 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

  • « Ubuntu 上配置oh-my-zsh

Published

May 12, 2015

Category

IT

Tags

  • Vim 1
  • Powered by Pelican. Theme: Elegant by Talha Mansoor