Created
December 18, 2012 08:56
-
-
Save sideshowcoder/4326296 to your computer and use it in GitHub Desktop.
Run JSHint via <leader>h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Run JSHint if there is a jshint.json present in the project | |
autocmd FileType javascript map <leader>h :call RunJSHint()<cr> | |
function! RunJSHint(...) | |
let to_hint_file = match(expand("%"), '\(.js\)$') != -1 | |
let options_file = "jshint.json" | |
if filereadable(options_file) && to_hint_file | |
echo to_hint_file | |
:w | |
:silent !echo;echo;echo;echo;echo;echo;echo;echo;echo;echo | |
:silent !echo;echo;echo;echo;echo;echo;echo;echo;echo;echo | |
:silent !echo;echo;echo;echo;echo;echo;echo;echo;echo;echo | |
:silent !echo;echo;echo;echo;echo;echo;echo;echo;echo;echo | |
:silent !echo;echo;echo;echo;echo;echo;echo;echo;echo;echo | |
:silent !echo;echo;echo;echo;echo;echo;echo;echo;echo;echo | |
exec ":!jshint --config " . options_file . " " . @% | |
end | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment