mirror of
https://github.com/jelera/vim-javascript-syntax.git
synced 2025-12-08 21:54:52 +08:00
Recognizes the node shebang line and sets the filetype to javascript. Syntax highlights the shebang as well.
7 lines
171 B
VimL
7 lines
171 B
VimL
function! s:DetectJS()
|
|
if getline(1) =~# '^#!.*/bin/env\s\+node\>'
|
|
setfiletype javascript
|
|
endif
|
|
endfunction
|
|
autocmd BufNewFile,BufRead * call s:DetectJS()
|