Update
This commit is contained in:
parent
c161994e96
commit
ed677c34d5
@ -94,7 +94,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
||||||
- [jsx](https://github.com/mxw/vim-jsx) (after)
|
- [jsx](https://github.com/mxw/vim-jsx) (after)
|
||||||
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, autoload, ftplugin)
|
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, autoload, ftplugin)
|
||||||
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent)
|
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent, ftplugin)
|
||||||
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
||||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin)
|
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin)
|
||||||
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin)
|
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin)
|
||||||
|
@ -27,7 +27,7 @@ syn match yamlBlock "[>|]\d\?[+-]"
|
|||||||
syn region yamlComment start="\#" end="$"
|
syn region yamlComment start="\#" end="$"
|
||||||
syn match yamlIndicator "#YAML:\S\+"
|
syn match yamlIndicator "#YAML:\S\+"
|
||||||
|
|
||||||
syn region yamlString start="\(^\|\s\|\[\|\,\|\-\)'" end="'" skip="\\'"
|
syn region yamlString start="\(^\|\s\|\[\|\,\|\-\)\@<='" end="'" skip="\\'"
|
||||||
syn region yamlString start='"' end='"' skip='\\"' contains=yamlEscape
|
syn region yamlString start='"' end='"' skip='\\"' contains=yamlEscape
|
||||||
syn region yamlString matchgroup=yamlBlock start=/[>|]\s*\n\+\z(\s\+\)\S/rs=s+1 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
|
syn region yamlString matchgroup=yamlBlock start=/[>|]\s*\n\+\z(\s\+\)\S/rs=s+1 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
|
||||||
syn region yamlString matchgroup=yamlBlock start=/[>|]\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+2 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
|
syn region yamlString matchgroup=yamlBlock start=/[>|]\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+2 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
|
||||||
|
@ -2,9 +2,13 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rst') == -1
|
|||||||
|
|
||||||
" Author: Antony Lee <anntzer.lee@gmail.com>
|
" Author: Antony Lee <anntzer.lee@gmail.com>
|
||||||
" Description: Helper functions for reStructuredText syntax folding
|
" Description: Helper functions for reStructuredText syntax folding
|
||||||
" Last Modified: 2018-01-07
|
" Last Modified: 2018-12-29
|
||||||
|
|
||||||
function s:CacheRstFold()
|
function s:CacheRstFold()
|
||||||
|
if !g:rst_fold_enabled
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
let closure = {'header_types': {}, 'max_level': 0, 'levels': {}}
|
let closure = {'header_types': {}, 'max_level': 0, 'levels': {}}
|
||||||
function closure.Process(match) dict
|
function closure.Process(match) dict
|
||||||
let curline = getcurpos()[1]
|
let curline = getcurpos()[1]
|
||||||
@ -30,6 +34,10 @@ function s:CacheRstFold()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function RstFold#GetRstFold()
|
function RstFold#GetRstFold()
|
||||||
|
if !g:rst_fold_enabled
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
if !has_key(b:, 'RstFoldCache')
|
if !has_key(b:, 'RstFoldCache')
|
||||||
call s:CacheRstFold()
|
call s:CacheRstFold()
|
||||||
endif
|
endif
|
||||||
@ -41,6 +49,10 @@ function RstFold#GetRstFold()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function RstFold#GetRstFoldText()
|
function RstFold#GetRstFoldText()
|
||||||
|
if !g:rst_fold_enabled
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
if !has_key(b:, 'RstFoldCache')
|
if !has_key(b:, 'RstFoldCache')
|
||||||
call s:CacheRstFold()
|
call s:CacheRstFold()
|
||||||
endif
|
endif
|
||||||
|
@ -267,7 +267,7 @@ function! elixir#indent#handle_inside_block(context)
|
|||||||
let config = {
|
let config = {
|
||||||
\'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
\'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
||||||
\'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
\'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
||||||
\'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after'), 'pattern_match_clauses': s:keyword('catch\|rescue')},
|
\'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after\|else'), 'pattern_match_clauses': s:keyword('catch\|rescue\|else')},
|
||||||
\'r': {'aligned_clauses': s:keyword('end\|after'), 'pattern_match_clauses': s:keyword('after')},
|
\'r': {'aligned_clauses': s:keyword('end\|after'), 'pattern_match_clauses': s:keyword('after')},
|
||||||
\'i': {'aligned_clauses': s:keyword('end\|else'), 'pattern_match_clauses': never_match},
|
\'i': {'aligned_clauses': s:keyword('end\|else'), 'pattern_match_clauses': never_match},
|
||||||
\'[': {'aligned_clauses': ']', 'pattern_match_clauses': never_match},
|
\'[': {'aligned_clauses': ']', 'pattern_match_clauses': never_match},
|
||||||
|
@ -390,8 +390,9 @@ function! go#config#HighlightFunctions() abort
|
|||||||
return get(g:, 'go_highlight_functions', 0)
|
return get(g:, 'go_highlight_functions', 0)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#HighlightFunctionArguments() abort
|
function! go#config#HighlightFunctionParameters() abort
|
||||||
return get(g:, 'go_highlight_function_arguments', 0)
|
" fallback to highlight_function_arguments for backwards compatibility
|
||||||
|
return get(g:, 'go_highlight_function_parameters', get(g:, 'go_highlight_function_arguments', 0))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#HighlightFunctionCalls() abort
|
function! go#config#HighlightFunctionCalls() abort
|
||||||
@ -441,6 +442,11 @@ function! go#config#FoldEnable(...) abort
|
|||||||
return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment'])
|
return get(g:, 'go_fold_enable', ['block', 'import', 'varconst', 'package_comment'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#EchoGoInfo() abort
|
||||||
|
return get(g:, "go_echo_go_info", 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
" Set the default value. A value of "1" is a shortcut for this, for
|
" Set the default value. A value of "1" is a shortcut for this, for
|
||||||
" compatibility reasons.
|
" compatibility reasons.
|
||||||
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1
|
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
||||||
|
|
||||||
" Vim completion script
|
" Vim completion script
|
||||||
" Language: Ruby
|
" Language: Ruby
|
||||||
" Maintainer: Mark Guzman <segfault@hasno.info>
|
" Maintainer: Mark Guzman <segfault@hasno.info>
|
||||||
" URL: https://github.com/vim-ruby/vim-ruby
|
" URL: https://github.com/vim-ruby/vim-ruby
|
||||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||||
" Maintainer Version: 0.8.1
|
|
||||||
" ----------------------------------------------------------------------------
|
" ----------------------------------------------------------------------------
|
||||||
"
|
"
|
||||||
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
|
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
|
||||||
@ -55,6 +54,23 @@ if !exists("g:rubycomplete_include_objectspace")
|
|||||||
endif
|
endif
|
||||||
" }}} configuration failsafe initialization
|
" }}} configuration failsafe initialization
|
||||||
|
|
||||||
|
" {{{ regex patterns
|
||||||
|
|
||||||
|
" Regex that defines the start-match for the 'end' keyword.
|
||||||
|
let s:end_start_regex =
|
||||||
|
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
|
||||||
|
\ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' .
|
||||||
|
\ '\|\%(\K\k*[!?]\?\s\+\)\=def\):\@!\>' .
|
||||||
|
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
|
||||||
|
|
||||||
|
" Regex that defines the middle-match for the 'end' keyword.
|
||||||
|
let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue:\@!\>\|when\|elsif\):\@!\>'
|
||||||
|
|
||||||
|
" Regex that defines the end-match for the 'end' keyword.
|
||||||
|
let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end:\@!\>'
|
||||||
|
|
||||||
|
" }}} regex patterns
|
||||||
|
|
||||||
" {{{ vim-side support functions
|
" {{{ vim-side support functions
|
||||||
let s:rubycomplete_debug = 0
|
let s:rubycomplete_debug = 0
|
||||||
|
|
||||||
@ -105,7 +121,7 @@ function! s:GetBufferRubyEntity( name, type, ... )
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let curpos = getpos(".")
|
let curpos = getpos(".")
|
||||||
let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'W' )
|
let [enum,ecol] = searchpairpos( s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'W' )
|
||||||
call cursor(lastpos[1], lastpos[2])
|
call cursor(lastpos[1], lastpos[2])
|
||||||
|
|
||||||
if lnum > enum
|
if lnum > enum
|
||||||
@ -130,19 +146,28 @@ function! s:IsPosInClassDef(pos)
|
|||||||
return ret
|
return ret
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:IsInComment(pos)
|
||||||
|
let stack = synstack(a:pos[0], a:pos[1])
|
||||||
|
if !empty(stack)
|
||||||
|
return synIDattr(stack[0], 'name') =~ 'ruby\%(.*Comment\|Documentation\)'
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:GetRubyVarType(v)
|
function! s:GetRubyVarType(v)
|
||||||
let stopline = 1
|
let stopline = 1
|
||||||
let vtp = ''
|
let vtp = ''
|
||||||
let pos = getpos('.')
|
let curpos = getpos('.')
|
||||||
let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$'
|
let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$'
|
||||||
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
|
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
|
||||||
if lnum != 0 && lcol != 0
|
if lnum != 0 && lcol != 0
|
||||||
call setpos('.',pos)
|
call setpos('.',curpos)
|
||||||
let str = getline(lnum)
|
let str = getline(lnum)
|
||||||
let vtp = substitute(str,sstr,'\1','')
|
let vtp = substitute(str,sstr,'\1','')
|
||||||
return vtp
|
return vtp
|
||||||
endif
|
endif
|
||||||
call setpos('.',pos)
|
call setpos('.',curpos)
|
||||||
let ctors = '\(now\|new\|open\|get_instance'
|
let ctors = '\(now\|new\|open\|get_instance'
|
||||||
if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1
|
if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1
|
||||||
let ctors = ctors.'\|find\|create'
|
let ctors = ctors.'\|find\|create'
|
||||||
@ -152,9 +177,13 @@ function! s:GetRubyVarType(v)
|
|||||||
|
|
||||||
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
|
let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
|
||||||
let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr
|
let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr
|
||||||
let [lnum,lcol] = searchpos(sstr,'nb',stopline)
|
let pos = searchpos(sstr,'bW')
|
||||||
if lnum != 0 && lcol != 0
|
while pos != [0,0] && s:IsInComment(pos)
|
||||||
let str = matchstr(getline(lnum),fstr,lcol)
|
let pos = searchpos(sstr,'bW')
|
||||||
|
endwhile
|
||||||
|
if pos != [0,0]
|
||||||
|
let [lnum, col] = pos
|
||||||
|
let str = matchstr(getline(lnum),fstr,col)
|
||||||
let str = substitute(str,'^=\s*','','')
|
let str = substitute(str,'^=\s*','','')
|
||||||
|
|
||||||
call setpos('.',pos)
|
call setpos('.',pos)
|
||||||
@ -176,7 +205,7 @@ function! s:GetRubyVarType(v)
|
|||||||
end
|
end
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
call setpos('.',pos)
|
call setpos('.',curpos)
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -673,11 +702,10 @@ class VimRubyCompletion
|
|||||||
methods.delete_if { |c| c.match( /'/ ) }
|
methods.delete_if { |c| c.match( /'/ ) }
|
||||||
end
|
end
|
||||||
|
|
||||||
when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods
|
when /^::([A-Z][^:\.\(]*)?$/ # Absolute Constant or class methods
|
||||||
dprint "const or cls"
|
dprint "const or cls"
|
||||||
receiver = $1
|
receiver = $1
|
||||||
methods = Object.constants
|
methods = Object.constants.collect{ |c| c.to_s }.grep(/^#{receiver}/)
|
||||||
methods.grep(/^#{receiver}/).collect{|e| "::" + e}
|
|
||||||
|
|
||||||
when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods
|
when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods
|
||||||
receiver = $1
|
receiver = $1
|
||||||
@ -686,13 +714,13 @@ class VimRubyCompletion
|
|||||||
load_buffer_class( receiver )
|
load_buffer_class( receiver )
|
||||||
load_buffer_module( receiver )
|
load_buffer_module( receiver )
|
||||||
begin
|
begin
|
||||||
classes = eval("#{receiver}.constants")
|
constants = eval("#{receiver}.constants").collect{ |c| c.to_s }.grep(/^#{message}/)
|
||||||
#methods = eval("#{receiver}.methods")
|
methods = eval("#{receiver}.methods").collect{ |m| m.to_s }.grep(/^#{message}/)
|
||||||
rescue Exception
|
rescue Exception
|
||||||
dprint "exception: %s" % $!
|
dprint "exception: %s" % $!
|
||||||
|
constants = []
|
||||||
methods = []
|
methods = []
|
||||||
end
|
end
|
||||||
methods.grep(/^#{message}/).collect{|e| receiver + "::" + e}
|
|
||||||
|
|
||||||
when /^(:[^:.]+)\.([^.]*)$/ # Symbol
|
when /^(:[^:.]+)\.([^.]*)$/ # Symbol
|
||||||
dprint "symbol"
|
dprint "symbol"
|
||||||
|
@ -5,8 +5,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
|||||||
" Last Modified: May 27, 2014
|
" Last Modified: May 27, 2014
|
||||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||||
|
|
||||||
" Jump {{{1
|
|
||||||
|
|
||||||
function! rust#Load()
|
function! rust#Load()
|
||||||
" Utility call to get this script loaded, for debugging
|
" Utility call to get this script loaded, for debugging
|
||||||
endfunction
|
endfunction
|
||||||
@ -22,6 +20,44 @@ function! rust#GetConfigVar(name, default)
|
|||||||
return a:default
|
return a:default
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Include expression {{{1
|
||||||
|
|
||||||
|
function! rust#IncludeExpr(fname) abort
|
||||||
|
" Remove leading 'crate::' to deal with 2018 edition style 'use'
|
||||||
|
" statements
|
||||||
|
let l:fname = substitute(a:fname, '^crate::', '', '')
|
||||||
|
|
||||||
|
" Remove trailing colons arising from lines like
|
||||||
|
"
|
||||||
|
" use foo::{Bar, Baz};
|
||||||
|
let l:fname = substitute(l:fname, ':\+$', '', '')
|
||||||
|
|
||||||
|
" Replace '::' with '/'
|
||||||
|
let l:fname = substitute(l:fname, '::', '/', 'g')
|
||||||
|
|
||||||
|
" When we have
|
||||||
|
"
|
||||||
|
" use foo::bar::baz;
|
||||||
|
"
|
||||||
|
" we can't tell whether baz is a module or a function; and we can't tell
|
||||||
|
" which modules correspond to files.
|
||||||
|
"
|
||||||
|
" So we work our way up, trying
|
||||||
|
"
|
||||||
|
" foo/bar/baz.rs
|
||||||
|
" foo/bar.rs
|
||||||
|
" foo.rs
|
||||||
|
while l:fname !=# '.'
|
||||||
|
let l:path = findfile(l:fname)
|
||||||
|
if !empty(l:path)
|
||||||
|
return l:fname
|
||||||
|
endif
|
||||||
|
let l:fname = fnamemodify(l:fname, ':h')
|
||||||
|
endwhile
|
||||||
|
return l:fname
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Jump {{{1
|
||||||
|
|
||||||
function! rust#Jump(mode, function) range
|
function! rust#Jump(mode, function) range
|
||||||
let cnt = v:count1
|
let cnt = v:count1
|
||||||
@ -487,14 +523,6 @@ function! rust#Test(all, options) abort
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let mod_name = expand('%:t:r')
|
|
||||||
if mod_name ==# ''
|
|
||||||
echohl ErrorMsg
|
|
||||||
echo 'Cannot extract a module name from file name. Please add ! to command if you want to run all tests'
|
|
||||||
echohl None
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let saved = getpos('.')
|
let saved = getpos('.')
|
||||||
try
|
try
|
||||||
let func_name = s:SearchTestFunctionNameUnderCursor()
|
let func_name = s:SearchTestFunctionNameUnderCursor()
|
||||||
@ -504,11 +532,10 @@ function! rust#Test(all, options) abort
|
|||||||
echohl None
|
echohl None
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let spec = mod_name . '::' . func_name
|
|
||||||
if a:options ==# ''
|
if a:options ==# ''
|
||||||
execute cmd . 'cargo test --manifest-path' manifest spec
|
execute cmd . 'cargo test --manifest-path' manifest func_name
|
||||||
else
|
else
|
||||||
execute cmd . 'cargo test --manifest-path' manifest spec a:options
|
execute cmd . 'cargo test --manifest-path' manifest func_name a:options
|
||||||
endif
|
endif
|
||||||
return
|
return
|
||||||
finally
|
finally
|
||||||
|
@ -6,7 +6,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
|||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" URL: https://github.com/vim-ruby/vim-ruby
|
" URL: https://github.com/vim-ruby/vim-ruby
|
||||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||||
" ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
|
@ -22,8 +22,8 @@ set cpo-=C
|
|||||||
CompilerSet makeprg=sbt\ -Dsbt.log.noformat=true\ compile
|
CompilerSet makeprg=sbt\ -Dsbt.log.noformat=true\ compile
|
||||||
|
|
||||||
CompilerSet errorformat=
|
CompilerSet errorformat=
|
||||||
\%E\ %#[error]\ %f:%l:\ %m,%C\ %#[error]\ %p^,%-C%.%#,%Z,
|
\%E\ %#[error]\ %f:%l:%c:\ %m,%C\ %#[error]\ %p^,%-C%.%#,%Z,
|
||||||
\%W\ %#[warn]\ %f:%l:\ %m,%C\ %#[warn]\ %p^,%-C%.%#,%Z,
|
\%W\ %#[warn]\ %f:%l:%c:\ %m,%C\ %#[warn]\ %p^,%-C%.%#,%Z,
|
||||||
\%-G%.%#
|
\%-G%.%#
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
|
@ -5,13 +5,14 @@ syntax region jsFlowArgumentDef contained start=/:/
|
|||||||
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ contains=@jsFlowCluster,jsComment fold
|
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ contains=@jsFlowCluster,jsComment fold
|
||||||
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=@jsFlowCluster,jsComment fold
|
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=@jsFlowCluster,jsComment fold
|
||||||
syntax region jsFlowExactObject contained matchgroup=jsFlowNoise start=/{|/ end=/|}/ contains=@jsFlowCluster,jsComment fold
|
syntax region jsFlowExactObject contained matchgroup=jsFlowNoise start=/{|/ end=/|}/ contains=@jsFlowCluster,jsComment fold
|
||||||
syntax region jsFlowParens contained matchgroup=jsFlowNoise start=/(/ end=/)/ contains=@jsFlowCluster keepend fold
|
syntax region jsFlowParens contained matchgroup=jsFlowNoise start=/(/ end=/)/ contains=@jsFlowCluster nextgroup=jsFlowArrow skipwhite keepend extend fold
|
||||||
syntax match jsFlowNoise contained /[:;,<>]/
|
syntax match jsFlowNoise contained /[:;,<>]/
|
||||||
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array Function object array bool class
|
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array Function object array bool class
|
||||||
syntax keyword jsFlowTypeof contained typeof skipempty skipempty nextgroup=jsFlowTypeCustom,jsFlowType
|
syntax keyword jsFlowTypeof contained typeof skipempty skipwhite nextgroup=jsFlowTypeCustom,jsFlowType
|
||||||
syntax match jsFlowTypeCustom contained /[0-9a-zA-Z_.]*/ skipwhite skipempty nextgroup=jsFlowGroup
|
syntax match jsFlowTypeCustom contained /[0-9a-zA-Z_.]*/ skipwhite skipempty nextgroup=jsFlowGeneric
|
||||||
syntax region jsFlowGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster
|
syntax region jsFlowGeneric matchgroup=jsFlowNoise start=/\k\@<=</ end=/>/ contains=@jsFlowCluster containedin=@jsExpression,jsFlowDeclareBlock
|
||||||
syntax region jsFlowArrowArguments contained matchgroup=jsFlowNoise start=/(/ end=/)\%(\s*=>\)\@=/ oneline skipwhite skipempty nextgroup=jsFlowArrow contains=@jsFlowCluster
|
syntax region jsFlowGeneric contained matchgroup=jsFlowNoise start=/</ end=/>(\@=/ oneline contains=@jsFlowCluster containedin=@jsExpression,jsFlowDeclareBlock
|
||||||
|
syntax region jsFlowObjectGeneric contained matchgroup=jsFlowNoise start=/\k\@<=</ end=/>/ contains=@jsFlowCluster nextgroup=jsFuncArgs
|
||||||
syntax match jsFlowArrow contained /=>/ skipwhite skipempty nextgroup=jsFlowType,jsFlowTypeCustom,jsFlowParens
|
syntax match jsFlowArrow contained /=>/ skipwhite skipempty nextgroup=jsFlowType,jsFlowTypeCustom,jsFlowParens
|
||||||
syntax match jsFlowObjectKey contained /[0-9a-zA-Z_$?]*\(\s*:\)\@=/ contains=jsFunctionKey,jsFlowMaybe skipwhite skipempty nextgroup=jsObjectValue containedin=jsObject
|
syntax match jsFlowObjectKey contained /[0-9a-zA-Z_$?]*\(\s*:\)\@=/ contains=jsFunctionKey,jsFlowMaybe skipwhite skipempty nextgroup=jsObjectValue containedin=jsObject
|
||||||
syntax match jsFlowOrOperator contained /|/ skipwhite skipempty nextgroup=@jsFlowCluster
|
syntax match jsFlowOrOperator contained /|/ skipwhite skipempty nextgroup=@jsFlowCluster
|
||||||
@ -19,7 +20,7 @@ syntax keyword jsFlowImportType contained type typeof skipwhite skipempty ne
|
|||||||
syntax match jsFlowWildcard contained /*/
|
syntax match jsFlowWildcard contained /*/
|
||||||
|
|
||||||
syntax match jsFlowReturn contained /:\s*/ contains=jsFlowNoise skipwhite skipempty nextgroup=@jsFlowReturnCluster,jsFlowArrow,jsFlowReturnParens
|
syntax match jsFlowReturn contained /:\s*/ contains=jsFlowNoise skipwhite skipempty nextgroup=@jsFlowReturnCluster,jsFlowArrow,jsFlowReturnParens
|
||||||
syntax region jsFlowReturnObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp fold
|
syntax region jsFlowReturnObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp extend fold
|
||||||
syntax region jsFlowReturnArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp fold
|
syntax region jsFlowReturnArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp fold
|
||||||
syntax region jsFlowReturnParens contained matchgroup=jsFlowNoise start=/(/ end=/)/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp,jsFlowReturnArrow fold
|
syntax region jsFlowReturnParens contained matchgroup=jsFlowNoise start=/(/ end=/)/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp,jsFlowReturnArrow fold
|
||||||
syntax match jsFlowReturnArrow contained /=>/ skipwhite skipempty nextgroup=@jsFlowReturnCluster
|
syntax match jsFlowReturnArrow contained /=>/ skipwhite skipempty nextgroup=@jsFlowReturnCluster
|
||||||
@ -28,13 +29,15 @@ syntax match jsFlowReturnMaybe contained /?/ skipwhite skipempty nextgroup=
|
|||||||
syntax region jsFlowReturnGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp
|
syntax region jsFlowReturnGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp
|
||||||
syntax match jsFlowReturnOrOp contained /\s*|\s*/ skipwhite skipempty nextgroup=@jsFlowReturnCluster
|
syntax match jsFlowReturnOrOp contained /\s*|\s*/ skipwhite skipempty nextgroup=@jsFlowReturnCluster
|
||||||
syntax match jsFlowWildcardReturn contained /*/ skipwhite skipempty nextgroup=jsFuncBlock
|
syntax match jsFlowWildcardReturn contained /*/ skipwhite skipempty nextgroup=jsFuncBlock
|
||||||
|
syntax keyword jsFlowTypeofReturn contained typeof skipempty skipwhite nextgroup=@jsFlowReturnCluster
|
||||||
|
|
||||||
syntax region jsFlowFunctionGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs
|
syntax region jsFlowFunctionGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs
|
||||||
syntax region jsFlowClassGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
|
syntax region jsFlowClassGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
|
||||||
syntax region jsFlowClassFunctionGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs
|
syntax region jsFlowClassFunctionGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncArgs
|
||||||
|
syntax match jsFlowObjectFuncName contained /\<\K\k*<\@=/ skipwhite skipempty nextgroup=jsFlowObjectGeneric containedin=jsObject
|
||||||
|
|
||||||
syntax region jsFlowTypeStatement start=/\(opaque\s\+\)\?type\%(\s\+\k\)\@=/ end=/=\@=/ contains=jsFlowTypeOperator oneline skipwhite skipempty nextgroup=jsFlowTypeValue keepend
|
syntax region jsFlowTypeStatement start=/\(opaque\s\+\)\?type\%(\s\+\k\)\@=/ end=/=\@=/ contains=jsFlowTypeOperator oneline skipwhite skipempty nextgroup=jsFlowTypeValue keepend
|
||||||
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/=/ end=/[\n;]/ contains=@jsFlowCluster,jsFlowGroup,jsFlowMaybe
|
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/=/ end=/\%(;\|\n\%(\s*|\)\@!\)/ contains=@jsFlowCluster,jsFlowGeneric,jsFlowMaybe
|
||||||
syntax match jsFlowTypeOperator contained /=/ containedin=jsFlowTypeValue
|
syntax match jsFlowTypeOperator contained /=/ containedin=jsFlowTypeValue
|
||||||
syntax match jsFlowTypeOperator contained /=/
|
syntax match jsFlowTypeOperator contained /=/
|
||||||
syntax keyword jsFlowTypeKeyword contained type
|
syntax keyword jsFlowTypeKeyword contained type
|
||||||
@ -43,20 +46,17 @@ syntax keyword jsFlowDeclare declare skipwhite skipempty nextgr
|
|||||||
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlowClassDef containedin=jsClassBlock
|
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlowClassDef containedin=jsClassBlock
|
||||||
syntax region jsFlowClassDef contained start=/:/ end=/\%(\s*[,=;)\n]\)\@=/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassValue
|
syntax region jsFlowClassDef contained start=/:/ end=/\%(\s*[,=;)\n]\)\@=/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassValue
|
||||||
|
|
||||||
syntax region jsFlowModule contained start=/module/ end=/{\@=/ skipempty skipempty nextgroup=jsFlowDeclareBlock contains=jsString
|
syntax region jsFlowModule contained start=/module/ end=/\%({\|:\)\@=/ skipempty skipwhite nextgroup=jsFlowDeclareBlock contains=jsString
|
||||||
syntax region jsFlowInterface contained start=/interface/ end=/{\@=/ skipempty skipempty nextgroup=jsFlowInterfaceBlock contains=@jsFlowCluster
|
syntax region jsFlowInterface contained start=/interface/ end=/{\@=/ skipempty skipwhite nextgroup=jsFlowInterfaceBlock contains=@jsFlowCluster
|
||||||
syntax region jsFlowDeclareBlock contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=jsFlowDeclare,jsFlowNoise fold
|
syntax region jsFlowDeclareBlock contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=jsFlowDeclare,jsFlowNoise fold
|
||||||
|
|
||||||
" NOTE: It appears the nextgroup was causing a ton of breakages... testing it
|
|
||||||
" witout a nextgroup, but keeping this arround for reference incase something breaks
|
|
||||||
" syntax match jsFlowMaybe contained /?/ nextgroup=jsFlowType,jsFlowTypeCustom,jsFlowParens,jsFlowArrowArguments,jsFlowObject,jsFlowReturnObject extend keepend
|
|
||||||
syntax match jsFlowMaybe contained /?/
|
syntax match jsFlowMaybe contained /?/
|
||||||
syntax region jsFlowInterfaceBlock contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsFlowNoise keepend fold
|
syntax region jsFlowInterfaceBlock contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsFlowObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsFlowNoise,jsFlowParens,jsFlowGeneric keepend fold
|
||||||
|
|
||||||
syntax region jsFlowParenAnnotation contained start=/:/ end=/[,=)]\@=/ containedin=jsParen contains=@jsFlowCluster
|
syntax region jsFlowParenAnnotation contained start=/:/ end=/[,=)]\@=/ containedin=jsParen contains=@jsFlowCluster
|
||||||
|
|
||||||
syntax cluster jsFlowReturnCluster contains=jsFlowNoise,jsFlowReturnObject,jsFlowReturnArray,jsFlowReturnKeyword,jsFlowReturnGroup,jsFlowReturnMaybe,jsFlowReturnOrOp,jsFlowWildcardReturn,jsFlowReturnArrow
|
syntax cluster jsFlowReturnCluster contains=jsFlowNoise,jsFlowReturnObject,jsFlowReturnArray,jsFlowReturnKeyword,jsFlowReturnGroup,jsFlowReturnMaybe,jsFlowReturnOrOp,jsFlowWildcardReturn,jsFlowReturnArrow,jsFlowTypeofReturn
|
||||||
syntax cluster jsFlowCluster contains=jsFlowArray,jsFlowObject,jsFlowExactObject,jsFlowNoise,jsFlowTypeof,jsFlowType,jsFlowGroup,jsFlowArrowArguments,jsFlowMaybe,jsFlowParens,jsFlowOrOperator,jsFlowWildcard
|
syntax cluster jsFlowCluster contains=jsFlowArray,jsFlowObject,jsFlowExactObject,jsFlowNoise,jsFlowTypeof,jsFlowType,jsFlowGeneric,jsFlowMaybe,jsFlowParens,jsFlowOrOperator,jsFlowWildcard
|
||||||
|
|
||||||
if version >= 508 || !exists("did_javascript_syn_inits")
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
if version < 508
|
if version < 508
|
||||||
@ -71,21 +71,22 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsFlowType Type
|
HiLink jsFlowType Type
|
||||||
HiLink jsFlowTypeCustom PreProc
|
HiLink jsFlowTypeCustom PreProc
|
||||||
HiLink jsFlowTypeof PreProc
|
HiLink jsFlowTypeof PreProc
|
||||||
|
HiLink jsFlowTypeofReturn PreProc
|
||||||
HiLink jsFlowArray PreProc
|
HiLink jsFlowArray PreProc
|
||||||
HiLink jsFlowObject PreProc
|
HiLink jsFlowObject PreProc
|
||||||
HiLink jsFlowExactObject PreProc
|
HiLink jsFlowExactObject PreProc
|
||||||
HiLink jsFlowParens PreProc
|
HiLink jsFlowParens PreProc
|
||||||
HiLink jsFlowGroup PreProc
|
HiLink jsFlowGeneric PreProc
|
||||||
|
HiLink jsFlowObjectGeneric jsFlowGeneric
|
||||||
HiLink jsFlowReturn PreProc
|
HiLink jsFlowReturn PreProc
|
||||||
HiLink jsFlowParenAnnotation PreProc
|
HiLink jsFlowParenAnnotation PreProc
|
||||||
HiLink jsFlowReturnObject jsFlowReturn
|
HiLink jsFlowReturnObject jsFlowReturn
|
||||||
HiLink jsFlowReturnArray jsFlowArray
|
HiLink jsFlowReturnArray jsFlowArray
|
||||||
HiLink jsFlowReturnParens jsFlowParens
|
HiLink jsFlowReturnParens jsFlowParens
|
||||||
HiLink jsFlowReturnGroup jsFlowGroup
|
HiLink jsFlowReturnGroup jsFlowGeneric
|
||||||
HiLink jsFlowFunctionGroup PreProc
|
HiLink jsFlowFunctionGroup PreProc
|
||||||
HiLink jsFlowClassGroup PreProc
|
HiLink jsFlowClassGroup PreProc
|
||||||
HiLink jsFlowClassFunctionGroup PreProc
|
HiLink jsFlowClassFunctionGroup PreProc
|
||||||
HiLink jsFlowArrowArguments PreProc
|
|
||||||
HiLink jsFlowArrow PreProc
|
HiLink jsFlowArrow PreProc
|
||||||
HiLink jsFlowReturnArrow PreProc
|
HiLink jsFlowReturnArrow PreProc
|
||||||
HiLink jsFlowTypeStatement PreProc
|
HiLink jsFlowTypeStatement PreProc
|
||||||
@ -105,6 +106,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsFlowWildcardReturn PreProc
|
HiLink jsFlowWildcardReturn PreProc
|
||||||
HiLink jsFlowImportType PreProc
|
HiLink jsFlowImportType PreProc
|
||||||
HiLink jsFlowTypeValue PreProc
|
HiLink jsFlowTypeValue PreProc
|
||||||
|
HiLink jsFlowObjectFuncName jsObjectFuncName
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -141,9 +141,18 @@ function! s:setupTemplate()
|
|||||||
set ft=jinja2
|
set ft=jinja2
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
au BufNewFile,BufRead * if s:isAnsible() | set ft=yaml.ansible | en
|
augroup ansible_vim_ftyaml_ansible
|
||||||
au BufNewFile,BufRead *.j2 call s:setupTemplate()
|
au!
|
||||||
au BufNewFile,BufRead hosts set ft=ansible_hosts
|
au BufNewFile,BufRead * if s:isAnsible() | set ft=yaml.ansible | en
|
||||||
|
augroup END
|
||||||
|
augroup ansible_vim_ftjinja2
|
||||||
|
au!
|
||||||
|
au BufNewFile,BufRead *.j2 call s:setupTemplate()
|
||||||
|
augroup END
|
||||||
|
augroup ansible_vim_fthosts
|
||||||
|
au!
|
||||||
|
au BufNewFile,BufRead hosts set ft=ansible_hosts
|
||||||
|
augroup END
|
||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -363,45 +372,19 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" We take care to preserve the user's fileencodings and fileformats,
|
|
||||||
" because those settings are global (not buffer local), yet we want
|
|
||||||
" to override them for loading Go files, which are defined to be UTF-8.
|
|
||||||
let s:current_fileformats = ''
|
|
||||||
let s:current_fileencodings = ''
|
|
||||||
|
|
||||||
" define fileencodings to open as utf-8 encoding even if it's ascii.
|
|
||||||
function! s:gofiletype_pre(type)
|
|
||||||
let s:current_fileformats = &g:fileformats
|
|
||||||
let s:current_fileencodings = &g:fileencodings
|
|
||||||
set fileencodings=utf-8 fileformats=unix
|
|
||||||
let &l:filetype = a:type
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" restore fileencodings as others
|
|
||||||
function! s:gofiletype_post()
|
|
||||||
let &g:fileformats = s:current_fileformats
|
|
||||||
let &g:fileencodings = s:current_fileencodings
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Note: should not use augroup in ftdetect (see :help ftdetect)
|
" Note: should not use augroup in ftdetect (see :help ftdetect)
|
||||||
au BufNewFile *.go setfiletype go | if &modifiable | setlocal fileencoding=utf-8 fileformat=unix | endif
|
au BufRead,BufNewFile *.go setfiletype go
|
||||||
au BufRead *.go call s:gofiletype_pre("go")
|
au BufRead,BufNewFile *.s setfiletype asm
|
||||||
au BufReadPost *.go call s:gofiletype_post()
|
au BufRead,BufNewFile *.tmpl setfiletype gohtmltmpl
|
||||||
|
|
||||||
au BufNewFile *.s setfiletype asm | if &modifiable | setlocal fileencoding=utf-8 fileformat=unix | endif
|
|
||||||
au BufRead *.s call s:gofiletype_pre("asm")
|
|
||||||
au BufReadPost *.s call s:gofiletype_post()
|
|
||||||
|
|
||||||
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
|
|
||||||
|
|
||||||
" remove the autocommands for modsim3, and lprolog files so that their
|
" remove the autocommands for modsim3, and lprolog files so that their
|
||||||
" highlight groups, syntax, etc. will not be loaded. *.MOD is included, so
|
" highlight groups, syntax, etc. will not be loaded. *.MOD is included, so
|
||||||
" that on case insensitive file systems the module2 autocmds will not be
|
" that on case insensitive file systems the module2 autocmds will not be
|
||||||
" executed.
|
" executed.
|
||||||
au! BufNewFile,BufRead *.mod,*.MOD
|
au! BufRead,BufNewFile *.mod,*.MOD
|
||||||
" Set the filetype if the first non-comment and non-blank line starts with
|
" Set the filetype if the first non-comment and non-blank line starts with
|
||||||
" 'module <path>'.
|
" 'module <path>'.
|
||||||
au BufNewFile,BufRead go.mod call s:gomod()
|
au BufRead,BufNewFile go.mod call s:gomod()
|
||||||
|
|
||||||
fun! s:gomod()
|
fun! s:gomod()
|
||||||
for l:i in range(1, line('$'))
|
for l:i in range(1, line('$'))
|
||||||
@ -411,7 +394,7 @@ fun! s:gomod()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if l:l =~# '^module .\+'
|
if l:l =~# '^module .\+'
|
||||||
set filetype=gomod
|
setfiletype gomod
|
||||||
endif
|
endif
|
||||||
|
|
||||||
break
|
break
|
||||||
@ -663,9 +646,14 @@ endif
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" markdown, from markdown.vim in plasticboy/vim-markdown:_SYNTAX
|
" markdown, from markdown.vim in plasticboy/vim-markdown:_SYNTAX
|
||||||
|
if !has('patch-7.4.480')
|
||||||
|
" Before this patch, vim used modula2 for .md.
|
||||||
|
au! filetypedetect BufRead,BufNewFile *.md
|
||||||
|
endif
|
||||||
|
|
||||||
" markdown filetype file
|
" markdown filetype file
|
||||||
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown
|
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} setfiletype markdown
|
||||||
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set filetype=markdown
|
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} setfiletype markdown
|
||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1040,7 +1028,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
|||||||
" rust, from rust.vim in rust-lang/rust.vim
|
" rust, from rust.vim in rust-lang/rust.vim
|
||||||
" vint: -ProhibitAutocmdWithNoGroup
|
" vint: -ProhibitAutocmdWithNoGroup
|
||||||
|
|
||||||
autocmd BufRead,BufNewFile *.rs set filetype=rust
|
autocmd BufRead,BufNewFile *.rs setf rust
|
||||||
autocmd BufRead,BufNewFile Cargo.toml if &filetype == "" | set filetype=cfg | endif
|
autocmd BufRead,BufNewFile Cargo.toml if &filetype == "" | set filetype=cfg | endif
|
||||||
|
|
||||||
" vim: set et sw=4 sts=4 ts=8:
|
" vim: set et sw=4 sts=4 ts=8:
|
||||||
@ -1164,7 +1152,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
|
|||||||
augroup filetypedetect
|
augroup filetypedetect
|
||||||
" toml, from toml.vim in cespare/vim-toml
|
" toml, from toml.vim in cespare/vim-toml
|
||||||
" Go dep and Rust use several TOML config files that are not named with .toml.
|
" Go dep and Rust use several TOML config files that are not named with .toml.
|
||||||
autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config,*/.cargo/credentials,Pipfile set filetype=toml
|
autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config,*/.cargo/credentials,Pipfile setf toml
|
||||||
augroup end
|
augroup end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ let &l:path =
|
|||||||
\ &g:path
|
\ &g:path
|
||||||
\ ], ',')
|
\ ], ',')
|
||||||
setlocal includeexpr=elixir#util#get_filename(v:fname)
|
setlocal includeexpr=elixir#util#get_filename(v:fname)
|
||||||
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl
|
setlocal suffixesadd=.ex,.exs,.eex,.erl,.xrl,.yrl,.hrl
|
||||||
|
|
||||||
let &l:define = 'def\(macro\|guard\|delegate\)\=p\='
|
let &l:define = 'def\(macro\|guard\|delegate\)\=p\='
|
||||||
|
|
||||||
@ -49,9 +49,7 @@ onoremap <buffer> <silent> <expr> [[ ':silent keeppatterns ?'.b:block_begin.'<CR
|
|||||||
onoremap <buffer> <silent> <expr> ][ ':silent keeppatterns /'.b:block_end .'<CR>'
|
onoremap <buffer> <silent> <expr> ][ ':silent keeppatterns /'.b:block_end .'<CR>'
|
||||||
onoremap <buffer> <silent> <expr> [] ':silent keeppatterns ?'.b:block_end .'<CR>'
|
onoremap <buffer> <silent> <expr> [] ':silent keeppatterns ?'.b:block_end .'<CR>'
|
||||||
|
|
||||||
silent! setlocal formatoptions-=t formatoptions+=croqlj
|
let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< def< fo<'.
|
||||||
|
|
||||||
let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< def<'.
|
|
||||||
\ '| unlet! b:match_ignorecase b:match_words b:block_begin b:block_end'
|
\ '| unlet! b:match_ignorecase b:match_words b:block_begin b:block_end'
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@ -7,7 +7,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
|||||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if get(b:, 'did_ftplugin') =~# '\<eruby\>'
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -25,8 +25,6 @@ endif
|
|||||||
|
|
||||||
if &filetype =~ '^eruby\.'
|
if &filetype =~ '^eruby\.'
|
||||||
let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
|
let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
|
||||||
elseif &filetype =~ '^.*\.eruby\>'
|
|
||||||
let b:eruby_subtype = matchstr(&filetype,'^.\{-\}\ze\.eruby\>')
|
|
||||||
elseif !exists("b:eruby_subtype")
|
elseif !exists("b:eruby_subtype")
|
||||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
||||||
@ -49,14 +47,11 @@ elseif !exists("b:eruby_subtype")
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if &filetype =~# '^eruby\>'
|
if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby'
|
||||||
if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby'
|
exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim"
|
||||||
exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim"
|
else
|
||||||
else
|
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
||||||
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
let s:did_ftplugin = get(b:, 'did_ftplugin', 1)
|
|
||||||
unlet! b:did_ftplugin
|
unlet! b:did_ftplugin
|
||||||
|
|
||||||
" Override our defaults if these were set by an included ftplugin.
|
" Override our defaults if these were set by an included ftplugin.
|
||||||
@ -89,7 +84,7 @@ let s:path = &l:path
|
|||||||
let s:suffixesadd = &l:suffixesadd
|
let s:suffixesadd = &l:suffixesadd
|
||||||
|
|
||||||
runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
|
runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
|
||||||
let b:did_ftplugin = s:did_ftplugin . '.eruby'
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
" Combine the new set of values with those previously included.
|
" Combine the new set of values with those previously included.
|
||||||
if exists("b:undo_ftplugin")
|
if exists("b:undo_ftplugin")
|
||||||
|
@ -17,4 +17,6 @@ setlocal softtabstop=2
|
|||||||
setlocal shiftwidth=2
|
setlocal shiftwidth=2
|
||||||
setlocal expandtab
|
setlocal expandtab
|
||||||
|
|
||||||
|
let b:undo_ftplugin = 'setlocal com< cms< fo< isk< sts< sw< et<'
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
9
ftplugin/kotlin.vim
Normal file
9
ftplugin/kotlin.vim
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal comments=://
|
||||||
|
setlocal commentstring=//\ %s
|
||||||
|
|
||||||
|
endif
|
@ -5,7 +5,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rst') == -1
|
|||||||
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
|
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
|
||||||
" Original Maintainer: Nikolai Weibull <now@bitwi.se>
|
" Original Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||||
" Website: https://github.com/marshallward/vim-restructuredtext
|
" Website: https://github.com/marshallward/vim-restructuredtext
|
||||||
" Latest Revision: 2018-01-07
|
" Latest Revision: 2018-12-29
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@ -15,6 +15,11 @@ let b:did_ftplugin = 1
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
|
"Disable folding
|
||||||
|
if !exists('g:rst_fold_enabled')
|
||||||
|
let g:rst_fold_enabled = 0
|
||||||
|
endif
|
||||||
|
|
||||||
let b:undo_ftplugin = "setl com< cms< et< fo<"
|
let b:undo_ftplugin = "setl com< cms< et< fo<"
|
||||||
|
|
||||||
setlocal comments=fb:.. commentstring=..\ %s expandtab
|
setlocal comments=fb:.. commentstring=..\ %s expandtab
|
||||||
@ -27,7 +32,7 @@ setlocal formatoptions+=tcroql
|
|||||||
"
|
"
|
||||||
" More sophisticated indentation rules should be revisted in the future.
|
" More sophisticated indentation rules should be revisted in the future.
|
||||||
|
|
||||||
if !exists("g:rst_style") || g:rst_style != 0
|
if exists("g:rst_style") && g:rst_style != 0
|
||||||
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
|
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
|||||||
" Language: Ruby
|
" Language: Ruby
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" URL: https://github.com/vim-ruby/vim-ruby
|
" URL: https://github.com/vim-ruby/vim-ruby
|
||||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||||
" ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
finish
|
finish
|
||||||
@ -26,20 +25,20 @@ if exists("loaded_matchit") && !exists("b:match_words")
|
|||||||
let b:match_ignorecase = 0
|
let b:match_ignorecase = 0
|
||||||
|
|
||||||
let b:match_words =
|
let b:match_words =
|
||||||
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|begin\)\>=\@!' .
|
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|=\@<!begin\)\>=\@!' .
|
||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\%(^\|[^.\:@$]\)\@<=\<end\:\@!\>' .
|
\ '\%(^\|[^.\:@$=]\)\@<=\<end\:\@!\>' .
|
||||||
|
\ ',^=begin\>:^=end\>,' .
|
||||||
\ ',{:},\[:\],(:)'
|
\ ',{:},\[:\],(:)'
|
||||||
|
|
||||||
let b:match_skip =
|
let b:match_skip =
|
||||||
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
|
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
|
||||||
\ "\\<ruby\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" .
|
\ "\\<ruby\\%(String\\|.\+Delimiter\\|Character\\|.\+Escape\\|" .
|
||||||
\ "Regexp\\|RegexpDelimiter\\|" .
|
\ "Regexp\\|Interpolation\\|Comment\\|Documentation\\|" .
|
||||||
\ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" .
|
\ "ConditionalModifier\\|RepeatModifier\\|RescueModifier\\|OptionalDo\\|" .
|
||||||
\ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" .
|
\ "MethodName\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
|
||||||
\ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
|
|
||||||
\ "InstanceVariable\\|GlobalVariable\\|Symbol\\)\\>'"
|
\ "InstanceVariable\\|GlobalVariable\\|Symbol\\)\\>'"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -154,7 +153,7 @@ endif
|
|||||||
function! s:map(mode, flags, map) abort
|
function! s:map(mode, flags, map) abort
|
||||||
let from = matchstr(a:map, '\S\+')
|
let from = matchstr(a:map, '\S\+')
|
||||||
if empty(mapcheck(from, a:mode))
|
if empty(mapcheck(from, a:mode))
|
||||||
exe a:mode.'map' '<buffer>' a:map
|
exe a:mode.'map' '<buffer>' a:flags a:map
|
||||||
let b:undo_ftplugin .= '|sil! '.a:mode.'unmap <buffer> '.from
|
let b:undo_ftplugin .= '|sil! '.a:mode.'unmap <buffer> '.from
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
@ -313,13 +312,16 @@ function! s:synid() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:wrap_i(back,forward) abort
|
function! s:wrap_i(back,forward) abort
|
||||||
execute 'norm k'.a:forward
|
execute 'norm! k'
|
||||||
|
execute 'norm '.a:forward
|
||||||
let line = line('.')
|
let line = line('.')
|
||||||
execute 'norm '.a:back
|
execute 'norm '.a:back
|
||||||
if line('.') == line - 1
|
if line('.') == line - 1
|
||||||
return s:wrap_a(a:back,a:forward)
|
return s:wrap_a(a:back,a:forward)
|
||||||
endif
|
endif
|
||||||
execute 'norm jV'.a:forward.'k'
|
execute 'norm! jV'
|
||||||
|
execute 'norm '.a:forward
|
||||||
|
execute 'norm! k'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:wrap_a(back,forward) abort
|
function! s:wrap_a(back,forward) abort
|
||||||
@ -332,11 +334,15 @@ function! s:wrap_a(back,forward) abort
|
|||||||
-
|
-
|
||||||
endwhile
|
endwhile
|
||||||
if exists('after')
|
if exists('after')
|
||||||
execute 'norm V'.a:forward.'j'
|
execute 'norm! V'
|
||||||
|
execute 'norm '.a:forward
|
||||||
|
execute 'norm! j'
|
||||||
elseif line('.') > 1 && getline(line('.')-1) =~# '^\s*$'
|
elseif line('.') > 1 && getline(line('.')-1) =~# '^\s*$'
|
||||||
execute 'norm kV'.a:forward
|
execute 'norm! kV'
|
||||||
|
execute 'norm '.a:forward
|
||||||
else
|
else
|
||||||
execute 'norm V'.a:forward
|
execute 'norm! V'
|
||||||
|
execute 'norm '.a:forward
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ if get(g:, 'rust_recommended_style', 1)
|
|||||||
setlocal textwidth=99
|
setlocal textwidth=99
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" This includeexpr isn't perfect, but it's a good start
|
setlocal include=\\v^\\s*(pub\\s+)?use\\s+\\zs(\\f\|:)+
|
||||||
setlocal includeexpr=substitute(v:fname,'::','/','g')
|
setlocal includeexpr=rust#IncludeExpr(v:fname)
|
||||||
|
|
||||||
setlocal suffixesadd=.rs
|
setlocal suffixesadd=.rs
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ endif
|
|||||||
" Cleanup {{{1
|
" Cleanup {{{1
|
||||||
|
|
||||||
let b:undo_ftplugin = "
|
let b:undo_ftplugin = "
|
||||||
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
|
\ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd<
|
||||||
\|if exists('b:rust_set_style')
|
\|if exists('b:rust_set_style')
|
||||||
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
|
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
|
||||||
\|endif
|
\|endif
|
||||||
@ -188,7 +188,7 @@ let b:undo_ftplugin = "
|
|||||||
" Code formatting on save
|
" Code formatting on save
|
||||||
augroup rust.vim.PreWrite
|
augroup rust.vim.PreWrite
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWritePre <buffer> silent! call rustfmt#PreWrite()
|
autocmd BufWritePre *.rs silent! call rustfmt#PreWrite()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
setlocal matchpairs+=<:>
|
setlocal matchpairs+=<:>
|
||||||
|
@ -3,6 +3,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') ==
|
|||||||
" terraform.vim - basic vim/terraform integration
|
" terraform.vim - basic vim/terraform integration
|
||||||
" Maintainer: HashiVim <https://github.com/hashivim>
|
" Maintainer: HashiVim <https://github.com/hashivim>
|
||||||
|
|
||||||
|
set formatoptions-=t
|
||||||
|
|
||||||
if exists("g:loaded_terraform") || v:version < 700 || &cp || !executable('terraform')
|
if exists("g:loaded_terraform") || v:version < 700 || &cp || !executable('terraform')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
@ -44,7 +46,7 @@ endfunction
|
|||||||
" https://github.com/fatih/vim-hclfmt/blob/master/autoload/fmt.vim
|
" https://github.com/fatih/vim-hclfmt/blob/master/autoload/fmt.vim
|
||||||
function! terraform#fmt()
|
function! terraform#fmt()
|
||||||
let l:curw = winsaveview()
|
let l:curw = winsaveview()
|
||||||
let l:tmpfile = tempname()
|
let l:tmpfile = tempname() . ".tf"
|
||||||
call writefile(getline(1, "$"), l:tmpfile)
|
call writefile(getline(1, "$"), l:tmpfile)
|
||||||
let output = system("terraform fmt -write " . l:tmpfile)
|
let output = system("terraform fmt -write " . l:tmpfile)
|
||||||
if v:shell_error == 0
|
if v:shell_error == 0
|
||||||
|
@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
|
|||||||
" File: ftplugin/toml.vim
|
" File: ftplugin/toml.vim
|
||||||
" Author: Kevin Ballard <kevin@sb.org>
|
" Author: Kevin Ballard <kevin@sb.org>
|
||||||
" Description: FileType Plugin for Toml
|
" Description: FileType Plugin for Toml
|
||||||
" Last Change: Dec 09, 2014
|
" Last Change: Feb 12, 2019
|
||||||
|
|
||||||
if exists('b:did_ftplugin')
|
if exists('b:did_ftplugin')
|
||||||
finish
|
finish
|
||||||
@ -12,24 +12,10 @@ let b:did_ftplugin = 1
|
|||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
let b:undo_ftplugin = 'setlocal commentstring< comments<'
|
||||||
|
|
||||||
setlocal commentstring=#\ %s
|
setlocal commentstring=#\ %s
|
||||||
|
setlocal comments=:#
|
||||||
" Add NERDCommenter delimiters
|
|
||||||
|
|
||||||
let s:delims = { 'left': '#' }
|
|
||||||
if exists('g:NERDDelimiterMap')
|
|
||||||
if !has_key(g:NERDDelimiterMap, 'toml')
|
|
||||||
let g:NERDDelimiterMap.toml = s:delims
|
|
||||||
endif
|
|
||||||
elseif exists('g:NERDCustomDelimiters')
|
|
||||||
if !has_key(g:NERDCustomDelimiters, 'toml')
|
|
||||||
let g:NERDCustomDelimiters.toml = s:delims
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
let g:NERDCustomDelimiters = { 'toml': s:delims }
|
|
||||||
endif
|
|
||||||
unlet s:delims
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
@ -10,7 +10,7 @@ setlocal expandtab
|
|||||||
setlocal softtabstop=2
|
setlocal softtabstop=2
|
||||||
setlocal shiftwidth=2
|
setlocal shiftwidth=2
|
||||||
setlocal commentstring=#%s
|
setlocal commentstring=#%s
|
||||||
setlocal formatoptions=cl
|
setlocal formatoptions+=cl
|
||||||
" c -> wrap long comments, including #
|
" c -> wrap long comments, including #
|
||||||
" l -> do not wrap long lines
|
" l -> do not wrap long lines
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@ function! GetBladeIndent()
|
|||||||
let indent = indent(lnum)
|
let indent = indent(lnum)
|
||||||
|
|
||||||
" 1. Check for special directives
|
" 1. Check for special directives
|
||||||
" @section is a single-line directive if it has a second argument.
|
" @section and @slot are single-line if they have a second argument.
|
||||||
" @php is a single-line directive if it is followed by parentheses.
|
" @php is a single-line directive if it is followed by parentheses.
|
||||||
if (line =~# '@section\%(.*@end\)\@!' && line !~# '@section\s*([^,]*)')
|
if (line =~# '@\%(section\|slot\)\%(.*@end\)\@!' && line !~# '@\%(section\|slot\)\s*([^,]*)')
|
||||||
\ || line =~# '@php\s*('
|
\ || line =~# '@php\s*('
|
||||||
return indent
|
return indent
|
||||||
endif
|
endif
|
||||||
|
@ -49,8 +49,8 @@ let s:skip_expr =
|
|||||||
|
|
||||||
" Regex used for words that, at the start of a line, add a level of indent.
|
" Regex used for words that, at the start of a line, add a level of indent.
|
||||||
let s:crystal_indent_keywords =
|
let s:crystal_indent_keywords =
|
||||||
\ '^\s*\zs\<\%(module\|\%(abstract\)\=\s*\%(class\|struct\)\|enum\|if\|for\|macro' .
|
\ '^\s*\zs\<\%(module\|\%(private\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)\|enum\|if' .
|
||||||
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\|lib' .
|
\ '\|for\|macro\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\|lib' .
|
||||||
\ '\|\%(protected\|private\)\=\s*def\):\@!\>' .
|
\ '\|\%(protected\|private\)\=\s*def\):\@!\>' .
|
||||||
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
|
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
|
||||||
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .
|
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .
|
||||||
@ -66,7 +66,7 @@ let s:crystal_deindent_keywords =
|
|||||||
let s:end_start_regex =
|
let s:end_start_regex =
|
||||||
\ '{%\s*\<\%(if\|for\|while\|until\|unless\|begin\|lib\)\>\|' .
|
\ '{%\s*\<\%(if\|for\|while\|until\|unless\|begin\|lib\)\>\|' .
|
||||||
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
|
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
|
||||||
\ '\<\%(module\|\%(abstract\)\=\s*\%(class\|struct\)\|enum\|macro\|if\|for\|while\|until\|case\|unless\|begin\|lib' .
|
\ '\<\%(module\|\%(private\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)\|enum\|macro\|if\|for\|while\|until\|case\|unless\|begin\|lib' .
|
||||||
\ '\|\%(protected\|private\)\=\s*def\):\@!\>' .
|
\ '\|\%(protected\|private\)\=\s*def\):\@!\>' .
|
||||||
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
|
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
|||||||
" URL: https://github.com/vim-ruby/vim-ruby
|
" URL: https://github.com/vim-ruby/vim-ruby
|
||||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||||
|
|
||||||
if get(b:, 'did_indent') =~# '\<eruby\>'
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -14,14 +14,12 @@ runtime! indent/ruby.vim
|
|||||||
unlet! b:did_indent
|
unlet! b:did_indent
|
||||||
setlocal indentexpr=
|
setlocal indentexpr=
|
||||||
|
|
||||||
if &filetype =~# '^eruby\>'
|
if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=# 'eruby'
|
||||||
if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=# 'eruby'
|
exe "runtime! indent/".b:eruby_subtype.".vim"
|
||||||
exe "runtime! indent/".b:eruby_subtype.".vim"
|
else
|
||||||
else
|
runtime! indent/html.vim
|
||||||
runtime! indent/html.vim
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
let b:did_indent = get(b:, 'did_indent', 1) . '.eruby'
|
unlet! b:did_indent
|
||||||
|
|
||||||
" Force HTML indent to not keep state.
|
" Force HTML indent to not keep state.
|
||||||
let b:html_indent_usestate = 0
|
let b:html_indent_usestate = 0
|
||||||
@ -35,6 +33,8 @@ if &l:indentexpr == ''
|
|||||||
endif
|
endif
|
||||||
let b:eruby_subtype_indentexpr = &l:indentexpr
|
let b:eruby_subtype_indentexpr = &l:indentexpr
|
||||||
|
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
setlocal indentexpr=GetErubyIndent()
|
setlocal indentexpr=GetErubyIndent()
|
||||||
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when
|
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ setlocal nolisp
|
|||||||
setlocal nosmartindent
|
setlocal nosmartindent
|
||||||
|
|
||||||
setlocal indentexpr=GetGraphQLIndent()
|
setlocal indentexpr=GetGraphQLIndent()
|
||||||
setlocal indentkeys=0{,0},0),0[,0],0#,!^F,o,O,e
|
setlocal indentkeys=0{,0},0),0[,0],0#,!^F,o,O
|
||||||
|
|
||||||
" If our indentation function already exists, we have nothing more to do.
|
" If our indentation function already exists, we have nothing more to do.
|
||||||
if exists('*GetGraphQLIndent')
|
if exists('*GetGraphQLIndent')
|
||||||
|
@ -2,7 +2,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
|||||||
|
|
||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Ruby
|
" Language: Ruby
|
||||||
" Maintainer: Nikolai Weibull <now at bitwi.se>
|
" Maintainer: Andrew Radev <andrey.radev@gmail.com>
|
||||||
|
" Previous Maintainer: Nikolai Weibull <now at bitwi.se>
|
||||||
" URL: https://github.com/vim-ruby/vim-ruby
|
" URL: https://github.com/vim-ruby/vim-ruby
|
||||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||||
|
|
||||||
@ -51,15 +52,26 @@ set cpo&vim
|
|||||||
|
|
||||||
" Syntax group names that are strings.
|
" Syntax group names that are strings.
|
||||||
let s:syng_string =
|
let s:syng_string =
|
||||||
\ ['String', 'Interpolation', 'InterpolationDelimiter', 'NoInterpolation', 'StringEscape']
|
\ ['String', 'Interpolation', 'InterpolationDelimiter', 'StringEscape']
|
||||||
|
|
||||||
" Syntax group names that are strings or documentation.
|
" Syntax group names that are strings or documentation.
|
||||||
let s:syng_stringdoc = s:syng_string + ['Documentation']
|
let s:syng_stringdoc = s:syng_string + ['Documentation']
|
||||||
|
|
||||||
" Syntax group names that are or delimit strings/symbols/regexes or are comments.
|
" Syntax group names that are or delimit strings/symbols/regexes or are comments.
|
||||||
let s:syng_strcom = s:syng_stringdoc +
|
let s:syng_strcom = s:syng_stringdoc + [
|
||||||
\ ['Regexp', 'RegexpDelimiter', 'RegexpEscape',
|
\ 'Character',
|
||||||
\ 'Symbol', 'StringDelimiter', 'ASCIICode', 'Comment']
|
\ 'Comment',
|
||||||
|
\ 'HeredocDelimiter',
|
||||||
|
\ 'PercentRegexpDelimiter',
|
||||||
|
\ 'PercentStringDelimiter',
|
||||||
|
\ 'PercentSymbolDelimiter',
|
||||||
|
\ 'Regexp',
|
||||||
|
\ 'RegexpDelimiter',
|
||||||
|
\ 'RegexpEscape',
|
||||||
|
\ 'StringDelimiter',
|
||||||
|
\ 'Symbol',
|
||||||
|
\ 'SymbolDelimiter',
|
||||||
|
\ ]
|
||||||
|
|
||||||
" Expression used to check whether we should skip a match with searchpair().
|
" Expression used to check whether we should skip a match with searchpair().
|
||||||
let s:skip_expr =
|
let s:skip_expr =
|
||||||
@ -69,7 +81,7 @@ let s:skip_expr =
|
|||||||
let s:ruby_indent_keywords =
|
let s:ruby_indent_keywords =
|
||||||
\ '^\s*\zs\<\%(module\|class\|if\|for' .
|
\ '^\s*\zs\<\%(module\|class\|if\|for' .
|
||||||
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue' .
|
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue' .
|
||||||
\ '\|\%(\K\k*[!?]\?\)\=\s*def\):\@!\>' .
|
\ '\|\%(\K\k*[!?]\?\s\+\)\=def\):\@!\>' .
|
||||||
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
|
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
|
||||||
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
|
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
|
||||||
|
|
||||||
@ -83,7 +95,7 @@ let s:ruby_deindent_keywords =
|
|||||||
let s:end_start_regex =
|
let s:end_start_regex =
|
||||||
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
|
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
|
||||||
\ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' .
|
\ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' .
|
||||||
\ '\|\%(\K\k*[!?]\?\)\=\s*def\):\@!\>' .
|
\ '\|\%(\K\k*[!?]\?\s\+\)\=def\):\@!\>' .
|
||||||
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
|
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
|
||||||
|
|
||||||
" Regex that defines the middle-match for the 'end' keyword.
|
" Regex that defines the middle-match for the 'end' keyword.
|
||||||
@ -146,7 +158,7 @@ let s:block_regex =
|
|||||||
let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex
|
let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex
|
||||||
|
|
||||||
" Regex that describes a leading operator (only a method call's dot for now)
|
" Regex that describes a leading operator (only a method call's dot for now)
|
||||||
let s:leading_operator_regex = '^\s*[.]'
|
let s:leading_operator_regex = '^\s*\%(&\=\.\)'
|
||||||
|
|
||||||
" 2. GetRubyIndent Function {{{1
|
" 2. GetRubyIndent Function {{{1
|
||||||
" =========================
|
" =========================
|
||||||
@ -695,7 +707,10 @@ endfunction
|
|||||||
|
|
||||||
" Check if the character at lnum:col is inside a string delimiter
|
" Check if the character at lnum:col is inside a string delimiter
|
||||||
function! s:IsInStringDelimiter(lnum, col) abort
|
function! s:IsInStringDelimiter(lnum, col) abort
|
||||||
return s:IsInRubyGroup(['StringDelimiter'], a:lnum, a:col)
|
return s:IsInRubyGroup(
|
||||||
|
\ ['HeredocDelimiter', 'PercentStringDelimiter', 'StringDelimiter'],
|
||||||
|
\ a:lnum, a:col
|
||||||
|
\ )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:IsAssignment(str, pos) abort
|
function! s:IsAssignment(str, pos) abort
|
||||||
|
@ -83,6 +83,12 @@ syn match crystalFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+
|
|||||||
syn match crystalLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
|
syn match crystalLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
|
||||||
syn match crystalBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent
|
syn match crystalBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent
|
||||||
|
|
||||||
|
syn match crystalTypeName "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
|
syn match crystalClassName "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
|
syn match crystalModuleName "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
|
syn match crystalStructName "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
|
syn match crystalLibName "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
|
syn match crystalEnumName "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
syn match crystalConstant "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@="
|
syn match crystalConstant "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@="
|
||||||
syn match crystalClassVariable "@@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
syn match crystalClassVariable "@@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
||||||
syn match crystalInstanceVariable "@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
syn match crystalInstanceVariable "@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
||||||
@ -176,15 +182,15 @@ end
|
|||||||
|
|
||||||
syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
|
syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
|
||||||
syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
|
syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
|
||||||
syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
|
syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalFunction,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
|
||||||
syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalConstant
|
syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalFunction
|
||||||
syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalConstant
|
syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalTypeName
|
||||||
syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
|
syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalClassName,crystalOperator
|
||||||
syn match crystalModuleDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
|
syn match crystalModuleDeclaration "[^[:space:];#]\+" contained contains=crystalModuleName,crystalOperator
|
||||||
syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
|
syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalStructName,crystalOperator
|
||||||
syn match crystalLibDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
|
syn match crystalLibDeclaration "[^[:space:];#]\+" contained contains=crystalLibName,crystalOperator
|
||||||
syn match crystalMacroDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant,crystalOperator
|
syn match crystalMacroDeclaration "[^[:space:];#(]\+" contained contains=crystalFunction
|
||||||
syn match crystalEnumDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant
|
syn match crystalEnumDeclaration "[^[:space:];#<\"]\+" contained contains=crystalEnumName
|
||||||
syn match crystalFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=crystalMethodDeclaration,crystalFunctionDeclaration
|
syn match crystalFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=crystalMethodDeclaration,crystalFunctionDeclaration
|
||||||
syn match crystalFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2
|
syn match crystalFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2
|
||||||
syn match crystalFunction "\%([[:space:].]\|^\)\@<=\%(\[\][=?]\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration
|
syn match crystalFunction "\%([[:space:].]\|^\)\@<=\%(\[\][=?]\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration
|
||||||
@ -345,6 +351,12 @@ else
|
|||||||
endif
|
endif
|
||||||
hi def link crystalClassVariable crystalIdentifier
|
hi def link crystalClassVariable crystalIdentifier
|
||||||
hi def link crystalConstant Type
|
hi def link crystalConstant Type
|
||||||
|
hi def link crystalTypeName crystalConstant
|
||||||
|
hi def link crystalClassName crystalConstant
|
||||||
|
hi def link crystalModuleName crystalConstant
|
||||||
|
hi def link crystalStructName crystalConstant
|
||||||
|
hi def link crystalLibName crystalConstant
|
||||||
|
hi def link crystalEnumName crystalConstant
|
||||||
hi def link crystalGlobalVariable crystalIdentifier
|
hi def link crystalGlobalVariable crystalIdentifier
|
||||||
hi def link crystalBlockParameter crystalIdentifier
|
hi def link crystalBlockParameter crystalIdentifier
|
||||||
hi def link crystalInstanceVariable crystalIdentifier
|
hi def link crystalInstanceVariable crystalIdentifier
|
||||||
|
@ -28,14 +28,15 @@ syntax keyword dartConstant null
|
|||||||
syntax keyword dartTypedef this super class typedef enum mixin
|
syntax keyword dartTypedef this super class typedef enum mixin
|
||||||
syntax keyword dartOperator new is as in
|
syntax keyword dartOperator new is as in
|
||||||
syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
|
syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
|
||||||
syntax keyword dartType void var bool int double num dynamic covariant
|
syntax keyword dartType void var bool int double num dynamic
|
||||||
syntax keyword dartStatement return
|
syntax keyword dartStatement return
|
||||||
syntax keyword dartStorageClass static abstract final const factory
|
syntax keyword dartStorageClass static abstract final const factory
|
||||||
syntax keyword dartExceptions throw rethrow try on catch finally
|
syntax keyword dartExceptions throw rethrow try on catch finally
|
||||||
syntax keyword dartAssert assert
|
syntax keyword dartAssert assert
|
||||||
syntax keyword dartClassDecl extends with implements
|
syntax keyword dartClassDecl extends with implements
|
||||||
syntax keyword dartBranch break continue nextgroup=dartUserLabelRef skipwhite
|
syntax keyword dartBranch break continue nextgroup=dartUserLabelRef skipwhite
|
||||||
syntax keyword dartKeyword get set operator call external async await yield sync native
|
syntax keyword dartKeyword get set operator call external async await
|
||||||
|
\ yield sync native covariant
|
||||||
syntax match dartUserLabelRef "\k\+" contained
|
syntax match dartUserLabelRef "\k\+" contained
|
||||||
|
|
||||||
syntax region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":"
|
syntax region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":"
|
||||||
|
@ -13,7 +13,7 @@ syn sync minlines=2000
|
|||||||
syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@elixirDeclaration,elixirTodo,elixirArguments,elixirBlockDefinition,elixirUnusedVariable,elixirStructDelimiter
|
syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@elixirDeclaration,elixirTodo,elixirArguments,elixirBlockDefinition,elixirUnusedVariable,elixirStructDelimiter
|
||||||
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
|
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
|
||||||
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
|
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
|
||||||
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration
|
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirPrivateFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirPrivateRecordDeclaration,elixirMacroDeclaration,elixirPrivateMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration
|
||||||
|
|
||||||
syn match elixirComment '#.*' contains=elixirTodo,@Spell
|
syn match elixirComment '#.*' contains=elixirTodo,@Spell
|
||||||
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
||||||
@ -84,7 +84,6 @@ syn match elixirAtomInterpolated ':\("\)\@=' contains=elixirString
|
|||||||
syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)"
|
syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)"
|
||||||
|
|
||||||
syn region elixirBlock matchgroup=elixirBlockDefinition start="\<do\>:\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
|
syn region elixirBlock matchgroup=elixirBlockDefinition start="\<do\>:\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
|
||||||
syn region elixirElseBlock matchgroup=elixirBlockDefinition start="\<else\>:\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
|
|
||||||
syn region elixirAnonymousFunction matchgroup=elixirBlockDefinition start="\<fn\>" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
|
syn region elixirAnonymousFunction matchgroup=elixirBlockDefinition start="\<fn\>" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
|
||||||
|
|
||||||
syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirStringDelimiter,elixirRegexDelimiter,elixirInterpolationDelimiter,elixirSigil,elixirAnonymousFunction,elixirComment
|
syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirStringDelimiter,elixirRegexDelimiter,elixirInterpolationDelimiter,elixirSigil,elixirAnonymousFunction,elixirComment
|
||||||
@ -120,102 +119,110 @@ else
|
|||||||
syn region elixirDocTest start="^\s*\%(iex\|\.\.\.\)\%((\d*)\)\?>\s" end="^\s*$" contained
|
syn region elixirDocTest start="^\s*\%(iex\|\.\.\.\)\%((\d*)\)\?>\s" end="^\s*$" contained
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]{" end="}" skip="\\\\\|\\}" contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]{" end="}" skip="\\\\\|\\}" contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]<" end=">" skip="\\\\\|\\>" contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]<" end=">" skip="\\\\\|\\>" contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\[" end="\]" skip="\\\\\|\\\]" contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\[" end="\]" skip="\\\\\|\\\]" contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss](" end=")" skip="\\\\\|\\)" contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss](" end=")" skip="\\\\\|\\)" contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirDocStringContained keepend
|
syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirDocStringContained keepend
|
||||||
syn region elixirDocString matchgroup=elixirStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("""\)+ end=+\z1+ contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("""\)+ end=+\z1+ contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z('''\)+ end=+\z1+ skip=+\\'+ contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z('''\)+ end=+\z1+ skip=+\\'+ contains=@elixirDocStringContained fold keepend
|
||||||
syn region elixirDocString matchgroup=elixirSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z("""\)+ end=+\z1+ skip=+\\"+ contains=@elixirDocStringContained fold keepend
|
syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z("""\)+ end=+\z1+ skip=+\\"+ contains=@elixirDocStringContained fold keepend
|
||||||
|
|
||||||
" Defines
|
" Defines
|
||||||
syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||||
syn match elixirPrivateDefine '\<defp\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
syn match elixirPrivateDefine '\<defp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
|
||||||
syn match elixirGuard '\<defguard\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
syn match elixirGuard '\<defguard\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||||
syn match elixirPrivateGuard '\<defguardp\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
syn match elixirPrivateGuard '\<defguardp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
|
||||||
syn match elixirModuleDefine '\<defmodule\>\(:\)\@!' nextgroup=elixirModuleDeclaration skipwhite skipnl
|
syn match elixirModuleDefine '\<defmodule\>\(:\)\@!' nextgroup=elixirModuleDeclaration skipwhite skipnl
|
||||||
syn match elixirProtocolDefine '\<defprotocol\>\(:\)\@!' nextgroup=elixirProtocolDeclaration skipwhite skipnl
|
syn match elixirProtocolDefine '\<defprotocol\>\(:\)\@!' nextgroup=elixirProtocolDeclaration skipwhite skipnl
|
||||||
syn match elixirImplDefine '\<defimpl\>\(:\)\@!' nextgroup=elixirImplDeclaration skipwhite skipnl
|
syn match elixirImplDefine '\<defimpl\>\(:\)\@!' nextgroup=elixirImplDeclaration skipwhite skipnl
|
||||||
syn match elixirRecordDefine '\<defrecord\>\(:\)\@!' nextgroup=elixirRecordDeclaration skipwhite skipnl
|
syn match elixirRecordDefine '\<defrecord\>\(:\)\@!' nextgroup=elixirRecordDeclaration skipwhite skipnl
|
||||||
syn match elixirPrivateRecordDefine '\<defrecordp\>\(:\)\@!' nextgroup=elixirRecordDeclaration skipwhite skipnl
|
syn match elixirPrivateRecordDefine '\<defrecordp\>\(:\)\@!' nextgroup=elixirPrivateRecordDeclaration skipwhite skipnl
|
||||||
syn match elixirMacroDefine '\<defmacro\>\(:\)\@!' nextgroup=elixirMacroDeclaration skipwhite skipnl
|
syn match elixirMacroDefine '\<defmacro\>\(:\)\@!' nextgroup=elixirMacroDeclaration skipwhite skipnl
|
||||||
syn match elixirPrivateMacroDefine '\<defmacrop\>\(:\)\@!' nextgroup=elixirMacroDeclaration skipwhite skipnl
|
syn match elixirPrivateMacroDefine '\<defmacrop\>\(:\)\@!' nextgroup=elixirPrivateMacroDeclaration skipwhite skipnl
|
||||||
syn match elixirDelegateDefine '\<defdelegate\>\(:\)\@!' nextgroup=elixirDelegateDeclaration skipwhite skipnl
|
syn match elixirDelegateDefine '\<defdelegate\>\(:\)\@!' nextgroup=elixirDelegateDeclaration skipwhite skipnl
|
||||||
syn match elixirOverridableDefine '\<defoverridable\>\(:\)\@!' nextgroup=elixirOverridableDeclaration skipwhite skipnl
|
syn match elixirOverridableDefine '\<defoverridable\>\(:\)\@!' nextgroup=elixirOverridableDeclaration skipwhite skipnl
|
||||||
syn match elixirExceptionDefine '\<defexception\>\(:\)\@!' nextgroup=elixirExceptionDeclaration skipwhite skipnl
|
syn match elixirExceptionDefine '\<defexception\>\(:\)\@!' nextgroup=elixirExceptionDeclaration skipwhite skipnl
|
||||||
syn match elixirCallbackDefine '\<defcallback\>\(:\)\@!' nextgroup=elixirCallbackDeclaration skipwhite skipnl
|
syn match elixirCallbackDefine '\<defcallback\>\(:\)\@!' nextgroup=elixirCallbackDeclaration skipwhite skipnl
|
||||||
syn match elixirStructDefine '\<defstruct\>\(:\)\@!' skipwhite skipnl
|
syn match elixirStructDefine '\<defstruct\>\(:\)\@!' skipwhite skipnl
|
||||||
|
|
||||||
" Declarations
|
" Declarations
|
||||||
syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained nextgroup=elixirBlock skipwhite skipnl
|
syn match elixirModuleDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirBlock skipwhite skipnl
|
||||||
syn match elixirFunctionDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirArguments skipwhite skipnl
|
syn match elixirFunctionDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirArguments skipwhite skipnl
|
||||||
syn match elixirProtocolDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
syn match elixirPrivateFunctionDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirArguments skipwhite skipnl
|
||||||
syn match elixirImplDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
syn match elixirProtocolDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
||||||
syn match elixirRecordDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias,elixirAtom skipwhite skipnl
|
syn match elixirImplDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
||||||
syn match elixirMacroDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirArguments skipwhite skipnl
|
syn match elixirRecordDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias,elixirAtom skipwhite skipnl
|
||||||
syn match elixirDelegateDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
|
syn match elixirPrivateRecordDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias,elixirAtom skipwhite skipnl
|
||||||
syn region elixirDelegateDeclaration start='\[' end='\]' contained contains=elixirFunctionDeclaration skipwhite skipnl
|
syn match elixirMacroDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirArguments skipwhite skipnl
|
||||||
syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias,elixirAtom skipwhite skipnl
|
syn match elixirPrivateMacroDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirArguments skipwhite skipnl
|
||||||
syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias,elixirAtom skipwhite skipnl
|
syn match elixirDelegateDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
|
||||||
syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
|
syn region elixirDelegateDeclaration start='\[' end='\]' contained contains=elixirFunctionDeclaration skipwhite skipnl
|
||||||
|
syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias,elixirAtom skipwhite skipnl
|
||||||
|
syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias,elixirAtom skipwhite skipnl
|
||||||
|
syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
|
||||||
|
|
||||||
" ExUnit
|
" ExUnit
|
||||||
syn match elixirExUnitMacro "\(^\s*\)\@<=\<\(test\|describe\|setup\|setup_all\|on_exit\|doctest\)\>"
|
syn match elixirExUnitMacro "\(^\s*\)\@<=\<\(test\|describe\|setup\|setup_all\|on_exit\|doctest\)\>"
|
||||||
syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(assert\|assert_in_delta\|assert_raise\|assert_receive\|assert_received\|catch_error\)\>"
|
syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(assert\|assert_in_delta\|assert_raise\|assert_receive\|assert_received\|catch_error\)\>"
|
||||||
syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(catch_exit\|catch_throw\|flunk\|refute\|refute_in_delta\|refute_receive\|refute_received\)\>"
|
syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(catch_exit\|catch_throw\|flunk\|refute\|refute_in_delta\|refute_receive\|refute_received\)\>"
|
||||||
|
|
||||||
hi def link elixirBlockDefinition Define
|
hi def link elixirBlockDefinition Define
|
||||||
hi def link elixirDefine Define
|
hi def link elixirDefine Define
|
||||||
hi def link elixirPrivateDefine Define
|
hi def link elixirPrivateDefine Define
|
||||||
hi def link elixirGuard Define
|
hi def link elixirGuard Define
|
||||||
hi def link elixirPrivateGuard Define
|
hi def link elixirPrivateGuard Define
|
||||||
hi def link elixirModuleDefine Define
|
hi def link elixirModuleDefine Define
|
||||||
hi def link elixirProtocolDefine Define
|
hi def link elixirProtocolDefine Define
|
||||||
hi def link elixirImplDefine Define
|
hi def link elixirImplDefine Define
|
||||||
hi def link elixirRecordDefine Define
|
hi def link elixirRecordDefine Define
|
||||||
hi def link elixirPrivateRecordDefine Define
|
hi def link elixirPrivateRecordDefine Define
|
||||||
hi def link elixirMacroDefine Define
|
hi def link elixirMacroDefine Define
|
||||||
hi def link elixirPrivateMacroDefine Define
|
hi def link elixirPrivateMacroDefine Define
|
||||||
hi def link elixirDelegateDefine Define
|
hi def link elixirDelegateDefine Define
|
||||||
hi def link elixirOverridableDefine Define
|
hi def link elixirOverridableDefine Define
|
||||||
hi def link elixirExceptionDefine Define
|
hi def link elixirExceptionDefine Define
|
||||||
hi def link elixirCallbackDefine Define
|
hi def link elixirCallbackDefine Define
|
||||||
hi def link elixirStructDefine Define
|
hi def link elixirStructDefine Define
|
||||||
hi def link elixirExUnitMacro Define
|
hi def link elixirExUnitMacro Define
|
||||||
hi def link elixirModuleDeclaration Type
|
hi def link elixirModuleDeclaration Type
|
||||||
hi def link elixirFunctionDeclaration Function
|
hi def link elixirPrivateFunctionDeclaration elixirFunctionDeclaration
|
||||||
hi def link elixirMacroDeclaration Macro
|
hi def link elixirFunctionDeclaration Function
|
||||||
hi def link elixirInclude Include
|
hi def link elixirPrivateMacroDeclaration elixirMacroDeclaration
|
||||||
hi def link elixirComment Comment
|
hi def link elixirMacroDeclaration Macro
|
||||||
hi def link elixirTodo Todo
|
hi def link elixirInclude Include
|
||||||
hi def link elixirKeyword Define
|
hi def link elixirComment Comment
|
||||||
hi def link elixirExUnitAssert Keyword
|
hi def link elixirTodo Todo
|
||||||
hi def link elixirOperator Operator
|
hi def link elixirKeyword Define
|
||||||
hi def link elixirAtom Constant
|
hi def link elixirExUnitAssert Keyword
|
||||||
hi def link elixirPseudoVariable Constant
|
hi def link elixirOperator Operator
|
||||||
hi def link elixirAlias Type
|
hi def link elixirAtom Constant
|
||||||
hi def link elixirBoolean Boolean
|
hi def link elixirPseudoVariable Constant
|
||||||
hi def link elixirVariable Identifier
|
hi def link elixirAlias Type
|
||||||
hi def link elixirSelf Identifier
|
hi def link elixirBoolean Boolean
|
||||||
hi def link elixirUnusedVariable Comment
|
hi def link elixirVariable Identifier
|
||||||
hi def link elixirNumber Number
|
hi def link elixirSelf Identifier
|
||||||
hi def link elixirDocString Comment
|
hi def link elixirUnusedVariable Comment
|
||||||
hi def link elixirDocTest elixirKeyword
|
hi def link elixirNumber Number
|
||||||
hi def link elixirAtomInterpolated elixirAtom
|
hi def link elixirDocString Comment
|
||||||
hi def link elixirRegex elixirString
|
hi def link elixirDocTest elixirKeyword
|
||||||
hi def link elixirRegexEscape elixirSpecial
|
hi def link elixirAtomInterpolated elixirAtom
|
||||||
hi def link elixirRegexEscapePunctuation elixirSpecial
|
hi def link elixirRegex elixirString
|
||||||
hi def link elixirRegexCharClass elixirSpecial
|
hi def link elixirRegexEscape elixirSpecial
|
||||||
hi def link elixirRegexQuantifier elixirSpecial
|
hi def link elixirRegexEscapePunctuation elixirSpecial
|
||||||
hi def link elixirSpecial Special
|
hi def link elixirRegexCharClass elixirSpecial
|
||||||
hi def link elixirString String
|
hi def link elixirRegexQuantifier elixirSpecial
|
||||||
hi def link elixirSigil String
|
hi def link elixirSpecial Special
|
||||||
hi def link elixirStringDelimiter Delimiter
|
hi def link elixirString String
|
||||||
hi def link elixirRegexDelimiter Delimiter
|
hi def link elixirSigil String
|
||||||
hi def link elixirInterpolationDelimiter Delimiter
|
hi def link elixirDocStringDelimiter elixirStringDelimiter
|
||||||
hi def link elixirSigilDelimiter Delimiter
|
hi def link elixirDocSigilDelimiter elixirSigilDelimiter
|
||||||
|
hi def link elixirStringDelimiter Delimiter
|
||||||
|
hi def link elixirRegexDelimiter Delimiter
|
||||||
|
hi def link elixirInterpolationDelimiter Delimiter
|
||||||
|
hi def link elixirSigilDelimiter Delimiter
|
||||||
|
hi def link elixirPrivateRecordDeclaration elixirRecordDeclaration
|
||||||
|
|
||||||
let b:current_syntax = "elixir"
|
let b:current_syntax = "elixir"
|
||||||
|
|
||||||
|
@ -20,8 +20,9 @@ syn match gitrebaseEdit "\v^e%(dit)=>" nextgroup=gitrebaseCommit skipwhite
|
|||||||
syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite
|
syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite
|
||||||
syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite
|
syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite
|
||||||
syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite
|
syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite
|
||||||
syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite
|
|
||||||
syn match gitrebaseBreak "\v^b%(reak)=>" nextgroup=gitrebaseCommit skipwhite
|
syn match gitrebaseBreak "\v^b%(reak)=>" nextgroup=gitrebaseCommit skipwhite
|
||||||
|
syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite
|
||||||
|
syn match gitrebaseNoop "\v^noop>"
|
||||||
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
|
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
|
||||||
syn match gitrebaseCommand ".*" contained
|
syn match gitrebaseCommand ".*" contained
|
||||||
syn match gitrebaseComment "^\s*#.*" contains=gitrebaseHash
|
syn match gitrebaseComment "^\s*#.*" contains=gitrebaseHash
|
||||||
@ -35,8 +36,9 @@ hi def link gitrebaseEdit PreProc
|
|||||||
hi def link gitrebaseSquash Type
|
hi def link gitrebaseSquash Type
|
||||||
hi def link gitrebaseFixup Special
|
hi def link gitrebaseFixup Special
|
||||||
hi def link gitrebaseExec Function
|
hi def link gitrebaseExec Function
|
||||||
hi def link gitrebaseDrop Comment
|
|
||||||
hi def link gitrebaseBreak Macro
|
hi def link gitrebaseBreak Macro
|
||||||
|
hi def link gitrebaseDrop Comment
|
||||||
|
hi def link gitrebaseNoop Comment
|
||||||
hi def link gitrebaseSummary String
|
hi def link gitrebaseSummary String
|
||||||
hi def link gitrebaseComment Comment
|
hi def link gitrebaseComment Comment
|
||||||
hi def link gitrebaseSquashError Error
|
hi def link gitrebaseSquashError Error
|
||||||
|
@ -74,7 +74,7 @@ hi def link goComment Comment
|
|||||||
hi def link goTodo Todo
|
hi def link goTodo Todo
|
||||||
|
|
||||||
if go#config#HighlightGenerateTags()
|
if go#config#HighlightGenerateTags()
|
||||||
syn match goGenerateVariables contained /\(\$GOARCH\|\$GOOS\|\$GOFILE\|\$GOLINE\|\$GOPACKAGE\|\$DOLLAR\)\>/
|
syn match goGenerateVariables contained /\%(\$GOARCH\|\$GOOS\|\$GOFILE\|\$GOLINE\|\$GOPACKAGE\|\$DOLLAR\)\>/
|
||||||
syn region goGenerate start="^\s*//go:generate" end="$" contains=goGenerateVariables
|
syn region goGenerate start="^\s*//go:generate" end="$" contains=goGenerateVariables
|
||||||
hi def link goGenerate PreProc
|
hi def link goGenerate PreProc
|
||||||
hi def link goGenerateVariables Special
|
hi def link goGenerateVariables Special
|
||||||
@ -115,7 +115,7 @@ if go#config#HighlightFormatStrings()
|
|||||||
" 5. Match [n] or nothing before a verb
|
" 5. Match [n] or nothing before a verb
|
||||||
" 6. Match a formatting verb
|
" 6. Match a formatting verb
|
||||||
syn match goFormatSpecifier /\
|
syn match goFormatSpecifier /\
|
||||||
\([^%]\(%%\)*\)\
|
\%([^%]\%(%%\)*\)\
|
||||||
\@<=%[-#0 +]*\
|
\@<=%[-#0 +]*\
|
||||||
\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\
|
\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\
|
||||||
\%(\.\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\)\=\
|
\%(\.\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\)\=\
|
||||||
@ -150,18 +150,18 @@ endif
|
|||||||
" var, const
|
" var, const
|
||||||
if go#config#FoldEnable('varconst')
|
if go#config#FoldEnable('varconst')
|
||||||
syn region goVar start='var (' end='^\s*)$' transparent fold
|
syn region goVar start='var (' end='^\s*)$' transparent fold
|
||||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator
|
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||||
syn region goConst start='const (' end='^\s*)$' transparent fold
|
syn region goConst start='const (' end='^\s*)$' transparent fold
|
||||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator
|
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||||
else
|
else
|
||||||
syn region goVar start='var (' end='^\s*)$' transparent
|
syn region goVar start='var (' end='^\s*)$' transparent
|
||||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator
|
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||||
syn region goConst start='const (' end='^\s*)$' transparent
|
syn region goConst start='const (' end='^\s*)$' transparent
|
||||||
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator
|
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goParamName,goParamType,goSimpleParams,goPointerOperator
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Single-line var, const, and import.
|
" Single-line var, const, and import.
|
||||||
syn match goSingleDecl /\(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
|
syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
|
||||||
|
|
||||||
" Integers
|
" Integers
|
||||||
syn match goDecimalInt "\<-\=\d\+\%([Ee][-+]\=\d\+\)\=\>"
|
syn match goDecimalInt "\<-\=\d\+\%([Ee][-+]\=\d\+\)\=\>"
|
||||||
@ -192,7 +192,7 @@ hi def link goImaginaryFloat Float
|
|||||||
|
|
||||||
" Spaces after "[]"
|
" Spaces after "[]"
|
||||||
if go#config#HighlightArrayWhitespaceError()
|
if go#config#HighlightArrayWhitespaceError()
|
||||||
syn match goSpaceError display "\(\[\]\)\@<=\s\+"
|
syn match goSpaceError display "\%(\[\]\)\@<=\s\+"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Spacing errors around the 'chan' keyword
|
" Spacing errors around the 'chan' keyword
|
||||||
@ -201,24 +201,24 @@ if go#config#HighlightChanWhitespaceError()
|
|||||||
"
|
"
|
||||||
" \(\<chan\>\)\@<!<- (only pick arrow when it doesn't come after a chan)
|
" \(\<chan\>\)\@<!<- (only pick arrow when it doesn't come after a chan)
|
||||||
" this prevents picking up 'chan<- chan<-' but not '<- chan'
|
" this prevents picking up 'chan<- chan<-' but not '<- chan'
|
||||||
syn match goSpaceError display "\(\(\<chan\>\)\@<!<-\)\@<=\s\+\(\<chan\>\)\@="
|
syn match goSpaceError display "\%(\%(\<chan\>\)\@<!<-\)\@<=\s\+\%(\<chan\>\)\@="
|
||||||
|
|
||||||
" send-only annotation on chan type
|
" send-only annotation on chan type
|
||||||
"
|
"
|
||||||
" \(<-\)\@<!\<chan\> (only pick chan when it doesn't come after an arrow)
|
" \(<-\)\@<!\<chan\> (only pick chan when it doesn't come after an arrow)
|
||||||
" this prevents picking up '<-chan <-chan' but not 'chan <-'
|
" this prevents picking up '<-chan <-chan' but not 'chan <-'
|
||||||
syn match goSpaceError display "\(\(<-\)\@<!\<chan\>\)\@<=\s\+\(<-\)\@="
|
syn match goSpaceError display "\%(\%(<-\)\@<!\<chan\>\)\@<=\s\+\%(<-\)\@="
|
||||||
|
|
||||||
" value-ignoring receives in a few contexts
|
" value-ignoring receives in a few contexts
|
||||||
syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
|
syn match goSpaceError display "\%(\%(^\|[={(,;]\)\s*<-\)\@<=\s\+"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Extra types commonly seen
|
" Extra types commonly seen
|
||||||
if go#config#HighlightExtraTypes()
|
if go#config#HighlightExtraTypes()
|
||||||
syn match goExtraType /\<bytes\.\(Buffer\)\>/
|
syn match goExtraType /\<bytes\.\%(Buffer\)\>/
|
||||||
syn match goExtraType /\<context\.\(Context\)\>/
|
syn match goExtraType /\<context\.\%(Context\)\>/
|
||||||
syn match goExtraType /\<io\.\(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/
|
syn match goExtraType /\<io\.\%(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/
|
||||||
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
|
syn match goExtraType /\<reflect\.\%(Kind\|Type\|Value\)\>/
|
||||||
syn match goExtraType /\<unsafe\.Pointer\>/
|
syn match goExtraType /\<unsafe\.Pointer\>/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -265,21 +265,22 @@ endif
|
|||||||
hi def link goOperator Operator
|
hi def link goOperator Operator
|
||||||
|
|
||||||
" Functions;
|
" Functions;
|
||||||
if go#config#HighlightFunctions() || go#config#HighlightFunctionArguments()
|
if go#config#HighlightFunctions() || go#config#HighlightFunctionParameters()
|
||||||
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleArguments skipwhite skipnl
|
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleParams skipwhite skipnl
|
||||||
syn match goReceiverVar /\w\+\ze\s\+\(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
|
syn match goReceiverVar /\w\+\ze\s\+\%(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
|
||||||
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
|
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
|
||||||
syn match goFunction /\w\+/ nextgroup=goSimpleArguments contained skipwhite skipnl
|
syn match goFunction /\w\+/ nextgroup=goSimpleParams contained skipwhite skipnl
|
||||||
syn match goReceiverType /\w\+/ contained
|
syn match goReceiverType /\w\+/ contained
|
||||||
if go#config#HighlightFunctionArguments()
|
if go#config#HighlightFunctionParameters()
|
||||||
syn match goSimpleArguments /(\(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goArgumentName nextgroup=goSimpleArguments skipwhite skipnl
|
syn match goSimpleParams /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType nextgroup=goFunctionReturn skipwhite skipnl
|
||||||
syn match goArgumentName /\w\+\(\s*,\s*\w\+\)*\ze\s\+\(\w\|\.\|\*\|\[\)/ contained nextgroup=goArgumentType skipwhite skipnl
|
syn match goFunctionReturn /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType skipwhite skipnl
|
||||||
syn match goArgumentType /\([^,)]\|\_s\)\+,\?/ contained nextgroup=goArgumentName skipwhite skipnl
|
syn match goParamName /\w\+\%(\s*,\s*\w\+\)*\ze\s\+\%(\w\|\.\|\*\|\[\)/ contained nextgroup=goParamType skipwhite skipnl
|
||||||
\ contains=goVarArgs,goType,goSignedInts,goUnsignedInts,goFloats,goComplexes,goDeclType,goBlock
|
syn match goParamType /\%([^,)]\|\_s\)\+,\?/ contained nextgroup=goParamName skipwhite skipnl
|
||||||
hi def link goReceiverVar goArgumentName
|
\ contains=goVarArgs,goType,goSignedInts,goUnsignedInts,goFloats,goComplexes,goDeclType,goBlock
|
||||||
hi def link goArgumentName Identifier
|
hi def link goReceiverVar goParamName
|
||||||
endif
|
hi def link goParamName Identifier
|
||||||
syn match goReceiver /(\s*\w\+\(\s\+\*\?\s*\w\+\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl
|
endif
|
||||||
|
syn match goReceiver /(\s*\w\+\%(\s\+\*\?\s*\w\+\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl
|
||||||
else
|
else
|
||||||
syn keyword goDeclaration func
|
syn keyword goDeclaration func
|
||||||
endif
|
endif
|
||||||
@ -293,7 +294,20 @@ hi def link goFunctionCall Type
|
|||||||
|
|
||||||
" Fields;
|
" Fields;
|
||||||
if go#config#HighlightFields()
|
if go#config#HighlightFields()
|
||||||
syn match goField /\.\w\+\([.\ \n\r\:\)\[,]\)\@=/hs=s+1
|
" 1. Match a sequence of word characters coming after a '.'
|
||||||
|
" 2. Require the following but dont match it: ( \@= see :h E59)
|
||||||
|
" - The symbols: / - + * % OR
|
||||||
|
" - The symbols: [] {} <> ) OR
|
||||||
|
" - The symbols: \n \r space OR
|
||||||
|
" - The symbols: , : .
|
||||||
|
" 3. Have the start of highlight (hs) be the start of matched
|
||||||
|
" pattern (s) offsetted one to the right (+1) (see :h E401)
|
||||||
|
syn match goField /\.\w\+\
|
||||||
|
\%(\%([\/\-\+*%]\)\|\
|
||||||
|
\%([\[\]{}<\>\)]\)\|\
|
||||||
|
\%([\!=\^|&]\)\|\
|
||||||
|
\%([\n\r\ ]\)\|\
|
||||||
|
\%([,\:.]\)\)\@=/hs=s+1
|
||||||
endif
|
endif
|
||||||
hi def link goField Identifier
|
hi def link goField Identifier
|
||||||
|
|
||||||
@ -302,7 +316,7 @@ if go#config#HighlightTypes()
|
|||||||
syn match goTypeConstructor /\<\w\+{\@=/
|
syn match goTypeConstructor /\<\w\+{\@=/
|
||||||
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
|
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
|
||||||
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
|
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
|
||||||
syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl
|
syn match goDeclType /\<\%(interface\|struct\)\>/ skipwhite skipnl
|
||||||
hi def link goReceiverType Type
|
hi def link goReceiverType Type
|
||||||
else
|
else
|
||||||
syn keyword goDeclType struct interface
|
syn keyword goDeclType struct interface
|
||||||
|
@ -55,8 +55,12 @@ syn keyword InitializeKeyword set contained
|
|||||||
syn match Initialize /^\s*set\s\+.*$/ contains=Variable,InitializeKeyword,Color,String
|
syn match Initialize /^\s*set\s\+.*$/ contains=Variable,InitializeKeyword,Color,String
|
||||||
|
|
||||||
" Gaps
|
" Gaps
|
||||||
syn keyword GapStyleKeyword inner outer current all set plus minus contained
|
syn keyword GapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle contained
|
||||||
syn match GapStyle /^\s*\(gaps\)\s\+\(inner\|outer\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\)\)\?\(\s\+\d\+\)$/ contains=GapStyleKeyword,number
|
syn match GapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(\d\+\|\$.*\)\)$/ contains=GapStyleKeyword,number,Variable
|
||||||
|
syn keyword SmartGapKeyword on inverse_outer contained
|
||||||
|
syn match SmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\)\s\?$/ contains=SmartGapKeyword
|
||||||
|
syn keyword SmartBorderKeyword on no_gaps contained
|
||||||
|
syn match SmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\)\s\?$/ contains=SmartBorderKeyword
|
||||||
|
|
||||||
" Keyboard bindings
|
" Keyboard bindings
|
||||||
syn keyword Action toggle fullscreen restart key import kill shrink grow contained
|
syn keyword Action toggle fullscreen restart key import kill shrink grow contained
|
||||||
@ -87,8 +91,8 @@ syn keyword BorderStyleKeyword none normal pixel contained
|
|||||||
syn match BorderStyle /^\s*\(new_window\|new_float\|default_border\|default_floating_border\)\s\+\(none\|\(normal\|pixel\)\(\s\+\d\+\)\?\)\s\?$/ contains=BorderStyleKeyword,number
|
syn match BorderStyle /^\s*\(new_window\|new_float\|default_border\|default_floating_border\)\s\+\(none\|\(normal\|pixel\)\(\s\+\d\+\)\?\)\s\?$/ contains=BorderStyleKeyword,number
|
||||||
|
|
||||||
" Hide borders and edges
|
" Hide borders and edges
|
||||||
syn keyword EdgeKeyword none vertical horizontal both contained
|
syn keyword EdgeKeyword none vertical horizontal both smart smart_no_gaps contained
|
||||||
syn match Edge /^\s*hide_edge_borders\s\+\(none\|vertical\|horizontal\|both\)\s\?$/ contains=EdgeKeyword
|
syn match Edge /^\s*hide_edge_borders\s\+\(none\|vertical\|horizontal\|both\|smart\|smart_no_gaps\)\s\?$/ contains=EdgeKeyword
|
||||||
|
|
||||||
" Arbitrary commands for specific windows (for_window)
|
" Arbitrary commands for specific windows (for_window)
|
||||||
syn keyword CommandKeyword for_window contained
|
syn keyword CommandKeyword for_window contained
|
||||||
@ -187,6 +191,8 @@ hi! def link OrientationKeyword Type
|
|||||||
hi! def link MouseWarpingType Type
|
hi! def link MouseWarpingType Type
|
||||||
hi! def link FocusFollowsMouseType Type
|
hi! def link FocusFollowsMouseType Type
|
||||||
hi! def link GapStyleKeyword Type
|
hi! def link GapStyleKeyword Type
|
||||||
|
hi! def link SmartGapKeyword Type
|
||||||
|
hi! def link SmartBorderKeyword Type
|
||||||
hi! def link LayoutKeyword Type
|
hi! def link LayoutKeyword Type
|
||||||
hi! def link BorderStyleKeyword Type
|
hi! def link BorderStyleKeyword Type
|
||||||
hi! def link EdgeKeyword Type
|
hi! def link EdgeKeyword Type
|
||||||
@ -215,6 +221,8 @@ hi! def link FontKeyword Identifier
|
|||||||
hi! def link BindKeyword Identifier
|
hi! def link BindKeyword Identifier
|
||||||
hi! def link Orientation Identifier
|
hi! def link Orientation Identifier
|
||||||
hi! def link GapStyle Identifier
|
hi! def link GapStyle Identifier
|
||||||
|
hi! def link SmartGap Identifier
|
||||||
|
hi! def link SmartBorder Identifier
|
||||||
hi! def link Layout Identifier
|
hi! def link Layout Identifier
|
||||||
hi! def link BorderStyle Identifier
|
hi! def link BorderStyle Identifier
|
||||||
hi! def link Edge Identifier
|
hi! def link Edge Identifier
|
||||||
@ -239,7 +247,7 @@ hi! def link FocusOnActivationKeyword Identifier
|
|||||||
hi! def link DrawingMarksKeyword Identifier
|
hi! def link DrawingMarksKeyword Identifier
|
||||||
hi! def link BlockKeyword Identifier
|
hi! def link BlockKeyword Identifier
|
||||||
hi! def link Variable Statement
|
hi! def link Variable Statement
|
||||||
hi! def link ArbitraryCommand Ignore
|
hi! def link ArbitraryCommand Type
|
||||||
|
|
||||||
let b:current_syntax = "i3config"
|
let b:current_syntax = "i3config"
|
||||||
|
|
||||||
|
@ -138,8 +138,8 @@ syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus
|
|||||||
syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression,jsSpreadExpression extend fold
|
syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression,jsSpreadExpression extend fold
|
||||||
syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsExpression extend fold nextgroup=jsFlowDefinition
|
syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsExpression extend fold nextgroup=jsFlowDefinition
|
||||||
syntax region jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsAll extend fold
|
syntax region jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsAll extend fold
|
||||||
syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock extend fold
|
syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock,jsReturn extend fold
|
||||||
syntax region jsParenRepeat contained matchgroup=jsParensRepeat start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentRepeat,jsRepeatBlock extend fold
|
syntax region jsParenRepeat contained matchgroup=jsParensRepeat start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentRepeat,jsRepeatBlock,jsReturn extend fold
|
||||||
syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
|
syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
|
||||||
syntax region jsParenCatch contained matchgroup=jsParensCatch start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
|
syntax region jsParenCatch contained matchgroup=jsParensCatch start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
|
||||||
syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsDestructuringArray,jsRestExpression,jsFlowArgumentDef skipwhite skipempty nextgroup=jsCommentFunction,jsFuncBlock,jsFlowReturn extend fold
|
syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsDestructuringArray,jsRestExpression,jsFlowArgumentDef skipwhite skipempty nextgroup=jsCommentFunction,jsFuncBlock,jsFlowReturn extend fold
|
||||||
@ -157,7 +157,7 @@ syntax region jsBlock matchgroup=jsBraces s
|
|||||||
syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment,jsFlowTypeKeyword skipwhite skipempty nextgroup=jsFrom fold
|
syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment,jsFlowTypeKeyword skipwhite skipempty nextgroup=jsFrom fold
|
||||||
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
|
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
|
||||||
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
|
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
|
||||||
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|}\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression
|
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?:\@!/ end=/\%(:\|}\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression
|
||||||
syntax match jsOperator /?\.\ze\_D/
|
syntax match jsOperator /?\.\ze\_D/
|
||||||
|
|
||||||
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs,jsFlowFunctionGroup
|
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs,jsFlowFunctionGroup
|
||||||
|
@ -156,37 +156,41 @@ syntax region juliaParBlockInRange matchgroup=juliaParDelim contained start="("
|
|||||||
syntax region juliaSqBraBlock matchgroup=juliaParDelim start="\[" end="\]" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeEnd,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS
|
syntax region juliaSqBraBlock matchgroup=juliaParDelim start="\[" end="\]" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeEnd,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS
|
||||||
syntax region juliaCurBraBlock matchgroup=juliaParDelim start="{" end="}" contains=@juliaExpressions
|
syntax region juliaCurBraBlock matchgroup=juliaParDelim start="{" end="}" contains=@juliaExpressions
|
||||||
|
|
||||||
syntax match juliaKeyword display "\<\%(return\|local\|global\|import\%(all\)\?\|export\|using\|const\|where\)\>"
|
" This is really ugly. It would be better to mask most keywords when a dot is
|
||||||
|
" found, introducing some kind of dot-environment
|
||||||
|
let s:nodot = '\%(\.\)\@'.s:d(1).'1<!'
|
||||||
|
|
||||||
|
exec 'syntax match juliaKeyword display "'.s:nodot.'\<\%(return\|local\|global\|import\%(all\)\?\|export\|using\|const\|where\)\>"'
|
||||||
syntax match juliaInfixKeyword display "\%(=\s*\)\@<!\<\%(in\|isa\)\>\S\@!\%(\s*=\)\@!"
|
syntax match juliaInfixKeyword display "\%(=\s*\)\@<!\<\%(in\|isa\)\>\S\@!\%(\s*=\)\@!"
|
||||||
syntax match juliaRepKeyword display "\<\%(break\|continue\)\>"
|
exec 'syntax match juliaRepKeyword display "'.s:nodot.'\<\%(break\|continue\)\>"'
|
||||||
syntax region juliaConditionalBlock matchgroup=juliaConditional start="\<if\>" end="\<end\>" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold
|
exec 'syntax region juliaConditionalBlock matchgroup=juliaConditional start="'.s:nodot.'\<if\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold'
|
||||||
syntax region juliaConditionalEIBlock matchgroup=juliaConditional transparent contained start="\<elseif\>" end="\<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock
|
exec 'syntax region juliaConditionalEIBlock matchgroup=juliaConditional transparent contained start="'.s:nodot.'\<elseif\>" end="'.s:nodot.'\<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock'
|
||||||
syntax region juliaConditionalEBlock matchgroup=juliaConditional transparent contained start="\<else\>" end="\<end\>"me=s-1 contains=@juliaExpressions
|
exec 'syntax region juliaConditionalEBlock matchgroup=juliaConditional transparent contained start="'.s:nodot.'\<else\>" end="'.s:nodot.'\<end\>"me=s-1 contains=@juliaExpressions'
|
||||||
syntax region juliaWhileBlock matchgroup=juliaRepeat start="\<while\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaWhileBlock matchgroup=juliaRepeat start="'.s:nodot.'\<while\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
syntax region juliaForBlock matchgroup=juliaRepeat start="\<for\>" end="\<end\>" contains=@juliaExpressions,juliaOuter fold
|
exec 'syntax region juliaForBlock matchgroup=juliaRepeat start="'.s:nodot.'\<for\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions,juliaOuter fold'
|
||||||
syntax region juliaBeginBlock matchgroup=juliaBlKeyword start="\<begin\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaBeginBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<begin\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="\<function\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<function\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="\<macro\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<macro\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="\<quote\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<quote\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
if b:julia_syntax_version <= 10
|
if b:julia_syntax_version <= 10
|
||||||
syntax region juliaTypeBlock matchgroup=juliaBlKeyword06 start="\<type\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaTypeBlock matchgroup=juliaBlKeyword06 start="'.s:nodot.'\<type\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
syntax region juliaImmutableBlock matchgroup=juliaBlKeyword06 start="\<immutable\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaImmutableBlock matchgroup=juliaBlKeyword06 start="'.s:nodot.'\<immutable\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
endif
|
endif
|
||||||
syntax region juliaStructBlock matchgroup=juliaBlKeyword start="\<struct\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="\<mutable struct\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<mutable struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
syntax region juliaLetBlock matchgroup=juliaBlKeyword start="\<let\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaLetBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<let\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
syntax region juliaDoBlock matchgroup=juliaBlKeyword start="\<do\>" end="\<end\>" contains=@juliaExpressions fold
|
exec 'syntax region juliaDoBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<do\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||||
exec 'syntax region juliaModuleBlock matchgroup=juliaBlKeyword start="\%(\%(\.\s*\)\@'.s:d(6).'<!\|\%(@\s*\.\s*\)\@'.s:d(6).'<=\)\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold'
|
exec 'syntax region juliaModuleBlock matchgroup=juliaBlKeyword start="\%(\%(\.\s*\)\@'.s:d(6).'<!\|\%(@\s*\.\s*\)\@'.s:d(6).'<=\)\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold'
|
||||||
syntax region juliaExceptionBlock matchgroup=juliaException start="\<try\>" end="\<end\>" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold
|
exec 'syntax region juliaExceptionBlock matchgroup=juliaException start="'.s:nodot.'\<try\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold'
|
||||||
syntax region juliaCatchBlock matchgroup=juliaException transparent contained start="\<catch\>" end="\<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock
|
exec 'syntax region juliaCatchBlock matchgroup=juliaException transparent contained start="'.s:nodot.'\<catch\>" end="'.s:nodot.'\<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock'
|
||||||
syntax region juliaFinallyBlock matchgroup=juliaException transparent contained start="\<finally\>" end="\<end\>"me=s-1 contains=@juliaExpressions
|
exec 'syntax region juliaFinallyBlock matchgroup=juliaException transparent contained start="'.s:nodot.'\<finally\>" end="'.s:nodot.'\<end\>"me=s-1 contains=@juliaExpressions'
|
||||||
syntax match juliaTypedef "\<\%(abstract\|typealias\|bitstype\)\>"
|
exec 'syntax match juliaTypedef "'.s:nodot.'\<\%(abstract\|typealias\|bitstype\)\>"'
|
||||||
" AbstractBlock needs to come after to take precedence
|
" AbstractBlock needs to come after to take precedence
|
||||||
syntax region juliaAbstractBlock matchgroup=juliaBlKeyword start="\<abstract type\>" end="\<end\>" fold contains=@juliaExpressions
|
exec 'syntax region juliaAbstractBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<abstract type\>" end="'.s:nodot.'\<end\>" fold contains=@juliaExpressions'
|
||||||
syntax region juliaPrimitiveBlock matchgroup=juliaBlKeyword start="\<primitive type\>" end="\<end\>" fold contains=@juliaExpressions
|
exec 'syntax region juliaPrimitiveBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<primitive type\>" end="'.s:nodot.'\<end\>" fold contains=@juliaExpressions'
|
||||||
|
|
||||||
exec 'syntax region juliaComprehensionFor matchgroup=juliaComprehensionFor transparent contained start="\%([^[:space:],;:({[]\_s*\)\@'.s:d(80).'<=\<for\>" end="\ze[]);]" contains=@juliaExpressions,juliaComprehensionIf,juliaComprehensionFor'
|
exec 'syntax region juliaComprehensionFor matchgroup=juliaComprehensionFor transparent contained start="\%([^[:space:],;:({[]\_s*\)\@'.s:d(80).'<=\<for\>" end="\ze[]);]" contains=@juliaExpressions,juliaComprehensionIf,juliaComprehensionFor'
|
||||||
syntax match juliaComprehensionIf contained "\<if\>"
|
exec 'syntax match juliaComprehensionIf contained "'.s:nodot.'\<if\>"'
|
||||||
|
|
||||||
exec 'syntax match juliaOuter contained "\<outer\ze\s\+' . s:idregex . '\>"'
|
exec 'syntax match juliaOuter contained "\<outer\ze\s\+' . s:idregex . '\>"'
|
||||||
|
|
||||||
@ -219,7 +223,7 @@ syntax match juliaBaseTypeRange display "\<\%(Dims\|RangeIndex\|\%(Ordinal\|St
|
|||||||
syntax match juliaBaseTypeRange06 display "\<Range\>"
|
syntax match juliaBaseTypeRange06 display "\<Range\>"
|
||||||
syntax match juliaBaseTypeRange1011 display "\<\(Abstract\|Lin\)Range\>"
|
syntax match juliaBaseTypeRange1011 display "\<\(Abstract\|Lin\)Range\>"
|
||||||
syntax match juliaBaseTypeRegex display "\<Regex\%(Match\)\?\>"
|
syntax match juliaBaseTypeRegex display "\<Regex\%(Match\)\?\>"
|
||||||
syntax match juliaBaseTypeFact display "\<Factorization\>"
|
syntax match juliaBaseTypeFact display "\<\%(Factorization\|BunchKaufman\|\%(Cholesky\|QR\)\%(Pivoted\)\?\|\%(Generalized\)\?\%(Eigen\|SVD\|Schur\)\|Hessenberg\|LDLt\|LQ\|LU\)\>"
|
||||||
syntax match juliaBaseTypeSort display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>"
|
syntax match juliaBaseTypeSort display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>"
|
||||||
syntax match juliaBaseTypeRound display "\<Round\%(ingMode\|FromZero\|Down\|Nearest\%(Ties\%(Away\|Up\)\)\?\|ToZero\|Up\)\>"
|
syntax match juliaBaseTypeRound display "\<Round\%(ingMode\|FromZero\|Down\|Nearest\%(Ties\%(Away\|Up\)\)\?\|ToZero\|Up\)\>"
|
||||||
syntax match juliaBaseTypeSpecial display "\<\%(LocalProcess\|ClusterManager\)\>"
|
syntax match juliaBaseTypeSpecial display "\<\%(LocalProcess\|ClusterManager\)\>"
|
||||||
|
@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Kotlin
|
" Language: Kotlin
|
||||||
" Maintainer: Alexander Udalov
|
" Maintainer: Alexander Udalov
|
||||||
" Latest Revision: 23 November 2017
|
" Latest Revision: 14 January 2019
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
@ -36,6 +36,12 @@ syn match ktShebang "\v^#!.*$"
|
|||||||
syn match ktLineComment "\v//.*$" contains=ktTodo,@Spell
|
syn match ktLineComment "\v//.*$" contains=ktTodo,@Spell
|
||||||
syn region ktComment matchgroup=ktCommentMatchGroup start="/\*" end="\*/" contains=ktComment,ktTodo,@Spell
|
syn region ktComment matchgroup=ktCommentMatchGroup start="/\*" end="\*/" contains=ktComment,ktTodo,@Spell
|
||||||
|
|
||||||
|
syn region ktDocComment start="/\*\*" end="\*/" contains=ktDocTag,ktTodo,@Spell
|
||||||
|
syn match ktDocTag "\v\@(author|constructor|receiver|return|since|suppress)>" contained
|
||||||
|
syn match ktDocTag "\v\@(exception|param|property|throws|see|sample)>\s*\S+" contains=ktDocTagParam contained
|
||||||
|
syn match ktDocTagParam "\v(\s|\[)\S+" contained
|
||||||
|
syn match ktComment "/\*\*/"
|
||||||
|
|
||||||
syn match ktSpecialCharError "\v\\." contained
|
syn match ktSpecialCharError "\v\\." contained
|
||||||
syn match ktSpecialChar "\v\\([tbnr'"$\\]|u\x{4})" contained
|
syn match ktSpecialChar "\v\\([tbnr'"$\\]|u\x{4})" contained
|
||||||
syn region ktString start='"' skip='\\"' end='"' contains=ktSimpleInterpolation,ktComplexInterpolation,ktSpecialChar,ktSpecialCharError
|
syn region ktString start='"' skip='\\"' end='"' contains=ktSimpleInterpolation,ktComplexInterpolation,ktSpecialChar,ktSpecialCharError
|
||||||
@ -49,11 +55,11 @@ syn match ktAnnotation "\v(\w)@<!\@[[:alnum:]_.]*(:[[:alnum:]_.]*)?"
|
|||||||
syn match ktLabel "\v\w+\@"
|
syn match ktLabel "\v\w+\@"
|
||||||
|
|
||||||
syn match ktSimpleInterpolation "\v\$\h\w*" contained
|
syn match ktSimpleInterpolation "\v\$\h\w*" contained
|
||||||
syn region ktComplexInterpolation matchgroup=ktComplexInterpolationBrace start="\v\$\{" end="\v\}" contains=ALLBUT,ktSimpleInterpolation
|
syn region ktComplexInterpolation matchgroup=ktComplexInterpolationBrace start="\v\$\{" end="\v\}" contains=ALLBUT,ktSimpleInterpolation,ktTodo,ktSpecialCharError,ktSpecialChar,ktDocTag,ktDocTagParam
|
||||||
|
|
||||||
syn match ktNumber "\v<\d+[_[:digit:]]*[LFf]?"
|
syn match ktNumber "\v<\d+[_[:digit:]]*(uL?|UL?|[LFf])?"
|
||||||
syn match ktNumber "\v<0[Xx]\x+[_[:xdigit:]]*L?"
|
syn match ktNumber "\v<0[Xx]\x+[_[:xdigit:]]*(uL?|UL?|L)?"
|
||||||
syn match ktNumber "\v<0[Bb][01]+[_01]*L?"
|
syn match ktNumber "\v<0[Bb][01]+[_01]*(uL?|UL?|L)?"
|
||||||
syn match ktFloat "\v<\d*(\d[eE][-+]?\d+|\.\d+([eE][-+]?\d+)?)[Ff]?"
|
syn match ktFloat "\v<\d*(\d[eE][-+]?\d+|\.\d+([eE][-+]?\d+)?)[Ff]?"
|
||||||
|
|
||||||
syn match ktEscapedName "\v`.*`"
|
syn match ktEscapedName "\v`.*`"
|
||||||
@ -86,6 +92,9 @@ hi link ktShebang Comment
|
|||||||
hi link ktLineComment Comment
|
hi link ktLineComment Comment
|
||||||
hi link ktComment Comment
|
hi link ktComment Comment
|
||||||
hi link ktCommentMatchGroup Comment
|
hi link ktCommentMatchGroup Comment
|
||||||
|
hi link ktDocComment Comment
|
||||||
|
hi link ktDocTag Special
|
||||||
|
hi link ktDocTagParam Identifier
|
||||||
|
|
||||||
hi link ktSpecialChar SpecialChar
|
hi link ktSpecialChar SpecialChar
|
||||||
hi link ktSpecialCharError Error
|
hi link ktSpecialCharError Error
|
||||||
|
@ -38,10 +38,14 @@ syn sync linebreaks=1
|
|||||||
|
|
||||||
let s:conceal = ''
|
let s:conceal = ''
|
||||||
let s:concealends = ''
|
let s:concealends = ''
|
||||||
|
let s:concealcode = ''
|
||||||
if has('conceal') && get(g:, 'vim_markdown_conceal', 1)
|
if has('conceal') && get(g:, 'vim_markdown_conceal', 1)
|
||||||
let s:conceal = ' conceal'
|
let s:conceal = ' conceal'
|
||||||
let s:concealends = ' concealends'
|
let s:concealends = ' concealends'
|
||||||
endif
|
endif
|
||||||
|
if has('conceal') && get(g:, 'vim_markdown_conceal_code_blocks', 1)
|
||||||
|
let s:concealcode = ' concealends'
|
||||||
|
endif
|
||||||
|
|
||||||
" additions to HTML groups
|
" additions to HTML groups
|
||||||
if get(g:, 'vim_markdown_emphasis_multiline', 1)
|
if get(g:, 'vim_markdown_emphasis_multiline', 1)
|
||||||
@ -96,13 +100,13 @@ syn match htmlH2 /^.\+\n-\+$/ contains=mkdLink,mkdInlineURL,@Spell
|
|||||||
"define Markdown groups
|
"define Markdown groups
|
||||||
syn match mkdLineBreak / \+$/
|
syn match mkdLineBreak / \+$/
|
||||||
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
|
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/' . s:concealends
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/`/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!``/ skip=/[^`]`[^`]/ end=/\(\([^\\]\|^\)\\\)\@<!``/' . s:concealends
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!``/ skip=/[^`]`[^`]/ end=/\(\([^\\]\|^\)\\\)\@<!``/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/' . s:concealends
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!\~\~/ end=/\(\([^\\]\|^\)\\\)\@<!\~\~/' . s:concealends
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!\~\~/ end=/\(\([^\\]\|^\)\\\)\@<!\~\~/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/' . s:concealends
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<pre[^>]*\\\@<!>" end="</pre>"' . s:concealends
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<pre[^>]*\\\@<!>" end="</pre>"' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<code[^>]*\\\@<!>" end="</code>"' . s:concealends
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<code[^>]*\\\@<!>" end="</code>"' . s:concealcode
|
||||||
syn region mkdFootnote start="\[^" end="\]"
|
syn region mkdFootnote start="\[^" end="\]"
|
||||||
syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
|
syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
|
||||||
syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
|
syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
|
||||||
@ -147,7 +151,13 @@ if get(g:, 'vim_markdown_math', 0)
|
|||||||
syn region mkdMath start="\\\@<!\$\$" end="\$\$" skip="\\\$" contains=@tex keepend
|
syn region mkdMath start="\\\@<!\$\$" end="\$\$" skip="\\\$" contains=@tex keepend
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath
|
" Strike through
|
||||||
|
if get(g:, 'vim_markdown_strikethrough', 0)
|
||||||
|
syn region mkdStrike matchgroup=mkdStrike start="\%(\~\~\)" end="\%(\~\~\)"
|
||||||
|
HtmlHiLink mkdStrike htmlStrike
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath,htmlStrike
|
||||||
|
|
||||||
"highlighting for Markdown groups
|
"highlighting for Markdown groups
|
||||||
HtmlHiLink mkdString String
|
HtmlHiLink mkdString String
|
||||||
|
@ -44,7 +44,7 @@ endif
|
|||||||
syntax match mustacheError '}}}\?'
|
syntax match mustacheError '}}}\?'
|
||||||
syntax match mustacheInsideError '{{[{$#<>=!\/]\?'
|
syntax match mustacheInsideError '{{[{$#<>=!\/]\?'
|
||||||
syntax region mustacheInside start=/{{[^!][$#^/]\?/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer
|
syntax region mustacheInside start=/{{[^!][$#^/]\?/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer
|
||||||
syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,mustacheParam,@htmlMustacheContainer
|
syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,mustacheParam
|
||||||
syntax region mustacheHtmlValue start=/={{[^!][$#^/]\?/rs=s+1,hs=s+1 end=/}}/ oneline keepend contained containedin=htmlTag contains=mustacheInside
|
syntax region mustacheHtmlValue start=/={{[^!][$#^/]\?/rs=s+1,hs=s+1 end=/}}/ oneline keepend contained containedin=htmlTag contains=mustacheInside
|
||||||
syntax region mustachePartial start=/{{[<>]/lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer
|
syntax region mustachePartial start=/{{[<>]/lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer
|
||||||
syntax region mustacheMarkerSet start=/{{=/lc=2 end=/=}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer
|
syntax region mustacheMarkerSet start=/{{=/lc=2 end=/=}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer
|
||||||
|
@ -32,16 +32,17 @@ syn region pugJavascript matchgroup=pugJavascriptOutputChar start="[!&]\==\|\~"
|
|||||||
syn region pugJavascript matchgroup=pugJavascriptChar start="-" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend
|
syn region pugJavascript matchgroup=pugJavascriptChar start="-" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend
|
||||||
syn cluster pugTop contains=pugBegin,pugComment,pugHtmlComment,pugJavascript
|
syn cluster pugTop contains=pugBegin,pugComment,pugHtmlComment,pugJavascript
|
||||||
syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,pugIdChar,pugPlainChar,pugJavascript,pugScriptConditional,pugScriptStatement,pugPipedText
|
syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,pugIdChar,pugPlainChar,pugJavascript,pugScriptConditional,pugScriptStatement,pugPipedText
|
||||||
syn match pugTag "+\?[[:alnum:]_-]\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@pugComponent
|
syn match pugTag "+\?[[:alnum:]_-]\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName,pugJavascript nextgroup=@pugComponent
|
||||||
syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText
|
syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText
|
||||||
syntax keyword pugCommentTodo contained TODO FIXME XXX TBD
|
syn keyword pugCommentTodo contained TODO FIXME XXX TBD
|
||||||
syn match pugComment '\(\s\+\|^\)\/\/.*$' contains=pugCommentTodo,@Spell
|
syn match pugComment '\(\s\+\|^\)\/\/.*$' contains=pugCommentTodo,@Spell
|
||||||
syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" contains=pugCommentTodo,@Spell keepend
|
syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" contains=pugCommentTodo,@Spell keepend
|
||||||
syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->" contains=pugCommentTodo,@Spell
|
syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->" contains=pugCommentTodo,@Spell
|
||||||
syn region pugAngular2 start="(" end=")" contains=htmlEvent
|
syn region pugAngular2 start="(" end=")" contains=htmlEvent
|
||||||
syn region pugJavascriptString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contained
|
syn region pugJavascriptString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contained
|
||||||
syn region pugJavascriptString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contained
|
syn region pugJavascriptString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contained
|
||||||
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=pugJavascriptString,pugHtmlArg,pugAngular2,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
|
syn region pugJavascriptString start=+`+ skip=+\\\(`\|$\)+ end=+`\|$+ contains=javascriptInterpolation contained
|
||||||
|
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end="\(.\zs)\)\|)" contained contains=pugJavascriptString,pugHtmlArg,pugAngular2,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
|
||||||
syn match pugClassChar "\." containedin=htmlTagName nextgroup=pugClass
|
syn match pugClassChar "\." containedin=htmlTagName nextgroup=pugClass
|
||||||
syn match pugBlockExpansionChar ":\s\+" contained nextgroup=pugTag,pugClassChar,pugIdChar
|
syn match pugBlockExpansionChar ":\s\+" contained nextgroup=pugTag,pugClassChar,pugIdChar
|
||||||
syn match pugIdChar "#[[{]\@!" contained nextgroup=pugId
|
syn match pugIdChar "#[[{]\@!" contained nextgroup=pugId
|
||||||
@ -71,9 +72,10 @@ syn region pugPlainFilter matchgroup=pugFilter start="^\z(\s*\):\%(sass\|less\|
|
|||||||
syn match pugScriptConditional "^\s*\<\%(if\|else\|else if\|elif\|unless\|while\|until\|case\|when\|default\)\>[?!]\@!"
|
syn match pugScriptConditional "^\s*\<\%(if\|else\|else if\|elif\|unless\|while\|until\|case\|when\|default\)\>[?!]\@!"
|
||||||
syn match pugScriptStatement "^\s*\<\%(each\|for\|block\|prepend\|append\|mixin\|extends\|include\)\>[?!]\@!"
|
syn match pugScriptStatement "^\s*\<\%(each\|for\|block\|prepend\|append\|mixin\|extends\|include\)\>[?!]\@!"
|
||||||
syn region pugScriptLoopRegion start="^\s*\(for \)" end="$" contains=pugScriptLoopKeywords
|
syn region pugScriptLoopRegion start="^\s*\(for \)" end="$" contains=pugScriptLoopKeywords
|
||||||
syn keyword pugScriptLoopKeywords for in contained
|
syn keyword pugScriptLoopKeywords for in
|
||||||
|
|
||||||
syn region pugJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,pugJavascriptTag,pugCoffeescriptFilter keepend
|
syn region pugJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,pugJavascriptTag,pugCoffeescriptFilter keepend
|
||||||
|
syn region javascriptInterpolation start=/${/ end=/}/ contained
|
||||||
|
|
||||||
syn region pugCoffeescriptFilter matchgroup=pugFilter start="^\z(\s*\):coffee-\?script\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript contained
|
syn region pugCoffeescriptFilter matchgroup=pugFilter start="^\z(\s*\):coffee-\?script\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript contained
|
||||||
syn region pugJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=pugBegin,pugTag
|
syn region pugJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=pugBegin,pugTag
|
||||||
@ -104,6 +106,7 @@ hi def link pugComment Comment
|
|||||||
hi def link pugCommentBlock Comment
|
hi def link pugCommentBlock Comment
|
||||||
hi def link pugHtmlConditionalComment pugComment
|
hi def link pugHtmlConditionalComment pugComment
|
||||||
hi def link pugJavascriptString String
|
hi def link pugJavascriptString String
|
||||||
|
hi def link javascriptInterpolation Delimiter
|
||||||
|
|
||||||
let b:current_syntax = "pug"
|
let b:current_syntax = "pug"
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ if s:Enabled('g:python_highlight_all')
|
|||||||
if s:Enabled('g:python_highlight_builtins')
|
if s:Enabled('g:python_highlight_builtins')
|
||||||
call s:EnableByDefault('g:python_highlight_builtin_objs')
|
call s:EnableByDefault('g:python_highlight_builtin_objs')
|
||||||
call s:EnableByDefault('g:python_highlight_builtin_funcs')
|
call s:EnableByDefault('g:python_highlight_builtin_funcs')
|
||||||
|
call s:EnableByDefault('g:python_highlight_builtin_types')
|
||||||
endif
|
endif
|
||||||
call s:EnableByDefault('g:python_highlight_exceptions')
|
call s:EnableByDefault('g:python_highlight_exceptions')
|
||||||
call s:EnableByDefault('g:python_highlight_string_formatting')
|
call s:EnableByDefault('g:python_highlight_string_formatting')
|
||||||
@ -94,7 +95,7 @@ else
|
|||||||
syn match pythonStatement '\<async\s\+def\>' nextgroup=pythonFunction skipwhite
|
syn match pythonStatement '\<async\s\+def\>' nextgroup=pythonFunction skipwhite
|
||||||
syn match pythonStatement '\<async\s\+with\>'
|
syn match pythonStatement '\<async\s\+with\>'
|
||||||
syn match pythonStatement '\<async\s\+for\>'
|
syn match pythonStatement '\<async\s\+for\>'
|
||||||
syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonBytes,pythonBoolean,pythonBuiltinObj,pythonBuiltinFunc
|
syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonBytes,pythonBoolean,pythonNone,pythonSingleton,pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@ -328,18 +329,17 @@ else
|
|||||||
|
|
||||||
syn match pythonFloat '\.\d\%([_0-9]*\d\)\=\%([eE][+-]\=\d\%([_0-9]*\d\)\=\)\=[jJ]\=\>' display
|
syn match pythonFloat '\.\d\%([_0-9]*\d\)\=\%([eE][+-]\=\d\%([_0-9]*\d\)\=\)\=[jJ]\=\>' display
|
||||||
syn match pythonFloat '\<\d\%([_0-9]*\d\)\=[eE][+-]\=\d\%([_0-9]*\d\)\=[jJ]\=\>' display
|
syn match pythonFloat '\<\d\%([_0-9]*\d\)\=[eE][+-]\=\d\%([_0-9]*\d\)\=[jJ]\=\>' display
|
||||||
syn match pythonFloat '\<\d\%([_0-9]*\d\)\=\.\d\%([_0-9]*\d\)\=\%([eE][+-]\=\d\%([_0-9]*\d\)\=\)\=[jJ]\=' display
|
syn match pythonFloat '\<\d\%([_0-9]*\d\)\=\.\d\=\%([_0-9]*\d\)\=\%([eE][+-]\=\d\%([_0-9]*\d\)\=\)\=[jJ]\=' display
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"
|
"
|
||||||
" Builtin objects and types
|
" Builtin objects
|
||||||
"
|
"
|
||||||
|
|
||||||
if s:Enabled('g:python_highlight_builtin_objs')
|
if s:Enabled('g:python_highlight_builtin_objs')
|
||||||
syn keyword pythonNone None
|
syn keyword pythonNone None
|
||||||
syn keyword pythonBoolean True False
|
syn keyword pythonBoolean True False
|
||||||
syn keyword pythonBuiltinObj Ellipsis NotImplemented
|
syn keyword pythonSingleton Ellipsis NotImplemented
|
||||||
syn match pythonBuiltinObj '\v\.@<!<%(object|bool|int|float|tuple|str|list|dict|set|frozenset|bytearray|bytes)>'
|
|
||||||
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
|
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
|
||||||
syn keyword pythonBuiltinObj __loader__ __spec__ __path__ __cached__
|
syn keyword pythonBuiltinObj __loader__ __spec__ __path__ __cached__
|
||||||
endif
|
endif
|
||||||
@ -357,7 +357,7 @@ if s:Enabled('g:python_highlight_builtin_funcs')
|
|||||||
let s:funcs_re .= '|print'
|
let s:funcs_re .= '|print'
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let s:funcs_re .= '|ascii|exec|print'
|
let s:funcs_re .= '|ascii|breakpoint|exec|print'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:funcs_re = 'syn match pythonBuiltinFunc ''\v\.@<!\zs<%(' . s:funcs_re . ')>'
|
let s:funcs_re = 'syn match pythonBuiltinFunc ''\v\.@<!\zs<%(' . s:funcs_re . ')>'
|
||||||
@ -370,12 +370,21 @@ if s:Enabled('g:python_highlight_builtin_funcs')
|
|||||||
unlet s:funcs_re
|
unlet s:funcs_re
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
"
|
||||||
|
" Builtin types
|
||||||
|
"
|
||||||
|
|
||||||
|
if s:Enabled('g:python_highlight_builtin_types')
|
||||||
|
syn match pythonBuiltinType '\v\.@<!<%(object|bool|int|float|tuple|str|list|dict|set|frozenset|bytearray|bytes)>'
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
"
|
"
|
||||||
" Builtin exceptions and warnings
|
" Builtin exceptions and warnings
|
||||||
"
|
"
|
||||||
|
|
||||||
if s:Enabled('g:python_highlight_exceptions')
|
if s:Enabled('g:python_highlight_exceptions')
|
||||||
let s:exs_re = 'BaseException|Exception|ArithmeticError|LookupError|EnvironmentError|AssertionError|AttributeError|BufferError|EOFError|FloatingPointError|GeneratorExit|IOError|ImportError|IndexError|KeyError|KeyboardInterrupt|MemoryError|NameError|NotImplementedError|OSError|OverflowError|ReferenceError|RuntimeError|StopIteration|SyntaxError|IndentationError|TabError|SystemError|SystemExit|TypeError|UnboundLocalError|UnicodeError|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|ValueError|VMSError|WindowsError|ZeroDivisionError|Warning|UserWarning|BytesWarning|DeprecationWarning|PendingDepricationWarning|SyntaxWarning|RuntimeWarning|FutureWarning|ImportWarning|UnicodeWarning'
|
let s:exs_re = 'BaseException|Exception|ArithmeticError|LookupError|EnvironmentError|AssertionError|AttributeError|BufferError|EOFError|FloatingPointError|GeneratorExit|IOError|ImportError|IndexError|KeyError|KeyboardInterrupt|MemoryError|NameError|NotImplementedError|OSError|OverflowError|ReferenceError|RuntimeError|StopIteration|SyntaxError|IndentationError|TabError|SystemError|SystemExit|TypeError|UnboundLocalError|UnicodeError|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|ValueError|VMSError|WindowsError|ZeroDivisionError|Warning|UserWarning|BytesWarning|DeprecationWarning|PendingDeprecationWarning|SyntaxWarning|RuntimeWarning|FutureWarning|ImportWarning|UnicodeWarning'
|
||||||
|
|
||||||
if s:Python2Syntax()
|
if s:Python2Syntax()
|
||||||
let s:exs_re .= '|StandardError'
|
let s:exs_re .= '|StandardError'
|
||||||
@ -416,7 +425,6 @@ if v:version >= 508 || !exists('did_python_syn_inits')
|
|||||||
|
|
||||||
HiLink pythonDecorator Define
|
HiLink pythonDecorator Define
|
||||||
HiLink pythonDottedName Function
|
HiLink pythonDottedName Function
|
||||||
HiLink pythonDot Normal
|
|
||||||
|
|
||||||
HiLink pythonComment Comment
|
HiLink pythonComment Comment
|
||||||
if !s:Enabled('g:python_highlight_file_headers_as_comments')
|
if !s:Enabled('g:python_highlight_file_headers_as_comments')
|
||||||
@ -472,9 +480,11 @@ if v:version >= 508 || !exists('did_python_syn_inits')
|
|||||||
|
|
||||||
HiLink pythonBoolean Boolean
|
HiLink pythonBoolean Boolean
|
||||||
HiLink pythonNone Constant
|
HiLink pythonNone Constant
|
||||||
|
HiLink pythonSingleton Constant
|
||||||
|
|
||||||
HiLink pythonBuiltinObj Structure
|
HiLink pythonBuiltinObj Identifier
|
||||||
HiLink pythonBuiltinFunc Function
|
HiLink pythonBuiltinFunc Function
|
||||||
|
HiLink pythonBuiltinType Structure
|
||||||
|
|
||||||
HiLink pythonExClass Structure
|
HiLink pythonExClass Structure
|
||||||
HiLink pythonClassVar Identifier
|
HiLink pythonClassVar Identifier
|
||||||
|
@ -57,6 +57,14 @@ syn keyword racketSyntax define* define*-values define*-syntax define*-syntaxes
|
|||||||
syn keyword racketSyntax package? package-exported-identifiers package-original-identifiers
|
syn keyword racketSyntax package? package-exported-identifiers package-original-identifiers
|
||||||
syn keyword racketSyntax block #%stratified-body
|
syn keyword racketSyntax block #%stratified-body
|
||||||
|
|
||||||
|
" 8 Contracts
|
||||||
|
" 8.2 Function contracts
|
||||||
|
syn keyword racketSyntax -> ->* ->i ->d case-> dynamic->* unconstrained-domain->
|
||||||
|
|
||||||
|
" 8.6.1 Nested Contract Boundaries
|
||||||
|
syn keyword racketSyntax with-contract define/contract define-struct/contract
|
||||||
|
syn keyword racketSyntax invariant-assertion current-contract-region
|
||||||
|
|
||||||
" 9 Pattern Matching
|
" 9 Pattern Matching
|
||||||
syn keyword racketSyntax match match* match/values define/match
|
syn keyword racketSyntax match match* match/values define/match
|
||||||
syn keyword racketSyntax match-lambda match-lambda* match-lambda**
|
syn keyword racketSyntax match-lambda match-lambda* match-lambda**
|
||||||
@ -75,6 +83,9 @@ syn keyword racketSyntax reset-at shift-at prompt0 reset0 control0 shift0
|
|||||||
syn keyword racketSyntax prompt0-at reset0-at control0-at shift0-at
|
syn keyword racketSyntax prompt0-at reset0-at control0-at shift0-at
|
||||||
syn keyword racketSyntax set cupto
|
syn keyword racketSyntax set cupto
|
||||||
|
|
||||||
|
" 11.3.2 Parameters
|
||||||
|
syn keyword racketSyntax parameterize parameterize*
|
||||||
|
|
||||||
" 12.5 Writing
|
" 12.5 Writing
|
||||||
syn keyword racketSyntax write display displayln print
|
syn keyword racketSyntax write display displayln print
|
||||||
syn keyword racketSyntax fprintf printf eprintf format
|
syn keyword racketSyntax fprintf printf eprintf format
|
||||||
@ -93,7 +104,8 @@ syn keyword racketSyntax make-custodian-box custodian-box-value
|
|||||||
" lambda sign
|
" lambda sign
|
||||||
syn match racketSyntax /\<[\u03bb]\>/
|
syn match racketSyntax /\<[\u03bb]\>/
|
||||||
|
|
||||||
" Functions
|
|
||||||
|
" Functions ==================================================================
|
||||||
|
|
||||||
syn keyword racketFunc boolean? not equal? eqv? eq? equal?/recur immutable?
|
syn keyword racketFunc boolean? not equal? eqv? eq? equal?/recur immutable?
|
||||||
syn keyword racketFunc true false symbol=? boolean=? false?
|
syn keyword racketFunc true false symbol=? boolean=? false?
|
||||||
@ -108,8 +120,8 @@ syn keyword racketFunc inexact->exact exact->inexact
|
|||||||
|
|
||||||
" 3.2.2.1 Arithmetic
|
" 3.2.2.1 Arithmetic
|
||||||
syn keyword racketFunc + - * / quotient remainder quotient/remainder modulo
|
syn keyword racketFunc + - * / quotient remainder quotient/remainder modulo
|
||||||
syn keyword racketFunc add1 sub1 abs max min gcd lcm round floor ceiling
|
syn keyword racketFunc add1 sub1 abs max min gcd lcm round exact-round floor
|
||||||
syn keyword racketFunc truncate numerator denominator rationalize
|
syn keyword racketFunc ceiling truncate numerator denominator rationalize
|
||||||
|
|
||||||
" 3.2.2.2 Number Comparison
|
" 3.2.2.2 Number Comparison
|
||||||
syn keyword racketFunc = < <= > >=
|
syn keyword racketFunc = < <= > >=
|
||||||
@ -374,6 +386,19 @@ syn keyword racketFunc class-field-accessor class-field-mutator
|
|||||||
"5.4.3 Generics
|
"5.4.3 Generics
|
||||||
syn keyword racketFunc generic send-generic make-generic
|
syn keyword racketFunc generic send-generic make-generic
|
||||||
|
|
||||||
|
" 8.1 Data-strucure contracts
|
||||||
|
syn keyword racketFunc flat-contract-with-explanation flat-named-contract
|
||||||
|
" TODO where do any/c and none/c `value`s go?
|
||||||
|
syn keyword racketFunc or/c first-or/c and/c not/c =/c </c >/c <=/c >=/c
|
||||||
|
syn keyword racketFunc between/c real-in integer-in char-in natural-number/c
|
||||||
|
syn keyword racketFunc string-len/c printable/c one-of/c symbols vectorof
|
||||||
|
syn keyword racketFunc vector-immutableof vector/c box/c box-immutable/c listof
|
||||||
|
syn keyword racketFunc non-empty-listof list*of cons/c cons/dc list/c *list/c
|
||||||
|
syn keyword racketFunc syntax/c struct/c struct/dc parameter/c
|
||||||
|
syn keyword racketFunc procedure-arity-includes/c hash/c hash/dc channel/c
|
||||||
|
syn keyword racketFunc prompt-tag/c continuation-mark-key/c evt/c promise/c
|
||||||
|
syn keyword racketFunc flat-contract flat-contract-predicate suggest/c
|
||||||
|
|
||||||
" 9.1 Multiple Values
|
" 9.1 Multiple Values
|
||||||
syn keyword racketFunc values call-with-values
|
syn keyword racketFunc values call-with-values
|
||||||
|
|
||||||
@ -420,6 +445,11 @@ syn keyword racketFunc continuation? continuation-prompt-tag dynamic-wind
|
|||||||
" 10.4.1 Additional Control Operators
|
" 10.4.1 Additional Control Operators
|
||||||
syn keyword racketFunc call/prompt abort/cc call/comp abort fcontrol spawn splitter new-prompt
|
syn keyword racketFunc call/prompt abort/cc call/comp abort fcontrol spawn splitter new-prompt
|
||||||
|
|
||||||
|
" 11.3.2 Parameters
|
||||||
|
syn keyword racketFunc make-parameter make-derived-parameter parameter?
|
||||||
|
syn keyword racketFunc parameter-procedure=? current-parameterization
|
||||||
|
syn keyword racketFunc call-with-parameterization parameterization?
|
||||||
|
|
||||||
" 14.1.1 Manipulating Paths
|
" 14.1.1 Manipulating Paths
|
||||||
syn keyword racketFunc path? path-string? path-for-some-system? string->path path->string path->bytes
|
syn keyword racketFunc path? path-string? path-for-some-system? string->path path->string path->bytes
|
||||||
syn keyword racketFunc string->path-element bytes->path-element path-element->string path-element->bytes
|
syn keyword racketFunc string->path-element bytes->path-element path-element->string path-element->bytes
|
||||||
@ -434,6 +464,9 @@ syn keyword racketFunc path-replace-suffix path-add-suffix
|
|||||||
syn keyword racketFunc explode-path file-name-from-path filename-extension find-relative-path normalize-path
|
syn keyword racketFunc explode-path file-name-from-path filename-extension find-relative-path normalize-path
|
||||||
syn keyword racketFunc path-element? path-only simple-form-path some-simple-path->string string->some-system-path
|
syn keyword racketFunc path-element? path-only simple-form-path some-simple-path->string string->some-system-path
|
||||||
|
|
||||||
|
" 15.6 Time
|
||||||
|
syn keyword racketFunc current-seconds current-inexact-milliseconds
|
||||||
|
syn keyword racketFunc seconds->date current-milliseconds
|
||||||
|
|
||||||
|
|
||||||
syn match racketDelimiter !\<\.\>!
|
syn match racketDelimiter !\<\.\>!
|
||||||
|
@ -5,7 +5,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rst') == -1
|
|||||||
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
|
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
|
||||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||||
" Website: https://github.com/marshallward/vim-restructuredtext
|
" Website: https://github.com/marshallward/vim-restructuredtext
|
||||||
" Latest Revision: 2018-07-23
|
" Latest Revision: 2018-12-29
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
@ -23,7 +23,7 @@ syn cluster rstCruft contains=rstEmphasis,rstStrongEmphasis,
|
|||||||
\ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference
|
\ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference
|
||||||
|
|
||||||
syn region rstLiteralBlock matchgroup=rstDelimiter
|
syn region rstLiteralBlock matchgroup=rstDelimiter
|
||||||
\ start='::\_s*\n\ze\z(\s\+\)' skip='^$' end='^\z1\@!'
|
\ start='\(^\z(\s*\).*\)\@<=::\n\s*\n' skip='^\s*$' end='^\(\z1\s\+\)\@!'
|
||||||
\ contains=@NoSpell
|
\ contains=@NoSpell
|
||||||
|
|
||||||
syn region rstQuotedLiteralBlock matchgroup=rstDelimiter
|
syn region rstQuotedLiteralBlock matchgroup=rstDelimiter
|
||||||
|
627
syntax/ruby.vim
627
syntax/ruby.vim
@ -20,6 +20,11 @@ endif
|
|||||||
let s:cpo_sav = &cpo
|
let s:cpo_sav = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
|
" eRuby Config {{{1
|
||||||
|
if exists('main_syntax') && main_syntax == 'eruby'
|
||||||
|
let b:ruby_no_expensive = 1
|
||||||
|
endif
|
||||||
|
|
||||||
" Folding Config {{{1
|
" Folding Config {{{1
|
||||||
if has("folding") && exists("ruby_fold")
|
if has("folding") && exists("ruby_fold")
|
||||||
setlocal foldmethod=syntax
|
setlocal foldmethod=syntax
|
||||||
@ -34,6 +39,10 @@ let s:foldable_groups = split(
|
|||||||
\ )
|
\ )
|
||||||
|
|
||||||
function! s:foldable(...) abort
|
function! s:foldable(...) abort
|
||||||
|
if index(s:foldable_groups, 'NONE') > -1
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
if index(s:foldable_groups, 'ALL') > -1
|
if index(s:foldable_groups, 'ALL') > -1
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
@ -45,9 +54,21 @@ function! s:foldable(...) abort
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
endfunction " }}}
|
endfunction
|
||||||
|
|
||||||
syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo,rubyModuleName,rubyClassName,rubySymbolDelimiter
|
function! s:run_syntax_fold(args) abort
|
||||||
|
let [_0, _1, groups, cmd; _] = matchlist(a:args, '\(["'']\)\(.\{-}\)\1\s\+\(.*\)')
|
||||||
|
if call('s:foldable', split(groups))
|
||||||
|
let cmd .= ' fold'
|
||||||
|
endif
|
||||||
|
exe cmd
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
com! -nargs=* SynFold call s:run_syntax_fold(<q-args>)
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter
|
||||||
|
|
||||||
" Whitespace Errors {{{1
|
" Whitespace Errors {{{1
|
||||||
if exists("ruby_space_errors")
|
if exists("ruby_space_errors")
|
||||||
@ -61,373 +82,315 @@ endif
|
|||||||
|
|
||||||
" Operators {{{1
|
" Operators {{{1
|
||||||
if exists("ruby_operators")
|
if exists("ruby_operators")
|
||||||
syn match rubyOperator "[~!^|*/%+-]\|&\.\@!\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@1<!>\|\*\*\|\.\.\.\|\.\.\|::"
|
syn match rubyDotOperator "\.\|&\." containedin=rubyKeywordAsMethod
|
||||||
syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!="
|
syn match rubyTernaryOperator "[[:alnum:]]\@1<!?\|:"
|
||||||
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@2<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop
|
syn match rubyArithmeticOperator "\*\*\|[*/%+]\|->\@!"
|
||||||
|
syn match rubyComparisonOperator "<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<<\@!\|>=\|[-=]\@1<!>"
|
||||||
|
syn match rubyBitwiseOperator "[~^|]\|&\.\@!\|\%(class\s*\)\@<!<<\|>>"
|
||||||
|
syn match rubyBooleanOperator "[[:alnum:]]\@1<!!\|&&\|||"
|
||||||
|
syn match rubyRangeOperator "\.\.\.\="
|
||||||
|
syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^="
|
||||||
|
syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~"
|
||||||
|
syn match rubyScopeOperator "::"
|
||||||
|
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@2<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop
|
||||||
|
|
||||||
|
syn cluster rubyOperator contains=ruby.*Operator
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Expression Substitution and Backslash Notation {{{1
|
" String Interpolation and Backslash Notation {{{1
|
||||||
syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display
|
|
||||||
syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display
|
|
||||||
syn match rubyQuoteEscape "\\[\\']" contained display
|
|
||||||
|
|
||||||
syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop
|
syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop
|
||||||
syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable
|
syn match rubyInterpolation "#\$\%(-\w\|[!$&"'*+,./0:;<>?@\`~_]\|\w\+\)" display contained contains=rubyInterpolationDelimiter,@rubyGlobalVariable
|
||||||
syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained
|
syn match rubyInterpolation "#@@\=\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable
|
||||||
syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable
|
syn match rubyInterpolationDelimiter "#\ze[$@]" display contained
|
||||||
syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained
|
|
||||||
syn region rubyNoInterpolation start="\\#{" end="}" contained
|
|
||||||
syn match rubyNoInterpolation "\\#{" display contained
|
|
||||||
syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained
|
|
||||||
syn match rubyNoInterpolation "\\#\$\W" display contained
|
|
||||||
|
|
||||||
syn match rubyDelimiterEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE
|
syn match rubyStringEscape "\\\_." contained display
|
||||||
|
syn match rubyStringEscape "\\\o\{1,3}\|\\x\x\{1,2}" contained display
|
||||||
|
syn match rubyStringEscape "\\u\%(\x\{4}\|{\x\{1,6}\%(\s\+\x\{1,6}\)*}\)" contained display
|
||||||
|
syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display
|
||||||
|
|
||||||
|
syn match rubyBackslashEscape "\\\\" contained display
|
||||||
|
syn match rubyQuoteEscape "\\'" contained display
|
||||||
|
syn match rubySpaceEscape "\\ " contained display
|
||||||
|
|
||||||
|
syn match rubyParenthesesEscape "\\[()]" contained display
|
||||||
|
syn match rubyCurlyBracesEscape "\\[{}]" contained display
|
||||||
|
syn match rubyAngleBracketsEscape "\\[<>]" contained display
|
||||||
|
syn match rubySquareBracketsEscape "\\[[\]]" contained display
|
||||||
|
|
||||||
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained
|
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained
|
||||||
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained
|
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained
|
||||||
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained
|
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained
|
||||||
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained
|
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained
|
||||||
|
|
||||||
|
syn cluster rubySingleCharEscape contains=rubyBackslashEscape,rubyQuoteEscape,rubySpaceEscape,rubyParenthesesEscape,rubyCurlyBracesEscape,rubyAngleBracketsEscape,rubySquareBracketsEscape
|
||||||
|
syn cluster rubyNestedBrackets contains=rubyNested.\+
|
||||||
|
syn cluster rubyStringSpecial contains=rubyInterpolation,rubyStringEscape
|
||||||
|
syn cluster rubyStringNotTop contains=@rubyStringSpecial,@rubyNestedBrackets,@rubySingleCharEscape
|
||||||
|
|
||||||
" Regular Expression Metacharacters {{{1
|
" Regular Expression Metacharacters {{{1
|
||||||
" These are mostly Oniguruma ready
|
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\\\\|\\)" end=")" contained
|
||||||
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained
|
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\\\\|\\)" end=")" contained transparent contains=@rubyRegexpSpecial
|
||||||
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial
|
syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\\\|\\\]" end="\]" contained transparent contains=rubyRegexpBrackets,rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass,rubyRegexpIntersection oneline
|
||||||
syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\]" end="\]" contained transparent contains=rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass oneline
|
syn match rubyRegexpCharClass "\\[DdHhRSsWw]" contained display
|
||||||
syn match rubyRegexpCharClass "\\[DdHhSsWw]" contained display
|
syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained
|
||||||
syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained
|
syn match rubyRegexpCharClass "\\[pP]{^\=.\{-}}" contained display
|
||||||
syn match rubyRegexpEscape "\\[].*?+^$|\\/(){}[]" contained
|
syn match rubyRegexpEscape "\\[].*?+^$|\\/(){}[]" contained " see commit e477f10
|
||||||
syn match rubyRegexpQuantifier "[*?+][?+]\=" contained display
|
syn match rubyRegexpQuantifier "[*?+][?+]\=" contained display
|
||||||
syn match rubyRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display
|
syn match rubyRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display
|
||||||
syn match rubyRegexpAnchor "[$^]\|\\[ABbGZz]" contained display
|
syn match rubyRegexpAnchor "[$^]\|\\[ABbGZz]" contained display
|
||||||
syn match rubyRegexpDot "\." contained display
|
syn match rubyRegexpDot "\.\|\\X" contained display
|
||||||
syn match rubyRegexpSpecial "|" contained display
|
syn match rubyRegexpIntersection "&&" contained display
|
||||||
syn match rubyRegexpSpecial "\\[1-9]\d\=\d\@!" contained display
|
syn match rubyRegexpSpecial "\\K" contained display
|
||||||
syn match rubyRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display
|
syn match rubyRegexpSpecial "|" contained display
|
||||||
syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display
|
syn match rubyRegexpSpecial "\\[1-9]\d\=\d\@!" contained display
|
||||||
syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display
|
syn match rubyRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display
|
||||||
syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display
|
syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display
|
||||||
|
syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display
|
||||||
|
syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display
|
||||||
|
|
||||||
syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape
|
syn cluster rubyRegexpSpecial contains=@rubyStringSpecial,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment,rubyRegexpIntersection
|
||||||
syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets
|
|
||||||
syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment
|
|
||||||
|
|
||||||
" Numbers and ASCII Codes {{{1
|
" Numbers {{{1
|
||||||
syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@1<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
|
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>" display
|
||||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>" display
|
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)r\=i\=\>" display
|
||||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)r\=i\=\>" display
|
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*r\=i\=\>" display
|
||||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*r\=i\=\>" display
|
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*r\=i\=\>" display
|
||||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*r\=i\=\>" display
|
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*r\=i\=\>" display
|
||||||
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*r\=i\=\>" display
|
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)i\=\>" display
|
||||||
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)r\=i\=\>" display
|
|
||||||
|
|
||||||
" Identifiers {{{1
|
" Identifiers {{{1
|
||||||
syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
|
syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!]\=" contains=NONE display transparent
|
||||||
syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent
|
syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent
|
||||||
|
|
||||||
syn match rubyClassName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained
|
syn match rubyClassName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained
|
||||||
syn match rubyModuleName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained
|
syn match rubyModuleName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained
|
||||||
syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!"
|
syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!"
|
||||||
syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
|
syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
|
||||||
syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
|
syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
|
||||||
syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)"
|
syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)"
|
||||||
syn match rubySymbolDelimiter ":" contained
|
syn match rubySymbolDelimiter ":" contained
|
||||||
syn match rubySymbol "[]})\"':]\@1<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" contains=rubySymbolDelimiter
|
syn match rubySymbol "[]})\"':]\@1<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" contains=rubySymbolDelimiter
|
||||||
syn match rubySymbol "[]})\"':]\@1<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" contains=rubySymbolDelimiter
|
syn match rubySymbol "[]})\"':]\@1<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" contains=rubySymbolDelimiter
|
||||||
syn match rubySymbol "[]})\"':]\@1<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contains=rubySymbolDelimiter
|
syn match rubySymbol "[]})\"':]\@1<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contains=rubySymbolDelimiter
|
||||||
syn match rubySymbol "[]})\"':]\@1<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\=" contains=rubySymbolDelimiter
|
syn match rubySymbol "[]})\"':]\@1<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\=" contains=rubySymbolDelimiter
|
||||||
|
|
||||||
if s:foldable(':')
|
SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,rubyBackslashEscape
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
|
||||||
else
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)*\s*(\@="
|
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@="
|
||||||
|
|
||||||
syn match rubyBlockParameter "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contained
|
syn match rubyBlockParameter "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contained
|
||||||
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" oneline display contains=rubyBlockParameter
|
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" oneline display contains=rubyBlockParameter
|
||||||
|
|
||||||
syn match rubyInvalidVariable "$[^ A-Za-z_-]"
|
if exists('ruby_global_variable_error')
|
||||||
syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~]#
|
syn match rubyGlobalVariableError "$[^A-Za-z_]" display
|
||||||
syn match rubyPredefinedVariable "$\d\+" display
|
syn match rubyGlobalVariableError "$-[^0FIKWadilpvw]" display
|
||||||
syn match rubyPredefinedVariable "$_\>" display
|
endif
|
||||||
syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display
|
|
||||||
syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display
|
syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<>?@\`~]#
|
||||||
syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display
|
syn match rubyPredefinedVariable "$\d\+" display
|
||||||
|
syn match rubyPredefinedVariable "$_\>" display
|
||||||
|
syn match rubyPredefinedVariable "$-[0FIWadilpvw]\>" display
|
||||||
|
syn match rubyPredefinedVariable "$\%(stderr\|stdin\|stdout\)\>" display
|
||||||
|
syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display
|
||||||
syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(ARGF\|ARGV\|ENV\|DATA\|FALSE\|NIL\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!"
|
syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(ARGF\|ARGV\|ENV\|DATA\|FALSE\|NIL\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!"
|
||||||
syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!"
|
syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!"
|
||||||
|
|
||||||
" Normal Regular Expression {{{1
|
" Deprecated/removed in 1.9
|
||||||
if s:foldable('/')
|
syn match rubyPredefinedVariable "$="
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
|
syn match rubyPredefinedVariable "$-K\>" display
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/\%([ \t=]\|$\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
|
syn match rubyPredefinedVariable "$\%(deferr\|defout\)\>" display
|
||||||
else
|
syn match rubyPredefinedVariable "$KCODE\>" display
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/\%([ \t=]\|$\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Generalized Regular Expression {{{1
|
syn cluster rubyGlobalVariable contains=rubyGlobalVariable,rubyPredefinedVariable,rubyGlobalVariableError
|
||||||
if s:foldable('%')
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
|
|
||||||
else
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial
|
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Normal String {{{1
|
" Normal Regular Expressions {{{1
|
||||||
|
SynFold '/' syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial nextgroup=@rubyModifier skipwhite
|
||||||
|
SynFold '/' syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/\%([ \t=]\|$\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial nextgroup=@rubyModifier skipwhite
|
||||||
|
|
||||||
|
" Generalized Regular Expressions {{{1
|
||||||
|
SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial nextgroup=@rubyModifier skipwhite
|
||||||
|
SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial
|
||||||
|
SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets
|
||||||
|
SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial
|
||||||
|
SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial
|
||||||
|
SynFold '%' syn region rubyRegexp matchgroup=rubyPercentRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial
|
||||||
|
|
||||||
|
" Characters {{{1
|
||||||
|
syn match rubyCharacter "\%(\w\|[]})\"'/]\)\@1<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
|
||||||
|
syn match rubyCharacter "\%(\w\|[]})\"'/]\)\@1<!?\\u\%(\x\{4}\|{\x\{1,6}}\)"
|
||||||
|
|
||||||
|
" Normal Strings {{{1
|
||||||
let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : ''
|
let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : ''
|
||||||
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" ' .
|
let s:fold_arg = s:foldable('string') ? ' fold' : ''
|
||||||
\ (s:foldable('%') ? 'fold' : '') . ' contains=@rubyStringSpecial' . s:spell_cluster
|
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial' . s:spell_cluster . s:fold_arg
|
||||||
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" ' .
|
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" contains=rubyQuoteEscape,rubyBackslashEscape' . s:spell_cluster . s:fold_arg
|
||||||
\ (s:foldable('%') ? 'fold' : '') . ' contains=rubyQuoteEscape' . s:spell_cluster
|
unlet s:spell_cluster s:fold_arg
|
||||||
|
|
||||||
" Shell Command Output {{{1
|
" Shell Command Output {{{1
|
||||||
if s:foldable('%')
|
SynFold 'string' syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
|
||||||
else
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Generalized Single Quoted String, Symbol and Array of Strings {{{1
|
" Generalized Single Quoted Strings, Symbols, Array of Strings and Array of Symbols {{{1
|
||||||
if s:foldable('%')
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold
|
|
||||||
else
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1"
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1"
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1"
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1"
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Generalized Double Quoted String and Array of Strings and Shell Command Output {{{1
|
" Non-bracket punctuation delimiters {{{2
|
||||||
|
let s:names = { '~': 'Tilde', '`': 'BackQuote', '!': 'Bang', '@': 'At', '#': 'Hash', '$': 'Dollar', '%': 'Percent', '^': 'Caret',
|
||||||
|
\ '&': 'Ampersand', '*': 'Asterix', '_': 'Underscore', '-': 'Dash', '+': 'Plus', '=': 'Equals', '|': 'Bar',
|
||||||
|
\ '\': 'Backslash', ':': 'Colon', ';': 'Semicolon', '"': 'DoubleQuote', "'": 'Quote', ',': 'Comma', '.': 'Period',
|
||||||
|
\ '?': 'QuestionMark', '/': 'ForwardSlash' }
|
||||||
|
|
||||||
|
for s:delimiter in keys(s:names)
|
||||||
|
let s:group = 'ruby' . s:names[s:delimiter] . 'Escape'
|
||||||
|
|
||||||
|
if s:delimiter =~ '[\"]'
|
||||||
|
let s:delimiter = '\' . s:delimiter
|
||||||
|
endif
|
||||||
|
|
||||||
|
exe 'syn match ' . s:group . ' "\V\\' . s:delimiter . '" contained display'
|
||||||
|
exe 'syn cluster rubySingleCharEscape add=' . s:group
|
||||||
|
exe 'SynFold ''%'' syn region rubyString matchgroup=rubyPercentStringDelimiter start="\V%q' . s:delimiter . '" end="\V' . s:delimiter . '" skip="\V\\\\\|\\' . s:delimiter . '" contains=rubyBackslashEscape,' . s:group . ' nextgroup=@rubyModifier skipwhite'
|
||||||
|
exe 'SynFold ''%'' syn region rubyString matchgroup=rubyPercentStringDelimiter start="\V%w' . s:delimiter . '" end="\V' . s:delimiter . '" skip="\V\\\\\|\\' . s:delimiter . '" contains=rubyBackslashEscape,rubySpaceEscape,' . s:group . ' nextgroup=@rubyModifier skipwhite'
|
||||||
|
exe 'SynFold ''%'' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="\V%s' . s:delimiter . '" end="\V' . s:delimiter . '" skip="\V\\\\\|\\' . s:delimiter . '" contains=rubyBackslashEscape,' . s:group . ' nextgroup=@rubyModifier skipwhite'
|
||||||
|
exe 'SynFold ''%'' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="\V%i' . s:delimiter . '" end="\V' . s:delimiter . '" skip="\V\\\\\|\\' . s:delimiter . '" contains=rubyBackslashEscape,rubySpaceEscape,' . s:group . ' nextgroup=@rubyModifier skipwhite'
|
||||||
|
exe 'hi def link ' . s:group . ' rubyStringEscape'
|
||||||
|
endfor
|
||||||
|
|
||||||
|
unlet s:delimiter s:group s:names
|
||||||
|
" }}}2
|
||||||
|
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q{" end="}" skip="\\\\\|\\}" contains=rubyBackslashEscape,rubyCurlyBracesEscape,rubyNestedCurlyBraces
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q<" end=">" skip="\\\\\|\\>" contains=rubyBackslashEscape,rubyAngleBracketsEscape,rubyNestedAngleBrackets
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q\[" end="\]" skip="\\\\\|\\\]" contains=rubyBackslashEscape,rubySquareBracketsEscape,rubyNestedSquareBrackets
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q(" end=")" skip="\\\\\|\\)" contains=rubyBackslashEscape,rubyParenthesesEscape,rubyNestedParentheses
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=rubyBackslashEscape,rubySpaceEscape
|
||||||
|
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%w{" end="}" skip="\\\\\|\\}" contains=rubyBackslashEscape,rubySpaceEscape,rubyCurlyBracesEscape,rubyNestedCurlyBraces
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%w<" end=">" skip="\\\\\|\\>" contains=rubyBackslashEscape,rubySpaceEscape,rubyAngleBracketsEscape,rubyNestedAngleBrackets
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%w\[" end="\]" skip="\\\\\|\\\]" contains=rubyBackslashEscape,rubySpaceEscape,rubySquareBracketsEscape,rubyNestedSquareBrackets
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%w(" end=")" skip="\\\\\|\\)" contains=rubyBackslashEscape,rubySpaceEscape,rubyParenthesesEscape,rubyNestedParentheses
|
||||||
|
|
||||||
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" contains=rubyBackslashEscape,rubyCurlyBracesEscape,rubyNestedCurlyBraces
|
||||||
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" contains=rubyBackslashEscape,rubyAngleBracketsEscape,rubyNestedAngleBrackets
|
||||||
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" contains=rubyBackslashEscape,rubySquareBracketsEscape,rubyNestedSquareBrackets
|
||||||
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" contains=rubyBackslashEscape,rubyParenthesesEscape,rubyNestedParentheses
|
||||||
|
SynFold '%' syn region rubyString matchgroup=rubyPercentSymbolDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=rubyBackslashEscape,rubySpaceEscape
|
||||||
|
|
||||||
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" contains=rubyBackslashEscape,rubySpaceEscape,rubyCurlyBracesEscape,rubyNestedCurlyBraces
|
||||||
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" contains=rubyBackslashEscape,rubySpaceEscape,rubyAngleBracketsEscape,rubyNestedAngleBrackets
|
||||||
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" contains=rubyBackslashEscape,rubySpaceEscape,rubySquareBracketsEscape,rubyNestedSquareBrackets
|
||||||
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" contains=rubyBackslashEscape,rubySpaceEscape,rubyParenthesesEscape,rubyNestedParentheses
|
||||||
|
|
||||||
|
" Generalized Double Quoted Strings, Symbols, Array of Strings, Array of Symbols and Shell Command Output {{{1
|
||||||
" Note: %= is not matched here as the beginning of a double quoted string
|
" Note: %= is not matched here as the beginning of a double quoted string
|
||||||
if s:foldable('%')
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial nextgroup=@rubyModifier skipwhite
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape fold
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape fold
|
SynFold '%' syn region rubyString matchgroup=rubyPercentStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
|
||||||
else
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape
|
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Array of Symbols {{{1
|
" Array of interpolated Symbols
|
||||||
if s:foldable('%')
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial nextgroup=@rubyModifier skipwhite
|
||||||
" Array of Symbols
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
SynFold '%' syn region rubySymbol matchgroup=rubyPercentSymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape
|
|
||||||
|
|
||||||
" Array of interpolated Symbols
|
" Here Documents {{{1
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
syn region rubyHeredocStart matchgroup=rubyHeredocDelimiter start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"']\)\s\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape fold
|
syn region rubyHeredocStart matchgroup=rubyHeredocDelimiter start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"']\)\s\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold
|
syn region rubyHeredocStart matchgroup=rubyHeredocDelimiter start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"']\)\s\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold
|
syn region rubyHeredocStart matchgroup=rubyHeredocDelimiter start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"']\)\s\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape fold
|
|
||||||
else
|
|
||||||
" Array of Symbols
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1"
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape
|
|
||||||
|
|
||||||
" Array of interpolated Symbols
|
SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"']\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyHeredocDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"']\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyHeredocDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape
|
SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"']\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyHeredocDelimiter end=+^\z1$+ contains=rubyHeredocStart keepend
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape
|
SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})"']\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyHeredocDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape
|
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Here Document {{{1
|
SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyHeredocDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyHeredocDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyHeredocDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart keepend
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
SynFold '<<' syn region rubyString start=+\%(\%(class\|::\|\.\@1<!\.\)\_s*\|\%([]})]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyHeredocDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
|
||||||
|
|
||||||
if s:foldable('<<')
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc fold keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend
|
|
||||||
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart fold keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
|
||||||
else
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend
|
|
||||||
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart keepend
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
|
||||||
endif
|
|
||||||
|
|
||||||
" eRuby Config {{{1
|
|
||||||
if exists('main_syntax') && main_syntax == 'eruby'
|
|
||||||
let b:ruby_no_expensive = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Module, Class, Method and Alias Declarations {{{1
|
" Module, Class, Method and Alias Declarations {{{1
|
||||||
syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite
|
syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable nextgroup=rubyAliasDeclaration2 skipwhite
|
||||||
syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable
|
syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,@rubyGlobalVariable
|
||||||
syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable
|
syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable
|
||||||
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyOperator
|
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyOperator
|
||||||
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyModuleName,rubyOperator
|
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyModuleName,rubyOperator
|
||||||
syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration
|
|
||||||
syn match rubyFunction "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2
|
|
||||||
syn match rubyFunction "\%([[:space:].]\|^\)\@2<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration
|
|
||||||
|
|
||||||
syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter
|
syn match rubyMethodName "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration
|
||||||
|
syn match rubyMethodName "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2
|
||||||
|
syn match rubyMethodName "\%([[:space:].]\|^\)\@1<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration
|
||||||
|
|
||||||
|
syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyMethodName,rubyBlockParameter
|
||||||
|
|
||||||
" Keywords {{{1
|
" Keywords {{{1
|
||||||
" Note: the following keywords have already been defined:
|
" Note: the following keywords have already been defined:
|
||||||
" begin case class def do end for if module unless until while
|
" begin case class def do end for if module unless until while
|
||||||
syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!"
|
syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|retry\|return\)\>[?!]\@!"
|
||||||
syn match rubyOperator "\<defined?" display
|
syn match rubyOperator "\<defined?" display
|
||||||
syn match rubyKeyword "\<\%(super\|yield\)\>[?!]\@!"
|
syn match rubyKeyword "\<\%(super\|yield\)\>[?!]\@!"
|
||||||
syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!"
|
syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!"
|
||||||
syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__dir__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise
|
syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__dir__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise
|
||||||
syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!"
|
syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!"
|
||||||
|
|
||||||
" Expensive Mode {{{1
|
" Expensive Mode {{{1
|
||||||
" Match 'end' with the appropriate opening keyword for syntax based folding
|
" Match 'end' with the appropriate opening keyword for syntax based folding
|
||||||
" and special highlighting of module/class/method definitions
|
" and special highlighting of module/class/method definitions
|
||||||
if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
||||||
syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl
|
syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl
|
||||||
syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
||||||
syn match rubyDefine "\<undef\>" nextgroup=rubyFunction skipwhite skipnl
|
syn match rubyDefine "\<undef\>" nextgroup=rubyMethodName skipwhite skipnl
|
||||||
syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl
|
syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl
|
||||||
syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl
|
syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl
|
||||||
|
|
||||||
if s:foldable('def')
|
SynFold 'def' syn region rubyMethodBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyMethodBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
SynFold 'class' syn region rubyClassBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
else
|
SynFold 'module' syn region rubyModuleBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyMethodBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop
|
|
||||||
endif
|
|
||||||
|
|
||||||
if s:foldable('class')
|
|
||||||
syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
|
||||||
else
|
|
||||||
syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop
|
|
||||||
endif
|
|
||||||
|
|
||||||
if s:foldable('module')
|
|
||||||
syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
|
||||||
else
|
|
||||||
syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop
|
|
||||||
endif
|
|
||||||
|
|
||||||
" modifiers
|
" modifiers
|
||||||
syn match rubyLineContinuation "\\$" nextgroup=rubyConditionalModifier,rubyRepeatModifier skipwhite skipnl
|
syn match rubyLineContinuation "\\$" nextgroup=@rubyModifier skipwhite skipnl
|
||||||
syn match rubyConditionalModifier "\<\%(if\|unless\)\>"
|
syn match rubyConditionalModifier "\<\%(if\|unless\)\>"
|
||||||
syn match rubyRepeatModifier "\<\%(while\|until\)\>"
|
syn match rubyRepeatModifier "\<\%(while\|until\)\>"
|
||||||
|
syn match rubyRescueModifier "\<rescue\>"
|
||||||
|
|
||||||
if s:foldable('do')
|
syn cluster rubyModifier contains=rubyConditionalModifier,rubyRepeatModifier,rubyRescueModifier
|
||||||
syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
|
||||||
else
|
SynFold 'do' syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
|
||||||
endif
|
|
||||||
|
|
||||||
" curly bracket block or hash literal
|
" curly bracket block or hash literal
|
||||||
if s:foldable('{')
|
SynFold '{' syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop fold
|
SynFold '[' syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop
|
||||||
else
|
|
||||||
syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop
|
|
||||||
endif
|
|
||||||
|
|
||||||
if s:foldable('[')
|
|
||||||
syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop fold
|
|
||||||
endif
|
|
||||||
|
|
||||||
" statements without 'do'
|
" statements without 'do'
|
||||||
if s:foldable('begin')
|
SynFold 'begin' syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
SynFold 'case' syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
else
|
|
||||||
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
|
||||||
endif
|
|
||||||
|
|
||||||
if s:foldable('case')
|
SynFold 'if' syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\<then\s\|\%(\<\h\w*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
|
||||||
else
|
|
||||||
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
|
||||||
endif
|
|
||||||
|
|
||||||
if s:foldable('if')
|
|
||||||
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
|
||||||
else
|
|
||||||
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop
|
|
||||||
endif
|
|
||||||
|
|
||||||
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
||||||
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
||||||
|
|
||||||
syn match rubyExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyBlockExpression
|
syn match rubyExceptionHandler "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyBlockExpression,rubyDoBlock
|
||||||
syn match rubyMethodExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyMethodBlock
|
syn match rubyExceptionHandler1 "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyModuleBlock,rubyClassBlock,rubyMethodBlock
|
||||||
|
syn cluster rubyExceptionHandler contains=rubyExceptionHandler,rubyExceptionHandler1
|
||||||
|
|
||||||
" statements with optional 'do'
|
" statements with optional 'do'
|
||||||
syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop
|
syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\h\w*\)\@<![!?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\<do\>" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop
|
||||||
|
|
||||||
if s:foldable('for')
|
SynFold 'for' syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\h\w*\)\@<![!?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine
|
||||||
syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold
|
|
||||||
else
|
|
||||||
syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists("ruby_minlines")
|
if !exists("ruby_minlines")
|
||||||
let ruby_minlines = 500
|
let ruby_minlines = 500
|
||||||
endif
|
endif
|
||||||
exec "syn sync minlines=" . ruby_minlines
|
exe "syn sync minlines=" . ruby_minlines
|
||||||
|
|
||||||
else
|
else
|
||||||
syn match rubyControl "\<def\>[?!]\@!" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
syn match rubyControl "\<def\>[?!]\@!" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
||||||
syn match rubyControl "\<class\>[?!]\@!" nextgroup=rubyClassDeclaration skipwhite skipnl
|
syn match rubyControl "\<class\>[?!]\@!" nextgroup=rubyClassDeclaration skipwhite skipnl
|
||||||
syn match rubyControl "\<module\>[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl
|
syn match rubyControl "\<module\>[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl
|
||||||
syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|ensure\|then\|when\|end\)\>[?!]\@!"
|
syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|rescue\|ensure\|then\|when\|end\)\>[?!]\@!"
|
||||||
syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!"
|
syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -449,53 +412,62 @@ if !exists("ruby_no_special_methods")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Comments and Documentation {{{1
|
" Comments and Documentation {{{1
|
||||||
syn match rubySharpBang "\%^#!.*" display
|
syn match rubySharpBang "\%^#!.*" display
|
||||||
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
|
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
|
||||||
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
|
syn match rubyEncoding "[[:alnum:]-]\+" contained display
|
||||||
|
syn match rubyMagicComment "\c\%<3l#\s*\zs\%(coding\|encoding\):" contained nextgroup=rubyEncoding skipwhite
|
||||||
|
syn match rubyMagicComment "\c\%<10l#\s*\zs\%(frozen_string_literal\|warn_indent\|warn_past_scope\):" contained nextgroup=rubyBoolean skipwhite
|
||||||
|
syn match rubyComment "#.*" contains=@rubyCommentSpecial,rubySpaceError,@Spell
|
||||||
|
|
||||||
|
syn cluster rubyCommentSpecial contains=rubySharpBang,rubyTodo,rubyMagicComment
|
||||||
|
syn cluster rubyCommentNotTop contains=@rubyCommentSpecial,rubyEncoding
|
||||||
|
|
||||||
if !exists("ruby_no_comment_fold") && s:foldable('#')
|
if !exists("ruby_no_comment_fold") && s:foldable('#')
|
||||||
syn region rubyMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
|
syn region rubyMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
|
||||||
syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold
|
syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold
|
||||||
else
|
else
|
||||||
syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell
|
syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" {{{1 Useless line continuations
|
||||||
|
syn match rubyUselessLineContinuation "\%([.:,;{([<>~\*%&^|+=-]\|\w\@1<![?!]\)\s*\zs\\$" nextgroup=rubyUselessLineContinuation skipwhite skipempty
|
||||||
|
syn match rubyUselessLineContinuation "\\$" nextgroup=rubyUselessLineContinuation skipwhite skipempty contained
|
||||||
|
|
||||||
" Keyword Nobbling {{{1
|
" Keyword Nobbling {{{1
|
||||||
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
|
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%([_[:lower:]][_[:alnum:]]*\|\<\%(BEGIN\|END\)\>\)" transparent contains=NONE
|
syn match rubyKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%([_[:lower:]][_[:alnum:]]*\|\<\%(BEGIN\|END\)\>\)" transparent contains=NONE
|
||||||
syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]" transparent contains=NONE
|
syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]" transparent contains=NONE
|
||||||
|
|
||||||
" More Symbols {{{1
|
" More Symbols {{{1
|
||||||
syn match rubySymbol "\%([{(,]\_s*\)\zs\l\w*[!?]\=::\@!"he=e-1
|
syn match rubySymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1
|
||||||
syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1
|
syn match rubySymbol "[]})\"':]\@1<!\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1
|
||||||
syn match rubySymbol "\%([{(,]\_s*\)\zs[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1
|
syn match rubySymbol "\%([{(,]\_s*\)\@<=[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1
|
||||||
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1
|
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1
|
||||||
|
|
||||||
" __END__ Directive {{{1
|
" __END__ Directive {{{1
|
||||||
if s:foldable('__END__')
|
SynFold '__END__' syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$"
|
||||||
syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold
|
|
||||||
else
|
|
||||||
syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$"
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Default Highlighting {{{1
|
" Default Highlighting {{{1
|
||||||
hi def link rubyClass rubyDefine
|
hi def link rubyClass rubyDefine
|
||||||
hi def link rubyModule rubyDefine
|
hi def link rubyModule rubyDefine
|
||||||
hi def link rubyMethodExceptional rubyDefine
|
hi def link rubyExceptionHandler1 rubyDefine
|
||||||
hi def link rubyDefine Define
|
hi def link rubyDefine Define
|
||||||
hi def link rubyAccess rubyMacro
|
hi def link rubyAccess rubyMacro
|
||||||
hi def link rubyAttribute rubyMacro
|
hi def link rubyAttribute rubyMacro
|
||||||
hi def link rubyMacro Macro
|
hi def link rubyMacro Macro
|
||||||
|
hi def link rubyMethodName rubyFunction
|
||||||
hi def link rubyFunction Function
|
hi def link rubyFunction Function
|
||||||
hi def link rubyConditional Conditional
|
hi def link rubyConditional Conditional
|
||||||
hi def link rubyConditionalModifier rubyConditional
|
hi def link rubyConditionalModifier rubyConditional
|
||||||
hi def link rubyExceptional rubyConditional
|
hi def link rubyExceptionHandler rubyConditional
|
||||||
|
hi def link rubyRescueModifier rubyExceptionHandler
|
||||||
hi def link rubyRepeat Repeat
|
hi def link rubyRepeat Repeat
|
||||||
hi def link rubyRepeatModifier rubyRepeat
|
hi def link rubyRepeatModifier rubyRepeat
|
||||||
hi def link rubyOptionalDo rubyRepeat
|
hi def link rubyOptionalDo rubyRepeat
|
||||||
hi def link rubyControl Statement
|
hi def link rubyControl Statement
|
||||||
hi def link rubyInclude Include
|
hi def link rubyInclude Include
|
||||||
hi def link rubyInteger Number
|
hi def link rubyInteger Number
|
||||||
hi def link rubyASCIICode Character
|
hi def link rubyCharacter Character
|
||||||
hi def link rubyFloat Float
|
hi def link rubyFloat Float
|
||||||
hi def link rubyBoolean Boolean
|
hi def link rubyBoolean Boolean
|
||||||
hi def link rubyException Exception
|
hi def link rubyException Exception
|
||||||
@ -515,39 +487,66 @@ hi def link rubyPredefinedConstant rubyPredefinedIdentifier
|
|||||||
hi def link rubyPredefinedVariable rubyPredefinedIdentifier
|
hi def link rubyPredefinedVariable rubyPredefinedIdentifier
|
||||||
hi def link rubySymbol Constant
|
hi def link rubySymbol Constant
|
||||||
hi def link rubyKeyword Keyword
|
hi def link rubyKeyword Keyword
|
||||||
|
|
||||||
hi def link rubyOperator Operator
|
hi def link rubyOperator Operator
|
||||||
|
hi def link rubyDotOperator Operator
|
||||||
|
hi def link rubyTernaryOperator Operator
|
||||||
|
hi def link rubyArithmeticOperator Operator
|
||||||
|
hi def link rubyComparisonOperator Operator
|
||||||
|
hi def link rubyBitwiseOperator Operator
|
||||||
|
hi def link rubyBooleanOperator Operator
|
||||||
|
hi def link rubyRangeOperator Operator
|
||||||
|
hi def link rubyAssignmentOperator Operator
|
||||||
|
hi def link rubyEqualityOperator Operator
|
||||||
|
hi def link rubyScopeOperator Operator
|
||||||
|
|
||||||
hi def link rubyBeginEnd Statement
|
hi def link rubyBeginEnd Statement
|
||||||
hi def link rubyEval Statement
|
hi def link rubyEval Statement
|
||||||
hi def link rubyPseudoVariable Constant
|
hi def link rubyPseudoVariable Constant
|
||||||
hi def link rubyCapitalizedMethod rubyLocalVariableOrMethod
|
hi def link rubyCapitalizedMethod rubyLocalVariableOrMethod
|
||||||
|
|
||||||
hi def link rubyComment Comment
|
hi def link rubyComment Comment
|
||||||
|
hi def link rubyEncoding Constant
|
||||||
|
hi def link rubyMagicComment SpecialComment
|
||||||
hi def link rubyData Comment
|
hi def link rubyData Comment
|
||||||
hi def link rubyDataDirective Delimiter
|
hi def link rubyDataDirective Delimiter
|
||||||
hi def link rubyDocumentation Comment
|
hi def link rubyDocumentation Comment
|
||||||
hi def link rubyTodo Todo
|
hi def link rubyTodo Todo
|
||||||
|
|
||||||
|
hi def link rubyBackslashEscape rubyStringEscape
|
||||||
hi def link rubyQuoteEscape rubyStringEscape
|
hi def link rubyQuoteEscape rubyStringEscape
|
||||||
|
hi def link rubySpaceEscape rubyStringEscape
|
||||||
|
hi def link rubyParenthesesEscape rubyStringEscape
|
||||||
|
hi def link rubyCurlyBracesEscape rubyStringEscape
|
||||||
|
hi def link rubyAngleBracketsEscape rubyStringEscape
|
||||||
|
hi def link rubySquareBracketsEscape rubyStringEscape
|
||||||
hi def link rubyStringEscape Special
|
hi def link rubyStringEscape Special
|
||||||
|
|
||||||
hi def link rubyInterpolationDelimiter Delimiter
|
hi def link rubyInterpolationDelimiter Delimiter
|
||||||
hi def link rubyNoInterpolation rubyString
|
|
||||||
hi def link rubySharpBang PreProc
|
hi def link rubySharpBang PreProc
|
||||||
|
hi def link rubyStringDelimiter Delimiter
|
||||||
|
hi def link rubyHeredocDelimiter rubyStringDelimiter
|
||||||
|
hi def link rubyPercentRegexpDelimiter rubyRegexpDelimiter
|
||||||
|
hi def link rubyPercentStringDelimiter rubyStringDelimiter
|
||||||
|
hi def link rubyPercentSymbolDelimiter rubySymbolDelimiter
|
||||||
hi def link rubyRegexpDelimiter rubyStringDelimiter
|
hi def link rubyRegexpDelimiter rubyStringDelimiter
|
||||||
hi def link rubySymbolDelimiter rubySymbol
|
hi def link rubySymbolDelimiter rubySymbol
|
||||||
hi def link rubyStringDelimiter Delimiter
|
|
||||||
hi def link rubyHeredoc rubyString
|
|
||||||
hi def link rubyString String
|
hi def link rubyString String
|
||||||
hi def link rubyRegexpEscape rubyRegexpSpecial
|
hi def link rubyRegexpEscape rubyRegexpSpecial
|
||||||
hi def link rubyRegexpQuantifier rubyRegexpSpecial
|
hi def link rubyRegexpQuantifier rubyRegexpSpecial
|
||||||
hi def link rubyRegexpAnchor rubyRegexpSpecial
|
hi def link rubyRegexpAnchor rubyRegexpSpecial
|
||||||
hi def link rubyRegexpDot rubyRegexpCharClass
|
hi def link rubyRegexpDot rubyRegexpCharClass
|
||||||
hi def link rubyRegexpCharClass rubyRegexpSpecial
|
hi def link rubyRegexpCharClass rubyRegexpSpecial
|
||||||
|
hi def link rubyRegexpIntersection rubyRegexpSpecial
|
||||||
hi def link rubyRegexpSpecial Special
|
hi def link rubyRegexpSpecial Special
|
||||||
hi def link rubyRegexpComment Comment
|
hi def link rubyRegexpComment Comment
|
||||||
hi def link rubyRegexp rubyString
|
hi def link rubyRegexp rubyString
|
||||||
|
|
||||||
hi def link rubyInvalidVariable Error
|
|
||||||
hi def link rubyError Error
|
hi def link rubyError Error
|
||||||
|
if exists("ruby_line_continuation_error")
|
||||||
|
hi def link rubyUselessLineContinuation rubyError
|
||||||
|
endif
|
||||||
|
hi def link rubyGlobalVariableError rubyError
|
||||||
hi def link rubySpaceError rubyError
|
hi def link rubySpaceError rubyError
|
||||||
|
|
||||||
" Postscript {{{1
|
" Postscript {{{1
|
||||||
@ -556,6 +555,8 @@ let b:current_syntax = "ruby"
|
|||||||
let &cpo = s:cpo_sav
|
let &cpo = s:cpo_sav
|
||||||
unlet! s:cpo_sav
|
unlet! s:cpo_sav
|
||||||
|
|
||||||
|
delc SynFold
|
||||||
|
|
||||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@ -244,8 +244,8 @@ if !exists("b:current_syntax_embed")
|
|||||||
" possible to trick it if you try hard, and indented code blocks aren’t
|
" possible to trick it if you try hard, and indented code blocks aren’t
|
||||||
" supported because Markdown is a menace to parse and only mad dogs and
|
" supported because Markdown is a menace to parse and only mad dogs and
|
||||||
" Englishmen would try to handle that case correctly in this syntax file).
|
" Englishmen would try to handle that case correctly in this syntax file).
|
||||||
syn region rustCommentLinesDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentLineDocLeader
|
syn region rustCommentLinesDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentLineDocLeader
|
||||||
syn region rustCommentBlockDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\%(\s*\*\)\?\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentBlockDocStar
|
syn region rustCommentBlockDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\%(\s*\*\)\?\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentBlockDocStar
|
||||||
" Strictly, this may or may not be correct; this code, for example, would
|
" Strictly, this may or may not be correct; this code, for example, would
|
||||||
" mishighlight:
|
" mishighlight:
|
||||||
"
|
"
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1
|
|||||||
|
|
||||||
" vifm syntax file
|
" vifm syntax file
|
||||||
" Maintainer: xaizek <xaizek@posteo.net>
|
" Maintainer: xaizek <xaizek@posteo.net>
|
||||||
" Last Change: December 19, 2018
|
" Last Change: January 31, 2019
|
||||||
" Inspired By: Vim syntax file by Dr. Charles E. Campbell, Jr.
|
" Inspired By: Vim syntax file by Dr. Charles E. Campbell, Jr.
|
||||||
|
|
||||||
if exists('b:current_syntax')
|
if exists('b:current_syntax')
|
||||||
@ -132,11 +132,11 @@ syntax keyword vifmOption contained aproposprg autochpos caseoptions cdpath cd
|
|||||||
\ lsoptions lsview mediaprg milleroptions millerview mintimeoutlen number nu
|
\ lsoptions lsview mediaprg milleroptions millerview mintimeoutlen number nu
|
||||||
\ numberwidth nuw previewprg quickview relativenumber rnu rulerformat ruf
|
\ numberwidth nuw previewprg quickview relativenumber rnu rulerformat ruf
|
||||||
\ runexec scrollbind scb scrolloff so sort sortgroups sortorder sortnumbers
|
\ runexec scrollbind scb scrolloff so sort sortgroups sortorder sortnumbers
|
||||||
\ shell sh shortmess shm showtabline stal sizefmt slowfs smartcase scs
|
\ shell sh shellflagcmd shcf shortmess shm showtabline stal sizefmt slowfs
|
||||||
\ statusline stl suggestoptions syncregs syscalls tabscope tabstop timefmt
|
\ smartcase scs statusline stl suggestoptions syncregs syscalls tabscope
|
||||||
\ timeoutlen title tm trash trashdir ts tuioptions to undolevels ul vicmd
|
\ tabstop timefmt timeoutlen title tm trash trashdir ts tuioptions to
|
||||||
\ viewcolumns vifminfo vimhelp vixcmd wildmenu wmnu wildstyle wordchars wrap
|
\ undolevels ul vicmd viewcolumns vifminfo vimhelp vixcmd wildmenu wmnu
|
||||||
\ wrapscan ws
|
\ wildstyle wordchars wrap wrapscan ws
|
||||||
|
|
||||||
" Disabled boolean options
|
" Disabled boolean options
|
||||||
syntax keyword vifmOption contained noautochpos nocf nochaselinks nodotfiles
|
syntax keyword vifmOption contained noautochpos nocf nochaselinks nodotfiles
|
||||||
|
Loading…
Reference in New Issue
Block a user