Javascript filetype settings
git-svn-id: http://photonzero.com/dotfiles/trunk@41 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
parent
889f9af6de
commit
25cb6c69d0
4 changed files with 346 additions and 15 deletions
|
|
@ -1,16 +1,9 @@
|
|||
" Vim syntax file
|
||||
" Language: JavaScript
|
||||
" Maintainer: Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com>
|
||||
" Last Change: May 17, 2007
|
||||
" Version: 0.7.5
|
||||
" Changes: 1, Get the vimdiff problem fixed finally.
|
||||
" Matthew Gallant reported the problem and test the fix. ;)
|
||||
" 2, Follow the suggestioin from Ingo Karkat.
|
||||
" The 'foldtext' and 'foldlevel' settings should only be
|
||||
" changed if the file being edited is pure JavaScript,
|
||||
" not if JavaScript syntax is embedded inside other syntaxes.
|
||||
" 3, Remove function FT_JavaScriptDoc().
|
||||
" Since VIM do the better than me.
|
||||
" Last Change: June 4, 2009
|
||||
" Version: 0.7.7
|
||||
" Changes: Add "undefined" as a type keyword
|
||||
"
|
||||
" TODO:
|
||||
" - Add the HTML syntax inside the JSDoc
|
||||
|
|
@ -34,7 +27,6 @@ endif
|
|||
setlocal iskeyword+=$
|
||||
|
||||
syntax sync fromstart
|
||||
syntax sync maxlines=200
|
||||
|
||||
"" JavaScript comments
|
||||
syntax keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
|
||||
|
|
@ -66,7 +58,7 @@ syntax case match
|
|||
syntax match javaScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
|
||||
syntax region javaScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc
|
||||
syntax region javaScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc
|
||||
syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{-,3}+ contains=javaScriptSpecial,@htmlPreproc oneline
|
||||
syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline
|
||||
syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
|
||||
syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||
syntax match javaScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
|
||||
|
|
@ -76,7 +68,7 @@ syntax keyword javaScriptPrototype prototype
|
|||
|
||||
"" Programm Keywords
|
||||
syntax keyword javaScriptSource import export
|
||||
syntax keyword javaScriptType const this var void yield
|
||||
syntax keyword javaScriptType const this undefined var void yield
|
||||
syntax keyword javaScriptOperator delete new in instanceof let typeof
|
||||
syntax keyword javaScriptBoolean true false
|
||||
syntax keyword javaScriptNull null
|
||||
|
|
@ -155,7 +147,9 @@ syntax match javaScriptParensErrB contained ")"
|
|||
syntax match javaScriptParensErrC contained "}"
|
||||
|
||||
if main_syntax == "javascript"
|
||||
syntax sync ccomment javaScriptComment
|
||||
syntax sync clear
|
||||
syntax sync ccomment javaScriptComment minlines=200
|
||||
syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/
|
||||
endif
|
||||
|
||||
"" Fold control
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue