mirror of
https://github.com/jelera/vim-javascript-syntax.git
synced 2026-11-01 01:56:20 +08:00
Set filetype based on node shebang
Recognizes the node shebang line and sets the filetype to javascript. Syntax highlights the shebang as well.
This commit is contained in:
1 parent
2648939cbf
commit
405df92c21
2 files changed
+10
No files matched your search
@@ -0,0 +1,6 @@
|
||||
function! s:DetectJS()
|
||||
if getline(1) =~# '^#!.*/bin/env\s\+node\>'
|
||||
setfiletype javascript
|
||||
endif
|
||||
endfunction
|
||||
autocmd BufNewFile,BufRead * call s:DetectJS()
|
||||
Reference in new issue
Block a user