Posted By

lukaszkorecki on 08/16/09


javascript php script settings vim

Versions (?)

vim make set

 / Published in: Bash

Example on how to automatically set :make function depending on the type of the loaded file

  1. " can be made smarter (wrapped in one function + array of commands etc)
  2. " but it's just a example :-)
  3. " link make with php"
  4. function! Set_Php_Make()
  5. set errorformat=%m\ in\ %f\ on\ line\ %l"
  6. set makeprg=php\ -l\ %
  7. endfunction
  8. autocmd FileType php call Set_Php_Make()
  10. " link jslint to javascript
  11. function! Set_Js_Make()
  12. set makeprg="~/bin/jsl\ --conf\ ~/bin/jsl.default.conf\ --process\ %"
  13. endfunction
  14. autocmd FileType javascript call Set_Js_Make()

Report this snippet  

You need to login to post a comment.