VIM

Vim: How to AutoCompile Less & Coffee with SourceMaps

in .vimrc:

au BufWritePost *.less silent !lessc <afile> --source-map <afile>:r.css
au BufWritePost *.coffee silent make -m

Additional, run ruby:

map <leader>r :!ruby %<cr>

Note:

  • <afile> is the path/file.extension of current file
  • <afile>:r is the path/file of current file
  • substitute lessc for /usr/local/bin/lessc or others if you want to specify another lessc to use
  • the --source-map and -m options specify sourcemap
Standard