Merge pull request #10 from sleepycat/master

Setting filetype to javascript based on node shebang
This commit is contained in:
Jose Elera Campana committed 2012-08-13 09:45:49 -07:00
commit 5f45ff925c
2 files changed
+10

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
function! s:DetectJS()
if getline(1) =~# '^#!.*/bin/env\s\+node\>'
setfiletype javascript
endif
endfunction
autocmd BufNewFile,BufRead * call s:DetectJS()
+4
View File
@@ -28,6 +28,10 @@ setlocal iskeyword+=$
syntax sync fromstart
"" syntax coloring for Node.js shebang line
syn match shebang "^#!.*/bin/env\s\+node\>"
hi link shebang Comment
"" JavaScript comments"{{{
syn keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
syn match javaScriptLineComment "\/\/.*" contains=@Spell,javaScriptCommentTodo