summaryrefslogtreecommitdiffstats
path: root/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'syntax')
-rw-r--r--syntax/eelixir.vim66
-rw-r--r--syntax/elixir.vim3
-rw-r--r--syntax/go.vim8
-rw-r--r--syntax/php.vim6
-rw-r--r--syntax/rust.vim29
5 files changed, 83 insertions, 29 deletions
diff --git a/syntax/eelixir.vim b/syntax/eelixir.vim
new file mode 100644
index 00000000..f3ea65d4
--- /dev/null
+++ b/syntax/eelixir.vim
@@ -0,0 +1,66 @@
+" Vim syntax file
+" Language: Embedded Elixir
+" URL: https://github.com/elixir-lang/vim-elixir
+
+if exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'eelixir'
+endif
+
+if !exists("g:eelixir_default_subtype")
+ let g:eelixir_default_subtype = "html"
+endif
+
+if !exists("b:eelixir_subtype")
+ let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
+ let b:eelixir_subtype = matchstr(s:lines,'eelixir_subtype=\zs\w\+')
+ if b:eelixir_subtype == ''
+ let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
+ endif
+ if b:eelixir_subtype == ''
+ let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.eelixir\)\+$','',''),'\.\zs\w\+$')
+ endif
+ if b:eelixir_subtype == 'ex'
+ let b:eelixir_subtype = 'elixir'
+ elseif b:eelixir_subtype == 'exs'
+ let b:eelixir_subtype = 'elixir'
+ elseif b:eelixir_subtype == 'yml'
+ let b:eelixir_subtype = 'yaml'
+ elseif b:eelixir_subtype == 'js'
+ let b:eelixir_subtype = 'javascript'
+ elseif b:eelixir_subtype == 'txt'
+ " Conventional; not a real file type
+ let b:eelixir_subtype = 'text'
+ elseif b:eelixir_subtype == ''
+ let b:eelixir_subtype = g:eelixir_default_subtype
+ endif
+endif
+
+if exists("b:eelixir_subtype") && b:eelixir_subtype != ''
+ exe "runtime! syntax/".b:eelixir_subtype.".vim"
+ unlet! b:current_syntax
+endif
+
+syn include @elixirTop syntax/elixir.vim
+
+syn cluster eelixirRegions contains=eelixirBlock,eelixirExpression,eelixirComment
+
+exe 'syn region eelixirExpression matchgroup=eelixirDelimiter start="<%" end="%\@<!%>" contains=@elixirTop containedin=ALLBUT,@eelixirRegions keepend'
+exe 'syn region eelixirExpression matchgroup=eelixirDelimiter start="<%=" end="%\@<!%>" contains=@elixirTop containedin=ALLBUT,@eelixirRegions keepend'
+exe 'syn region eelixirQuote matchgroup=eelixirDelimiter start="<%%" end="%\@<!%>" contains=@elixirTop containedin=ALLBUT,@eelixirRegions keepend'
+exe 'syn region eelixirComment matchgroup=eelixirDelimiter start="<%#" end="%\@<!%>" contains=elixirTodo,@Spell containedin=ALLBUT,@eelixirRegions keepend'
+
+" Define the default highlighting.
+
+hi def link eelixirDelimiter PreProc
+hi def link eelixirComment Comment
+
+let b:current_syntax = 'eelixir'
+
+if main_syntax == 'eelixir'
+ unlet main_syntax
+endif
+
diff --git a/syntax/elixir.vim b/syntax/elixir.vim
index 8f94ff5e..a0c8f289 100644
--- a/syntax/elixir.vim
+++ b/syntax/elixir.vim
@@ -117,7 +117,7 @@ syn keyword elixirDelegateDefine defdelegate nextgroup=elixirDelegateDec
syn keyword elixirOverridableDefine defoverridable nextgroup=elixirOverridableDeclaration skipwhite skipnl
syn keyword elixirExceptionDefine defexception nextgroup=elixirExceptionDeclaration skipwhite skipnl
syn keyword elixirCallbackDefine defcallback nextgroup=elixirCallbackDeclaration skipwhite skipnl
-syn keyword elixirStructDefine defstruct nextgroup=elixirStructDeclaration skipwhite skipnl
+syn keyword elixirStructDefine defstruct skipwhite skipnl
" Declarations
syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias nextgroup=elixirBlock skipwhite skipnl
@@ -131,7 +131,6 @@ syn region elixirDelegateDeclaration start='\[' end='\]' contained con
syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
-syn match elixirStructDeclaration "[^[:space:];#<]\+" contained nextgroup=elixirArguments skipwhite skipnl
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration
diff --git a/syntax/go.vim b/syntax/go.vim
index 76377829..5aabac70 100644
--- a/syntax/go.vim
+++ b/syntax/go.vim
@@ -50,19 +50,19 @@ if !exists("go_highlight_trailing_whitespace_error")
endif
if !exists("go_highlight_operators")
- let go_highlight_operators = 1
+ let go_highlight_operators = 0
endif
if !exists("go_highlight_functions")
- let go_highlight_functions = 1
+ let go_highlight_functions = 0
endif
if !exists("go_highlight_methods")
- let go_highlight_methods = 1
+ let go_highlight_methods = 0
endif
if !exists("go_highlight_structs")
- let go_highlight_structs = 1
+ let go_highlight_structs = 0
endif
syn case match
diff --git a/syntax/php.vim b/syntax/php.vim
index 7a3eee73..475d95e7 100644
--- a/syntax/php.vim
+++ b/syntax/php.vim
@@ -3,7 +3,7 @@
"
" {{{ BLOCK: Last-modified
-" Thu, 10 Jul 2014 06:50:23 +0000, PHP 5.6.0RC2
+" Thu, 14 Aug 2014 09:05:56 +0000, PHP 5.6.0RC2
" }}}
"
@@ -182,7 +182,7 @@ endif
syn case match
if index(g:php_syntax_extensions_enabled, "core") >= 0 && index(g:php_syntax_extensions_disabled, "core") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "core") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "core") < 0)
" Core constants
-syn keyword phpConstants DEBUG_BACKTRACE_IGNORE_ARGS DEBUG_BACKTRACE_PROVIDE_OBJECT DEFAULT_INCLUDE_PATH E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING FALSE NULL PEAR_EXTENSION_DIR PEAR_INSTALL_DIR PHP_BINARY PHP_BINDIR PHP_CONFIG_FILE_PATH PHP_CONFIG_FILE_SCAN_DIR PHP_DATADIR PHP_DEBUG PHP_EOL PHP_EXTENSION_DIR PHP_EXTRA_VERSION PHP_INT_MAX PHP_INT_SIZE PHP_LIBDIR PHP_LOCALSTATEDIR PHP_MAJOR_VERSION PHP_MANDIR PHP_MAXPATHLEN PHP_MINOR_VERSION PHP_OS PHP_OUTPUT_HANDLER_CLEAN PHP_OUTPUT_HANDLER_CLEANABLE PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_DISABLED PHP_OUTPUT_HANDLER_END PHP_OUTPUT_HANDLER_FINAL PHP_OUTPUT_HANDLER_FLUSH PHP_OUTPUT_HANDLER_FLUSHABLE PHP_OUTPUT_HANDLER_REMOVABLE PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_STARTED PHP_OUTPUT_HANDLER_STDFLAGS PHP_OUTPUT_HANDLER_WRITE PHP_PREFIX PHP_RELEASE_VERSION PHP_SAPI PHP_SHLIB_SUFFIX PHP_SYSCONFDIR PHP_VERSION PHP_VERSION_ID PHP_ZTS STDERR STDIN STDOUT TRUE UPLOAD_ERR_CANT_WRITE UPLOAD_ERR_EXTENSION UPLOAD_ERR_FORM_SIZE UPLOAD_ERR_INI_SIZE UPLOAD_ERR_NO_FILE UPLOAD_ERR_NO_TMP_DIR UPLOAD_ERR_OK UPLOAD_ERR_PARTIAL ZEND_DEBUG_BUILD ZEND_THREAD_SAFE contained
+syn keyword phpConstants DEBUG_BACKTRACE_IGNORE_ARGS DEBUG_BACKTRACE_PROVIDE_OBJECT DEFAULT_INCLUDE_PATH E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING PEAR_EXTENSION_DIR PEAR_INSTALL_DIR PHP_BINARY PHP_BINDIR PHP_CONFIG_FILE_PATH PHP_CONFIG_FILE_SCAN_DIR PHP_DATADIR PHP_DEBUG PHP_EOL PHP_EXTENSION_DIR PHP_EXTRA_VERSION PHP_INT_MAX PHP_INT_SIZE PHP_LIBDIR PHP_LOCALSTATEDIR PHP_MAJOR_VERSION PHP_MANDIR PHP_MAXPATHLEN PHP_MINOR_VERSION PHP_OS PHP_OUTPUT_HANDLER_CLEAN PHP_OUTPUT_HANDLER_CLEANABLE PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_DISABLED PHP_OUTPUT_HANDLER_END PHP_OUTPUT_HANDLER_FINAL PHP_OUTPUT_HANDLER_FLUSH PHP_OUTPUT_HANDLER_FLUSHABLE PHP_OUTPUT_HANDLER_REMOVABLE PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_STARTED PHP_OUTPUT_HANDLER_STDFLAGS PHP_OUTPUT_HANDLER_WRITE PHP_PREFIX PHP_RELEASE_VERSION PHP_SAPI PHP_SHLIB_SUFFIX PHP_SYSCONFDIR PHP_VERSION PHP_VERSION_ID PHP_ZTS STDERR STDIN STDOUT UPLOAD_ERR_CANT_WRITE UPLOAD_ERR_EXTENSION UPLOAD_ERR_FORM_SIZE UPLOAD_ERR_INI_SIZE UPLOAD_ERR_NO_FILE UPLOAD_ERR_NO_TMP_DIR UPLOAD_ERR_OK UPLOAD_ERR_PARTIAL ZEND_DEBUG_BUILD ZEND_THREAD_SAFE contained
endif
if index(g:php_syntax_extensions_enabled, "curl") >= 0 && index(g:php_syntax_extensions_disabled, "curl") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "curl") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "curl") < 0)
" curl constants
@@ -586,7 +586,7 @@ if !exists("php_ignore_phpdoc") || !php_ignore_phpdoc
syn region phpCommentTitle contained matchgroup=phpDocComment start="/\*\*" matchgroup=phpCommmentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=phpCommentStar,phpTodo,phpDocTags,@Spell containedin=phpDocComment
syn region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpDocComment
- syn match phpDocTags "@\%(abstract\|access\|author\|category\|copyright\|deprecated\|example\|exception\|filesource\|final\|global\|id\|ignore\|inheritdoc\|internal\|license\|link\|magic\|method\|name\|package\|param\|property\|return\|see\|since\|source\|static\|staticvar\|subpackage\|throws\|toc\|todo\|tutorial\|uses\|var\|version\)" containedin=phpDocComment nextgroup=phpDocParam,phpDocIdentifier skipwhite
+ syn match phpDocTags "@\%(abstract\|access\|api\|author\|brief\|bug\|category\|class\|copyright\|created\|date\|deprecated\|details\|example\|exception\|file\|filesource\|final\|global\|id\|ignore\|inheritdoc\|internal\|license\|link\|magic\|method\|name\|package\|param\|property\|return\|see\|since\|source\|static\|staticvar\|struct\|subpackage\|throws\|toc\|todo\|tutorial\|type\|uses\|var\|version\|warning\)" containedin=phpDocComment nextgroup=phpDocParam,phpDocIdentifier skipwhite
syn match phpDocParam "\s\+\zs\%(\h\w*|\?\)\+" nextgroup=phpDocIdentifier skipwhite
syn match phpDocIdentifier "\s\+\zs$\h\w*"
diff --git a/syntax/rust.vim b/syntax/rust.vim
index d8330b84..6ee610d9 100644
--- a/syntax/rust.vim
+++ b/syntax/rust.vim
@@ -11,17 +11,6 @@ elseif exists("b:current_syntax")
finish
endif
-" Fold settings {{{1
-
-if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
- setlocal foldmethod=syntax
- if g:rust_fold == 2
- setlocal foldlevel<
- else
- setlocal foldlevel=99
- endif
-endif
-
" Syntax definitions {{{1
" Basic keywords {{{2
syn keyword rustConditional match if else
@@ -37,7 +26,7 @@ syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
syn keyword rustKeyword for in if impl let
syn keyword rustKeyword loop once proc pub
syn keyword rustKeyword return super
-syn keyword rustKeyword unsafe virtual while
+syn keyword rustKeyword unsafe virtual where while
syn keyword rustKeyword use nextgroup=rustModPath,rustModPathInUse skipwhite skipempty
" FIXME: Scoped impl's name is also fallen in this category
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
@@ -95,7 +84,7 @@ syn keyword rustEnumVariant Ok Err
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
syn keyword rustTrait IntoBytes
syn keyword rustTrait ToCStr
-syn keyword rustTrait Char
+syn keyword rustTrait Char UnicodeChar
syn keyword rustTrait Clone
syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv
syn keyword rustEnum Ordering
@@ -113,18 +102,18 @@ syn keyword rustTrait Box
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
syn keyword rustTrait RawPtr
syn keyword rustTrait Buffer Writer Reader Seek
-syn keyword rustTrait Str StrVector StrSlice OwnedStr
-syn keyword rustTrait IntoMaybeOwned StrAllocating
+syn keyword rustTrait Str StrVector StrSlice
+syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice
syn keyword rustTrait ToString IntoStr
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
syn keyword rustTrait CloneableVector ImmutableCloneableVector
-syn keyword rustTrait MutableCloneableVector MutableOrdVector
-syn keyword rustTrait ImmutableVector MutableVector
-syn keyword rustTrait ImmutableEqVector ImmutableOrdVector
-syn keyword rustTrait Vector VectorVector
-syn keyword rustTrait MutableVectorAllocating
+syn keyword rustTrait MutableCloneableSlice MutableOrdSlice
+syn keyword rustTrait ImmutableSlice MutableSlice
+syn keyword rustTrait ImmutablePartialEqSlice ImmutableOrdSlice
+syn keyword rustTrait Slice VectorVector
+syn keyword rustTrait MutableSliceAllocating
syn keyword rustTrait String
syn keyword rustTrait Vec