This commit is contained in:
Adam Stankiewicz
2018-12-26 10:41:57 +01:00
parent ec1c943069
commit d43b70d939
47 changed files with 4740 additions and 451 deletions

View File

@@ -21,6 +21,9 @@ function! s:L2U_Setup()
if !has_key(b:, "l2u_cmdtab_set") if !has_key(b:, "l2u_cmdtab_set")
let b:l2u_cmdtab_set = 0 let b:l2u_cmdtab_set = 0
endif endif
if !has_key(b:, "l2u_keymap_set")
let b:l2u_keymap_set = 0
endif
" Did we activate the L2U as-you-type substitutions? " Did we activate the L2U as-you-type substitutions?
if !has_key(b:, "l2u_autosub_set") if !has_key(b:, "l2u_autosub_set")
@@ -76,11 +79,7 @@ function! s:L2U_SetupGlobal()
" A hack to forcibly get out of completion mode: feed " A hack to forcibly get out of completion mode: feed
" this string with feedkeys() " this string with feedkeys()
if has("win32") || has("win64") if has("win32") || has("win64")
if has("gui_running") let s:l2u_esc_sequence = "\u0006"
let s:l2u_esc_sequence = "\u0006"
else
let s:l2u_esc_sequence = "\u0006\b"
endif
else else
let s:l2u_esc_sequence = "\u0091\b" let s:l2u_esc_sequence = "\u0091\b"
end end
@@ -409,8 +408,8 @@ function! LaTeXtoUnicode#FallbackCallback()
return return
endfunction endfunction
" This is the function which is mapped to <S-Tab> in command-line mode " This is the function that performs the substitution in command-line mode
function! LaTeXtoUnicode#CmdTab() function! LaTeXtoUnicode#CmdTab(triggeredbytab)
" first stage " first stage
" analyse command line " analyse command line
let col1 = getcmdpos() - 1 let col1 = getcmdpos() - 1
@@ -419,6 +418,9 @@ function! LaTeXtoUnicode#CmdTab()
let b:l2u_singlebslash = (match(l[0:col1-1], '\\$') >= 0) let b:l2u_singlebslash = (match(l[0:col1-1], '\\$') >= 0)
" completion not found " completion not found
if col0 == -1 if col0 == -1
if a:triggeredbytab
call feedkeys("\<Tab>", 'nt') " fall-back to the default <Tab>
endif
return l return l
endif endif
let base = l[col0 : col1-1] let base = l[col0 : col1-1]
@@ -434,6 +436,9 @@ function! LaTeXtoUnicode#CmdTab()
endif endif
endfor endfor
if len(partmatches) == 0 if len(partmatches) == 0
if a:triggeredbytab
call feedkeys("\<Tab>", 'nt') " fall-back to the default <Tab>
endif
return l return l
endif endif
" exact matches are replaced with Unicode " exact matches are replaced with Unicode
@@ -463,8 +468,13 @@ endfunction
" Setup the L2U tab mapping " Setup the L2U tab mapping
function! s:L2U_SetTab(wait_insert_enter) function! s:L2U_SetTab(wait_insert_enter)
if !b:l2u_cmdtab_set && get(g:, "latex_to_unicode_tab", 1) && b:l2u_enabled if !b:l2u_cmdtab_set && get(g:, "latex_to_unicode_tab", 1) && b:l2u_enabled
cmap <buffer> <S-Tab> <Plug>L2UCmdTab let b:l2u_cmdtab_keys = get(g:, "latex_to_unicode_cmd_mapping", ['<Tab>','<S-Tab>'])
cnoremap <buffer> <Plug>L2UCmdTab <C-\>eLaTeXtoUnicode#CmdTab()<CR> if type(b:l2u_cmdtab_keys) != type([]) " avoid using v:t_list for backward compatibility
let b:l2u_cmdtab_keys = [b:l2u_cmdtab_keys]
endif
for k in b:l2u_cmdtab_keys
exec 'cnoremap <buffer> '.k.' <C-\>eLaTeXtoUnicode#CmdTab('.(k ==? '<Tab>').')<CR>'
endfor
let b:l2u_cmdtab_set = 1 let b:l2u_cmdtab_set = 1
endif endif
if b:l2u_tab_set if b:l2u_tab_set
@@ -500,7 +510,9 @@ endfunction
" Revert the LaTeX-to-Unicode tab mapping settings " Revert the LaTeX-to-Unicode tab mapping settings
function! s:L2U_UnsetTab() function! s:L2U_UnsetTab()
if b:l2u_cmdtab_set if b:l2u_cmdtab_set
cunmap <buffer> <S-Tab> for k in b:l2u_cmdtab_keys
exec 'cunmap <buffer> '.k
endfor
let b:l2u_cmdtab_set = 0 let b:l2u_cmdtab_set = 0
endif endif
if !b:l2u_tab_set if !b:l2u_tab_set
@@ -593,6 +605,21 @@ function! s:L2U_UnsetAutoSub()
let b:l2u_autosub_set = 0 let b:l2u_autosub_set = 0
endfunction endfunction
function! s:L2U_SetKeymap()
if !b:l2u_keymap_set && get(g:, "latex_to_unicode_keymap", 0) && b:l2u_enabled
setlocal keymap=latex2unicode
let b:l2u_keymap_set = 1
endif
endfunction
function! s:L2U_UnsetKeymap()
if !b:l2u_keymap_set
return
endif
setlocal keymap=
let b:l2u_keymap_set = 0
endfunction
" Initialization. Can be used to re-init when global settings have changed. " Initialization. Can be used to re-init when global settings have changed.
function! LaTeXtoUnicode#Init(...) function! LaTeXtoUnicode#Init(...)
let wait_insert_enter = a:0 > 0 ? a:1 : 1 let wait_insert_enter = a:0 > 0 ? a:1 : 1
@@ -605,9 +632,11 @@ function! LaTeXtoUnicode#Init(...)
call s:L2U_UnsetTab() call s:L2U_UnsetTab()
call s:L2U_UnsetAutoSub() call s:L2U_UnsetAutoSub()
call s:L2U_UnsetKeymap()
call s:L2U_SetTab(wait_insert_enter) call s:L2U_SetTab(wait_insert_enter)
call s:L2U_SetAutoSub(wait_insert_enter) call s:L2U_SetAutoSub(wait_insert_enter)
call s:L2U_SetKeymap()
endfunction endfunction
function! LaTeXtoUnicode#Toggle() function! LaTeXtoUnicode#Toggle()

View File

@@ -86,6 +86,34 @@ function! cargo#bench(args)
call cargo#cmd("bench " . a:args) call cargo#cmd("bench " . a:args)
endfunction endfunction
function! cargo#runtarget(args)
let l:filename = expand('%:p')
let l:read_manifest = system('cargo read-manifest')
let l:metadata = json_decode(l:read_manifest)
let l:targets = get(l:metadata, 'targets', [])
let l:did_run = 0
for l:target in l:targets
let l:src_path = get(l:target, 'src_path', '')
let l:kinds = get(l:target, 'kind', [])
let l:name = get(l:target, 'name', '')
if l:src_path == l:filename
if index(l:kinds, 'example') != -1
let l:did_run = 1
call cargo#run("--example " . shellescape(l:name) . " " . a:args)
return
elseif index(l:kinds, 'bin') != -1
let l:did_run = 1
call cargo#run("--bin " . shellescape(l:name) . " " . a:args)
return
endif
endif
endfor
if l:did_run != 1
call cargo#run(a:args)
return
endif
endfunction
" vim: set et sw=4 sts=4 ts=8: " vim: set et sw=4 sts=4 ts=8:
endif endif

View File

@@ -14,7 +14,7 @@ function! cargo#quickfix#CmdPre() abort
endfunction endfunction
function! cargo#quickfix#CmdPost() abort function! cargo#quickfix#CmdPost() abort
if b:rust_compiler_cargo_qf_prev_cd_saved if exists("b:rust_compiler_cargo_qf_prev_cd_saved") && b:rust_compiler_cargo_qf_prev_cd_saved
" Restore the current directory. " Restore the current directory.
if b:rust_compiler_cargo_qf_has_lcd if b:rust_compiler_cargo_qf_has_lcd
execute 'lchdir! '.b:rust_compiler_cargo_qf_prev_cd execute 'lchdir! '.b:rust_compiler_cargo_qf_prev_cd

View File

@@ -349,11 +349,14 @@ function! elm#FindRootDirectory() abort
if empty(l:elm_root) if empty(l:elm_root)
let l:current_file = expand('%:p') let l:current_file = expand('%:p')
let l:dir_current_file = fnameescape(fnamemodify(l:current_file, ':h')) let l:dir_current_file = fnameescape(fnamemodify(l:current_file, ':h'))
let l:match = findfile('elm-package.json', l:dir_current_file . ';') let l:old_match = findfile('elm-package.json', l:dir_current_file . ';')
if empty(l:match) let l:new_match = findfile('elm.json', l:dir_current_file . ';')
let l:elm_root = '' if !empty(l:new_match)
let l:elm_root = fnamemodify(l:new_match, ':p:h')
elseif !empty(l:old_match)
let l:elm_root = fnamemodify(l:old_match, ':p:h')
else else
let l:elm_root = fnamemodify(l:match, ':p:h') let l:elm_root = ''
endif endif
if !empty(l:elm_root) if !empty(l:elm_root)

View File

@@ -1,5 +1,9 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
" don't spam the user when Vim is started in Vi compatibility mode
let s:cpo_save = &cpo
set cpo&vim
function! go#config#AutodetectGopath() abort function! go#config#AutodetectGopath() abort
return get(g:, 'go_autodetect_gopath', 0) return get(g:, 'go_autodetect_gopath', 0)
endfunction endfunction
@@ -137,6 +141,10 @@ function! go#config#SetGuruScope(scope) abort
endif endif
endfunction endfunction
function! go#config#GocodeUnimportedPackages() abort
return get(g:, 'go_gocode_unimported_packages', 0)
endfunction
let s:sock_type = (has('win32') || has('win64')) ? 'tcp' : 'unix' let s:sock_type = (has('win32') || has('win64')) ? 'tcp' : 'unix'
function! go#config#GocodeSocketType() abort function! go#config#GocodeSocketType() abort
return get(g:, 'go_gocode_socket_type', s:sock_type) return get(g:, 'go_gocode_socket_type', s:sock_type)
@@ -147,7 +155,7 @@ function! go#config#GocodeProposeBuiltins() abort
endfunction endfunction
function! go#config#GocodeProposeSource() abort function! go#config#GocodeProposeSource() abort
return get(g:, 'go_gocode_propose_source', 1) return get(g:, 'go_gocode_propose_source', 0)
endfunction endfunction
function! go#config#EchoCommandInfo() abort function! go#config#EchoCommandInfo() abort
@@ -200,7 +208,7 @@ endfunction
function! go#config#DebugCommands() abort function! go#config#DebugCommands() abort
" make sure g:go_debug_commands is set so that it can be added to easily. " make sure g:go_debug_commands is set so that it can be added to easily.
let g:go_debug_commands = get(g:, 'go_debug_commands', {}) let g:go_debug_commands = get(g:, 'go_debug_commands', [])
return g:go_debug_commands return g:go_debug_commands
endfunction endfunction
@@ -308,10 +316,6 @@ function! go#config#DeclsMode() abort
return get(g:, "go_decls_mode", "") return get(g:, "go_decls_mode", "")
endfunction endfunction
function! go#config#DocCommand() abort
return get(g:, "go_doc_command", ["godoc"])
endfunction
function! go#config#FmtCommand() abort function! go#config#FmtCommand() abort
return get(g:, "go_fmt_command", "gofmt") return get(g:, "go_fmt_command", "gofmt")
endfunction endfunction
@@ -354,6 +358,10 @@ function! go#config#BinPath() abort
return get(g:, "go_bin_path", "") return get(g:, "go_bin_path", "")
endfunction endfunction
function! go#config#SearchBinPathFirst() abort
return get(g:, 'go_search_bin_path_first', 1)
endfunction
function! go#config#HighlightArrayWhitespaceError() abort function! go#config#HighlightArrayWhitespaceError() abort
return get(g:, 'go_highlight_array_whitespace_error', 0) return get(g:, 'go_highlight_array_whitespace_error', 0)
endfunction endfunction
@@ -422,6 +430,10 @@ function! go#config#HighlightVariableDeclarations() abort
return get(g:, 'go_highlight_variable_declarations', 0) return get(g:, 'go_highlight_variable_declarations', 0)
endfunction endfunction
function! go#config#HighlightDebug() abort
return get(g:, 'go_highlight_debug', 1)
endfunction
function! go#config#FoldEnable(...) abort function! go#config#FoldEnable(...) abort
if a:0 > 0 if a:0 > 0
return index(go#config#FoldEnable(), a:1) > -1 return index(go#config#FoldEnable(), a:1) > -1
@@ -435,6 +447,10 @@ if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1
unlet g:go_gorename_prefill unlet g:go_gorename_prefill
endif endif
" restore Vi compatibility settings
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2 ts=2 et " vim: sw=2 ts=2 et
endif endif

View File

@@ -1,7 +1,7 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
" This file is autogenerated from the script 'generate_latex_symbols_table.jl' " This file is autogenerated from the script 'generate_latex_symbols_table.jl'
" The symbols are based on Julia version 0.7.0-rc2.0 " The symbols are based on Julia version 1.1.0-DEV.695
scriptencoding utf-8 scriptencoding utf-8

View File

@@ -445,12 +445,12 @@ function! s:SearchTestFunctionNameUnderCursor() abort
let cursor_line = line('.') let cursor_line = line('.')
" Find #[test] attribute " Find #[test] attribute
if search('#\[test]', 'bcW') is 0 if search('\m\C#\[test\]', 'bcW') is 0
return '' return ''
endif endif
" Move to an opening brace of the test function " Move to an opening brace of the test function
let test_func_line = search('^\s*fn\s\+\h\w*\s*(.\+{$', 'eW') let test_func_line = search('\m\C^\s*fn\s\+\h\w*\s*(.\+{$', 'eW')
if test_func_line is 0 if test_func_line is 0
return '' return ''
endif endif
@@ -462,19 +462,36 @@ function! s:SearchTestFunctionNameUnderCursor() abort
return '' return ''
endif endif
return matchstr(getline(test_func_line), '^\s*fn\s\+\zs\h\w*') return matchstr(getline(test_func_line), '\m\C^\s*fn\s\+\zs\h\w*')
endfunction endfunction
function! rust#Test(all, options) abort function! rust#Test(all, options) abort
let pwd = expand('%:p:h') let manifest = findfile('Cargo.toml', expand('%:p:h') . ';')
if findfile('Cargo.toml', pwd . ';') ==# '' if manifest ==# ''
return rust#Run(1, '--test ' . a:options) return rust#Run(1, '--test ' . a:options)
endif endif
let pwd = shellescape(pwd) if exists(':terminal')
let cmd = 'terminal '
else
let cmd = '!'
let manifest = shellescape(manifest)
endif
if a:all if a:all
execute '!cd ' . pwd . ' && cargo test ' . a:options if a:options ==# ''
execute cmd . 'cargo test --manifest-path' manifest
else
execute cmd . 'cargo test --manifest-path' manifest a:options
endif
return
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 return
endif endif
@@ -487,7 +504,13 @@ function! rust#Test(all, options) abort
echohl None echohl None
return return
endif endif
execute '!cd ' . pwd . ' && cargo test ' . func_name . ' ' . a:options let spec = mod_name . '::' . func_name
if a:options ==# ''
execute cmd . 'cargo test --manifest-path' manifest spec
else
execute cmd . 'cargo test --manifest-path' manifest spec a:options
endif
return
finally finally
call setpos('.', saved) call setpos('.', saved)
endtry endtry

View File

@@ -73,6 +73,12 @@ function! rust#debugging#Info() abort
echo l:output echo l:output
version version
if exists(":SyntasticInfo")
echo "----"
echo "Info from Syntastic:"
execute "SyntasticInfo"
endif
endfunction endfunction
function! rust#debugging#InfoToClipboard() abort function! rust#debugging#InfoToClipboard() abort

View File

@@ -24,18 +24,17 @@ endif
function! rustfmt#DetectVersion() function! rustfmt#DetectVersion()
" Save rustfmt '--help' for feature inspection " Save rustfmt '--help' for feature inspection
silent let s:rustfmt_help = system(g:rustfmt_command . " --help") silent let s:rustfmt_help = system(g:rustfmt_command . " --help")
let s:rustfmt_unstable_features = 1 - (s:rustfmt_help !~# "--unstable-features") let s:rustfmt_unstable_features = s:rustfmt_help =~# "--unstable-features"
" Build a comparable rustfmt version varible out of its `--version` output: " Build a comparable rustfmt version varible out of its `--version` output:
silent let s:rustfmt_version = system(g:rustfmt_command . " --version") silent let l:rustfmt_version_full = system(g:rustfmt_command . " --version")
let s:rustfmt_version = matchlist(s:rustfmt_version, '\vrustfmt ([0-9]+[.][0-9]+[.][0-9]+)') let l:rustfmt_version_list = matchlist(l:rustfmt_version_full,
\ '\vrustfmt ([0-9]+[.][0-9]+[.][0-9]+)')
if len(s:rustfmt_version) < 3 if len(l:rustfmt_version_list) < 3
let s:rustfmt_version = "0" let s:rustfmt_version = "0"
else else
let s:rustfmt_version = s:rustfmt_version[1] let s:rustfmt_version = l:rustfmt_version_list[1]
endif endif
return s:rustfmt_version return s:rustfmt_version
endfunction endfunction
@@ -46,7 +45,7 @@ if !exists("g:rustfmt_emit_files")
endif endif
if !exists("g:rustfmt_file_lines") if !exists("g:rustfmt_file_lines")
let g:rustfmt_file_lines = 1 - (s:rustfmt_help !~# "--file-lines JSON") let g:rustfmt_file_lines = s:rustfmt_help =~# "--file-lines JSON"
endif endif
let s:got_fmt_error = 0 let s:got_fmt_error = 0
@@ -87,11 +86,9 @@ function! s:RustfmtCommandRange(filename, line1, line2)
let l:write_mode = s:RustfmtWriteMode() let l:write_mode = s:RustfmtWriteMode()
let l:rustfmt_config = s:RustfmtConfig() let l:rustfmt_config = s:RustfmtConfig()
" FIXME: When --file-lines gets to be stable, enhance this version range checking " FIXME: When --file-lines gets to be stable, add version range checking
" accordingly. " accordingly.
let l:unstable_features = let l:unstable_features = s:rustfmt_unstable_features ? '--unstable-features' : ''
\ (s:rustfmt_unstable_features && (s:rustfmt_version < '1.'))
\ ? '--unstable-features' : ''
let l:cmd = printf("%s %s %s %s %s --file-lines '[%s]' %s", g:rustfmt_command, let l:cmd = printf("%s %s %s %s %s --file-lines '[%s]' %s", g:rustfmt_command,
\ l:write_mode, g:rustfmt_options, \ l:write_mode, g:rustfmt_options,
@@ -119,6 +116,8 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
mkview! mkview!
let l:stderr_tmpname = tempname() let l:stderr_tmpname = tempname()
call writefile([], l:stderr_tmpname)
let l:command = a:command . ' 2> ' . l:stderr_tmpname let l:command = a:command . ' 2> ' . l:stderr_tmpname
if a:tmpname ==# '' if a:tmpname ==# ''
@@ -133,7 +132,8 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
if exists("*systemlist") if exists("*systemlist")
silent let out = systemlist(l:command, l:buffer) silent let out = systemlist(l:command, l:buffer)
else else
silent let out = split(system(l:command, l:buffer), '\r\?\n') silent let out = split(system(l:command,
\ join(l:buffer, "\n")), '\r\?\n')
endif endif
else else
if exists("*systemlist") if exists("*systemlist")

View File

@@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1
" common functions for vifm plugin related to globals " common functions for vifm plugin related to globals
" Maintainer: xaizek <xaizek@posteo.net> " Maintainer: xaizek <xaizek@posteo.net>
" Last Change: January 02, 2018 " Last Change: November 03, 2018
" Initializes global variables to defaults unless they are already set " Initializes global variables to defaults unless they are already set
function! vifm#globals#Init() function! vifm#globals#Init()
@@ -26,6 +26,10 @@ function! vifm#globals#Init()
let g:vifm_term = 'xterm -e' let g:vifm_term = 'xterm -e'
endif endif
endif endif
if !exists('g:vifm_embed_term')
let g:vifm_embed_term = has('gui_running')
endif
endfunction endfunction
endif endif

View File

@@ -11,6 +11,10 @@ if exists("g:current_compiler")
endif endif
let g:current_compiler = "go" let g:current_compiler = "go"
" don't spam the user when Vim is started in Vi compatibility mode
let s:cpo_save = &cpo
set cpo&vim
if exists(":CompilerSet") != 2 if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args> command -nargs=* CompilerSet setlocal <args>
endif endif
@@ -40,6 +44,10 @@ CompilerSet errorformat+=%-G%.%# " All lines not matching a
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" restore Vi compatibility settings
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2 ts=2 et " vim: sw=2 ts=2 et
endif endif

View File

@@ -23,5 +23,7 @@ CompilerSet errorformat=
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
let g:syntastic_nim_checkers = ['nim']
endif endif

View File

@@ -24,7 +24,7 @@ syntax region jsFlowReturnArray contained matchgroup=jsFlowNoise start=/\[/
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
syntax match jsFlowReturnKeyword contained /\k\+/ contains=jsFlowType,jsFlowTypeCustom skipwhite skipempty nextgroup=jsFlowReturnGroup,jsFuncBlock,jsFlowReturnOrOp,jsFlowReturnArray syntax match jsFlowReturnKeyword contained /\k\+/ contains=jsFlowType,jsFlowTypeCustom skipwhite skipempty nextgroup=jsFlowReturnGroup,jsFuncBlock,jsFlowReturnOrOp,jsFlowReturnArray
syntax match jsFlowReturnMaybe contained /?/ skipwhite skipempty nextgroup=jsFlowReturnKeyword,jsFlowReturnObject syntax match jsFlowReturnMaybe contained /?/ skipwhite skipempty nextgroup=jsFlowReturnKeyword,jsFlowReturnObject,jsFlowReturnParens
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

View File

@@ -340,6 +340,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
" go, from gofiletype.vim in fatih/vim-go:_BASIC " go, from gofiletype.vim in fatih/vim-go:_BASIC
" vint: -ProhibitAutocmdWithNoGroup " vint: -ProhibitAutocmdWithNoGroup
" don't spam the user when Vim is started in Vi compatibility mode
let s:cpo_save = &cpo
set cpo&vim
" We take care to preserve the user's fileencodings and fileformats, " We take care to preserve the user's fileencodings and fileformats,
" because those settings are global (not buffer local), yet we want " 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. " to override them for loading Go files, which are defined to be UTF-8.
@@ -361,16 +365,21 @@ function! s:gofiletype_post()
endfunction 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 | setlocal fileencoding=utf-8 fileformat=unix au BufNewFile *.go setfiletype go | if &modifiable | setlocal fileencoding=utf-8 fileformat=unix | endif
au BufRead *.go call s:gofiletype_pre("go") au BufRead *.go call s:gofiletype_pre("go")
au BufReadPost *.go call s:gofiletype_post() au BufReadPost *.go call s:gofiletype_post()
au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix au BufNewFile *.s setfiletype asm | if &modifiable | setlocal fileencoding=utf-8 fileformat=unix | endif
au BufRead *.s call s:gofiletype_pre("asm") au BufRead *.s call s:gofiletype_pre("asm")
au BufReadPost *.s call s:gofiletype_post() au BufReadPost *.s call s:gofiletype_post()
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
" remove the autocommands for modsim3, and lprolog files so that their
" highlight groups, syntax, etc. will not be loaded. *.MOD is included, so
" that on case insensitive file systems the module2 autocmds will not be
" executed.
au! BufNewFile,BufRead *.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 BufNewFile,BufRead go.mod call s:gomod()
@@ -390,6 +399,10 @@ fun! s:gomod()
endfor endfor
endfun endfun
" restore Vi compatibility settings
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2 ts=2 et " vim: sw=2 ts=2 et
augroup end augroup end
endif endif
@@ -397,6 +410,7 @@ endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
augroup filetypedetect augroup filetypedetect
" graphql, from graphql.vim in jparise/vim-graphql " graphql, from graphql.vim in jparise/vim-graphql
" vint: -ProhibitAutocmdWithNoGroup
au BufRead,BufNewFile *.graphql,*.graphqls,*.gql setfiletype graphql au BufRead,BufNewFile *.graphql,*.graphqls,*.gql setfiletype graphql
augroup end augroup end
endif endif
@@ -484,6 +498,7 @@ autocmd BufRead,BufNewFile Jenkinsfile set ft=Jenkinsfile
autocmd BufRead,BufNewFile Jenkinsfile* setf Jenkinsfile autocmd BufRead,BufNewFile Jenkinsfile* setf Jenkinsfile
autocmd BufRead,BufNewFile *.jenkinsfile set ft=Jenkinsfile autocmd BufRead,BufNewFile *.jenkinsfile set ft=Jenkinsfile
autocmd BufRead,BufNewFile *.jenkinsfile setf Jenkinsfile autocmd BufRead,BufNewFile *.jenkinsfile setf Jenkinsfile
autocmd BufRead,BufNewFile *.Jenkinsfile setf Jenkinsfile
augroup end augroup end
endif endif
@@ -912,6 +927,9 @@ au BufNewFile,BufRead Appraisals call s:setf('ruby')
" Autotest " Autotest
au BufNewFile,BufRead .autotest call s:setf('ruby') au BufNewFile,BufRead .autotest call s:setf('ruby')
" Axlsx
au BufNewFile,BufRead *.axlsx call s:setf('ruby')
" Buildr Buildfile " Buildr Buildfile
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby') au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
@@ -1054,7 +1072,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') ==
" terraform, from terraform.vim in hashivim/vim-terraform " terraform, from terraform.vim in hashivim/vim-terraform
au BufRead,BufNewFile *.tf setlocal filetype=terraform au BufRead,BufNewFile *.tf setlocal filetype=terraform
au BufRead,BufNewFile *.tfvars setlocal filetype=terraform au BufRead,BufNewFile *.tfvars setlocal filetype=terraform
au BufRead,BufNewFile *.tfstate setlocal filetype=javascript au BufRead,BufNewFile *.tfstate setlocal filetype=json
au BufRead,BufNewFile *.tfstate.backup setlocal filetype=json
augroup end augroup end
endif endif

View File

@@ -34,7 +34,10 @@ if exists("loaded_matchit")
" note: begin_keywords must contain all blocks in order " note: begin_keywords must contain all blocks in order
" for nested-structures-skipping to work properly " for nested-structures-skipping to work properly
let b:julia_begin_keywords = '\%(\%(\.\s*\)\@<!\|\%(@\s*.\s*\)\@<=\)\<\%(\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|\%(\(abstract\|primitive\)\s\+\)\@<!type\|immutable\|let\|do\|\%(bare\)\?module\|quote\|if\|for\|while\|try\)\>' let b:julia_begin_keywords = '\%(\%(\.\s*\)\@<!\|\%(@\s*.\s*\)\@<=\)\<\%(\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|\%(\(abstract\|primitive\)\s\+\)\@<!type\|immutable\|let\|do\|\%(bare\)\?module\|quote\|if\|for\|while\|try\)\>'
let s:macro_regex = '@\%(#\@!\S\)\+\s\+' " note: the following regex not only recognizes macros, but also local/global keywords.
" the purpose is recognizing things like `@inline myfunction()`
" or `global myfunction(...)` etc, for matchit and block movement functionality
let s:macro_regex = '\%(@\%(#\@!\S\)\+\|\<\%(local\|global\)\)\s\+'
let s:nomacro = '\%(' . s:macro_regex . '\)\@<!' let s:nomacro = '\%(' . s:macro_regex . '\)\@<!'
let s:yesmacro = s:nomacro . '\%('. s:macro_regex . '\)\+' let s:yesmacro = s:nomacro . '\%('. s:macro_regex . '\)\+'
let b:julia_begin_keywordsm = '\%(' . s:yesmacro . b:julia_begin_keywords . '\)\|' let b:julia_begin_keywordsm = '\%(' . s:yesmacro . b:julia_begin_keywords . '\)\|'
@@ -46,7 +49,7 @@ if exists("loaded_matchit")
let [l,c] = [line('.'),col('.')] let [l,c] = [line('.'),col('.')]
let attr = synIDattr(synID(l, c, 1),"name") let attr = synIDattr(synID(l, c, 1),"name")
let c1 = c let c1 = c
while attr == 'juliaMacro' while attr == 'juliaMacro' || expand('<cword>') =~# '\<\%(global\|local\)\>'
normal! W normal! W
if line('.') > l || col('.') == c1 if line('.') > l || col('.') == c1
call cursor(l, c) call cursor(l, c)

View File

@@ -1,9 +1,9 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
if exists('g:loaded_mustache_handlebars') && g:loaded_mustache_handlebars if exists('b:loaded_mustache_handlebars')
finish finish
endif endif
let g:loaded_mustache_handlebars = 1 let b:loaded_mustache_handlebars = 1
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim

View File

@@ -17,176 +17,178 @@ let s:save_cpo = &cpo
set cpo&vim set cpo&vim
" vint: +ProhibitAbbreviationOption " vint: +ProhibitAbbreviationOption
augroup rust.vim if get(b:, 'current_compiler', '') ==# ''
autocmd! if strlen(findfile('Cargo.toml', '.;')) > 0
compiler cargo
if get(b:, 'current_compiler', '') ==# ''
if strlen(findfile('Cargo.toml', '.;')) > 0
compiler cargo
else
compiler rustc
endif
endif
" Variables {{{1
" The rust source code at present seems to typically omit a leader on /*!
" comments, so we'll use that as our default, but make it easy to switch.
" This does not affect indentation at all (I tested it with and without
" leader), merely whether a leader is inserted by default or not.
if get(g:, 'rust_bang_comment_leader', 0)
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
" but without it, */ gets indented one space even if there were no
" leaders. I'm fairly sure that's a Vim bug.
setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,://
else else
setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// compiler rustc
endif endif
setlocal commentstring=//%s endif
setlocal formatoptions-=t formatoptions+=croqnl
" j was only added in 7.3.541, so stop complaints about its nonexistence
silent! setlocal formatoptions+=j
" smartindent will be overridden by indentexpr if filetype indent is on, but " Variables {{{1
" otherwise it's better than nothing.
setlocal smartindent nocindent
if get(g:, 'rust_recommended_style', 1) " The rust source code at present seems to typically omit a leader on /*!
let b:rust_set_style = 1 " comments, so we'll use that as our default, but make it easy to switch.
setlocal tabstop=8 shiftwidth=4 softtabstop=4 expandtab " This does not affect indentation at all (I tested it with and without
setlocal textwidth=99 " leader), merely whether a leader is inserted by default or not.
if get(g:, 'rust_bang_comment_leader', 0)
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
" but without it, */ gets indented one space even if there were no
" leaders. I'm fairly sure that's a Vim bug.
setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,://
else
setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
endif
setlocal commentstring=//%s
setlocal formatoptions-=t formatoptions+=croqnl
" j was only added in 7.3.541, so stop complaints about its nonexistence
silent! setlocal formatoptions+=j
" smartindent will be overridden by indentexpr if filetype indent is on, but
" otherwise it's better than nothing.
setlocal smartindent nocindent
if get(g:, 'rust_recommended_style', 1)
let b:rust_set_style = 1
setlocal tabstop=8 shiftwidth=4 softtabstop=4 expandtab
setlocal textwidth=99
endif
" This includeexpr isn't perfect, but it's a good start
setlocal includeexpr=substitute(v:fname,'::','/','g')
setlocal suffixesadd=.rs
if exists("g:ftplugin_rust_source_path")
let &l:path=g:ftplugin_rust_source_path . ',' . &l:path
endif
if exists("g:loaded_delimitMate")
if exists("b:delimitMate_excluded_regions")
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
endif endif
" This includeexpr isn't perfect, but it's a good start augroup rust.vim.DelimitMate
setlocal includeexpr=substitute(v:fname,'::','/','g') autocmd!
setlocal suffixesadd=.rs
if exists("g:ftplugin_rust_source_path")
let &l:path=g:ftplugin_rust_source_path . ',' . &l:path
endif
if exists("g:loaded_delimitMate")
if exists("b:delimitMate_excluded_regions")
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
endif
autocmd User delimitMate_map :call rust#delimitmate#onMap() autocmd User delimitMate_map :call rust#delimitmate#onMap()
autocmd User delimitMate_unmap :call rust#delimitmate#onUnmap() autocmd User delimitMate_unmap :call rust#delimitmate#onUnmap()
augroup END
endif
" Integration with auto-pairs (https://github.com/jiangmiao/auto-pairs)
if exists("g:AutoPairsLoaded") && !get(g:, 'rust_keep_autopairs_default', 0)
let b:AutoPairs = {'(':')', '[':']', '{':'}','"':'"', '`':'`'}
endif
if has("folding") && get(g:, 'rust_fold', 0)
let b:rust_set_foldmethod=1
setlocal foldmethod=syntax
if g:rust_fold == 2
setlocal foldlevel<
else
setlocal foldlevel=99
endif endif
endif
" Integration with auto-pairs (https://github.com/jiangmiao/auto-pairs) if has('conceal') && get(g:, 'rust_conceal', 0)
if exists("g:AutoPairsLoaded") && !get(g:, 'rust_keep_autopairs_default', 0) let b:rust_set_conceallevel=1
let b:AutoPairs = {'(':')', '[':']', '{':'}','"':'"', '`':'`'} setlocal conceallevel=2
endif endif
if has("folding") && get(g:, 'rust_fold', 0) " Motion Commands {{{1
let b:rust_set_foldmethod=1
setlocal foldmethod=syntax
if g:rust_fold == 2
setlocal foldlevel<
else
setlocal foldlevel=99
endif
endif
if has('conceal') && get(g:, 'rust_conceal', 0) " Bind motion commands to support hanging indents
let b:rust_set_conceallevel=1 nnoremap <silent> <buffer> [[ :call rust#Jump('n', 'Back')<CR>
setlocal conceallevel=2 nnoremap <silent> <buffer> ]] :call rust#Jump('n', 'Forward')<CR>
endif xnoremap <silent> <buffer> [[ :call rust#Jump('v', 'Back')<CR>
xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
" Motion Commands {{{1 " Commands {{{1
" Bind motion commands to support hanging indents " See |:RustRun| for docs
nnoremap <silent> <buffer> [[ :call rust#Jump('n', 'Back')<CR> command! -nargs=* -complete=file -bang -buffer RustRun call rust#Run(<bang>0, <q-args>)
nnoremap <silent> <buffer> ]] :call rust#Jump('n', 'Forward')<CR>
xnoremap <silent> <buffer> [[ :call rust#Jump('v', 'Back')<CR>
xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
" Commands {{{1 " See |:RustExpand| for docs
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -buffer RustExpand call rust#Expand(<bang>0, <q-args>)
" See |:RustRun| for docs " See |:RustEmitIr| for docs
command! -nargs=* -complete=file -bang -buffer RustRun call rust#Run(<bang>0, <q-args>) command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>)
" See |:RustExpand| for docs " See |:RustEmitAsm| for docs
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -buffer RustExpand call rust#Expand(<bang>0, <q-args>) command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
" See |:RustEmitIr| for docs " See |:RustPlay| for docs
command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>) command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
" See |:RustEmitAsm| for docs " See |:RustFmt| for docs
command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>) command! -buffer RustFmt call rustfmt#Format()
" See |:RustPlay| for docs " See |:RustFmtRange| for docs
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>) command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
" See |:RustFmt| for docs " See |:RustInfo| for docs
command! -buffer RustFmt call rustfmt#Format() command! -bar RustInfo call rust#debugging#Info()
" See |:RustFmtRange| for docs " See |:RustInfoToClipboard| for docs
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>) command! -bar RustInfoToClipboard call rust#debugging#InfoToClipboard()
" See |:RustInfo| for docs " See |:RustInfoToFile| for docs
command! -bar RustInfo call rust#debugging#Info() command! -bar -nargs=1 RustInfoToFile call rust#debugging#InfoToFile(<f-args>)
" See |:RustInfoToClipboard| for docs " See |:RustTest| for docs
command! -bar RustInfoToClipboard call rust#debugging#InfoToClipboard() command! -buffer -nargs=* -bang RustTest call rust#Test(<bang>0, <q-args>)
" See |:RustInfoToFile| for docs if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
command! -bar -nargs=1 RustInfoToFile call rust#debugging#InfoToFile(<f-args>) let b:rust_last_rustc_args = []
let b:rust_last_args = []
endif
" See |:RustTest| for docs " Cleanup {{{1
command! -buffer -nargs=* -bang RustTest call rust#Test(<bang>0, <q-args>)
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args") let b:undo_ftplugin = "
let b:rust_last_rustc_args = [] \ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
let b:rust_last_args = [] \|if exists('b:rust_set_style')
endif \|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
\|endif
" Cleanup {{{1 \|if exists('b:rust_original_delimitMate_excluded_regions')
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
let b:undo_ftplugin = " \|unlet b:rust_original_delimitMate_excluded_regions
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd< \|else
\|if exists('b:rust_set_style') \|unlet! b:delimitMate_excluded_regions
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth< \|endif
\|endif \|if exists('b:rust_set_foldmethod')
\|if exists('b:rust_original_delimitMate_excluded_regions') \|setlocal foldmethod< foldlevel<
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions \|unlet b:rust_set_foldmethod
\|unlet b:rust_original_delimitMate_excluded_regions
\|else
\|unlet! b:delimitMate_excluded_regions
\|endif \|endif
\|if exists('b:rust_set_foldmethod') \|if exists('b:rust_set_conceallevel')
\|setlocal foldmethod< foldlevel< \|setlocal conceallevel<
\|unlet b:rust_set_foldmethod \|unlet b:rust_set_conceallevel
\|endif \|endif
\|if exists('b:rust_set_conceallevel') \|unlet! b:rust_last_rustc_args b:rust_last_args
\|setlocal conceallevel< \|delcommand RustRun
\|unlet b:rust_set_conceallevel \|delcommand RustExpand
\|endif \|delcommand RustEmitIr
\|unlet! b:rust_last_rustc_args b:rust_last_args \|delcommand RustEmitAsm
\|delcommand RustRun \|delcommand RustPlay
\|delcommand RustExpand \|nunmap <buffer> [[
\|delcommand RustEmitIr \|nunmap <buffer> ]]
\|delcommand RustEmitAsm \|xunmap <buffer> [[
\|delcommand RustPlay \|xunmap <buffer> ]]
\|nunmap <buffer> [[ \|ounmap <buffer> [[
\|nunmap <buffer> ]] \|ounmap <buffer> ]]
\|xunmap <buffer> [[ \|setlocal matchpairs-=<:>
\|xunmap <buffer> ]] \|unlet b:match_skip
\|ounmap <buffer> [[ \"
\|ounmap <buffer> ]]
\|setlocal matchpairs-=<:>
\|unlet b:match_skip
\"
" }}}1 " }}}1
" Code formatting on save " Code formatting on save
augroup rust.vim.PreWrite
autocmd!
autocmd BufWritePre <buffer> silent! call rustfmt#PreWrite() autocmd BufWritePre <buffer> silent! call rustfmt#PreWrite()
augroup END augroup END
setlocal matchpairs+=<:> setlocal matchpairs+=<:>

View File

@@ -61,9 +61,9 @@ endfunction
augroup terraform augroup terraform
autocmd! autocmd!
autocmd VimEnter * autocmd BufEnter *
\ command! -nargs=+ -complete=custom,s:commands Terraform execute '!terraform '.<q-args>. ' -no-color' \ command! -nargs=+ -complete=custom,s:commands Terraform execute '!terraform '.<q-args>. ' -no-color'
autocmd VimEnter * command! -nargs=0 TerraformFmt call terraform#fmt() autocmd BufEnter * command! -nargs=0 TerraformFmt call terraform#fmt()
if get(g:, "terraform_fmt_on_save", 1) if get(g:, "terraform_fmt_on_save", 1)
autocmd BufWritePre *.tf call terraform#fmt() autocmd BufWritePre *.tf call terraform#fmt()
autocmd BufWritePre *.tfvars call terraform#fmt() autocmd BufWritePre *.tfvars call terraform#fmt()

View File

@@ -20,9 +20,4 @@ if !exists('g:no_plugin_maps') && !exists('g:no_vue_maps')
nnoremap <silent> <buffer> ][ :call search('^</\(template\<Bar>script\<Bar>style\)', 'W')<CR> nnoremap <silent> <buffer> ][ :call search('^</\(template\<Bar>script\<Bar>style\)', 'W')<CR>
endif endif
" Run only ESLint for Vue files by default.
" linters specifically for Vue can still be loaded.
let b:ale_linter_aliases = get(get(g:, 'ale_linter_aliases', {}), 'vue', ['vue', 'javascript'])
let b:ale_linters = get(get(g:, 'ale_linters', {}), 'vue', ['eslint', 'vls'])
endif endif

View File

@@ -40,6 +40,15 @@ if !exists('g:python_pep8_indent_hang_closing')
let g:python_pep8_indent_hang_closing = 0 let g:python_pep8_indent_hang_closing = 0
endif endif
" TODO: check required patch for timeout argument, likely lower than 7.3.429 though.
if !exists('g:python_pep8_indent_searchpair_timeout')
if has('patch-8.0.1483')
let g:python_pep8_indent_searchpair_timeout = 150
else
let g:python_pep8_indent_searchpair_timeout = 0
endif
endif
let s:block_rules = { let s:block_rules = {
\ '^\s*elif\>': ['if', 'elif'], \ '^\s*elif\>': ['if', 'elif'],
\ '^\s*except\>': ['try', 'except'], \ '^\s*except\>': ['try', 'except'],
@@ -59,29 +68,35 @@ else
endif endif
let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>' let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>'
" Skip strings and comments. Return 1 for chars to skip.
" jedi* refers to syntax definitions from jedi-vim for call signatures, which
" are inserted temporarily into the buffer.
let s:skip_special_chars = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
\ '=~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"'
let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' . let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
\ '=~? "\\vcomment|jedi\\S"' \ '=~? "\\vcomment|jedi\\S"'
" Also ignore anything concealed. if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
" Wrapper around synconcealed for older Vim (7.3.429, used on Travis CI). " Skip strings and comments. Return 1 for chars to skip.
function! s:is_concealed(line, col) " jedi* refers to syntax definitions from jedi-vim for call signatures, which
let concealed = synconcealed(a:line, a:col) " are inserted temporarily into the buffer.
return len(concealed) && concealed[0] function! s:_skip_special_chars(line, col)
endfunction return synIDattr(synID(a:line, a:col, 0), 'name')
if has('conceal') \ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
let s:skip_special_chars .= '|| s:is_concealed(line("."), col("."))' endfunction
else
" Also ignore anything concealed.
" TODO: doc; likely only necessary with jedi-vim, where a better version is
" planned (https://github.com/Vimjas/vim-python-pep8-indent/pull/98).
" Wrapper around synconcealed for older Vim (7.3.429, used on Travis CI).
function! s:is_concealed(line, col)
let concealed = synconcealed(a:line, a:col)
return len(concealed) && concealed[0]
endfunction
function! s:_skip_special_chars(line, col)
return synIDattr(synID(a:line, a:col, 0), 'name')
\ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
\ || s:is_concealed(a:line, a:col)
endfunction
endif endif
let s:skip_search = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
\ '=~? "comment"'
" Use 'shiftwidth()' instead of '&sw'. " Use 'shiftwidth()' instead of '&sw'.
" (Since Vim patch 7.3.629, 'shiftwidth' can be set to 0 to follow 'tabstop'). " (Since Vim patch 7.3.629, 'shiftwidth' can be set to 0 to follow 'tabstop').
if exists('*shiftwidth') if exists('*shiftwidth')
@@ -95,24 +110,21 @@ else
endif endif
" Find backwards the closest open parenthesis/bracket/brace. " Find backwards the closest open parenthesis/bracket/brace.
function! s:find_opening_paren(...) function! s:find_opening_paren(lnum, col)
" optional arguments: line and column (defaults to 1) to search around " Return if cursor is in a comment.
if a:0 > 0 if synIDattr(synID(a:lnum, a:col, 0), 'name') =~? 'comment'
let view = winsaveview() return [0, 0]
call cursor(a:1, a:0 > 1 ? a:2 : 1)
let ret = s:find_opening_paren()
call winrestview(view)
return ret
endif endif
" Return if cursor is in a comment. call cursor(a:lnum, a:col)
exe 'if' s:skip_search '| return [0, 0] | endif'
let nearest = [0, 0] let nearest = [0, 0]
let timeout = g:python_pep8_indent_searchpair_timeout
let skip_special_chars = 's:_skip_special_chars(line("."), col("."))'
for [p, maxoff] in items(s:paren_pairs) for [p, maxoff] in items(s:paren_pairs)
let stopline = max([0, line('.') - maxoff, nearest[0]]) let stopline = max([0, line('.') - maxoff, nearest[0]])
let next = searchpairpos( let next = searchpairpos(
\ '\V'.p[0], '', '\V'.p[1], 'bnW', s:skip_special_chars, stopline) \ '\V'.p[0], '', '\V'.p[1], 'bnW', skip_special_chars, stopline, timeout)
if next[0] && (next[0] > nearest[0] || (next[0] == nearest[0] && next[1] > nearest[1])) if next[0] && (next[0] > nearest[0] || (next[0] == nearest[0] && next[1] > nearest[1]))
let nearest = next let nearest = next
endif endif
@@ -127,7 +139,7 @@ function! s:find_start_of_multiline_statement(lnum)
if getline(lnum - 1) =~# '\\$' if getline(lnum - 1) =~# '\\$'
let lnum = prevnonblank(lnum - 1) let lnum = prevnonblank(lnum - 1)
else else
let [paren_lnum, _] = s:find_opening_paren(lnum) let [paren_lnum, _] = s:find_opening_paren(lnum, 1)
if paren_lnum < 1 if paren_lnum < 1
return lnum return lnum
else else
@@ -184,7 +196,7 @@ endfunction
" Line up with open parenthesis/bracket/brace. " Line up with open parenthesis/bracket/brace.
function! s:indent_like_opening_paren(lnum) function! s:indent_like_opening_paren(lnum)
let [paren_lnum, paren_col] = s:find_opening_paren(a:lnum) let [paren_lnum, paren_col] = s:find_opening_paren(a:lnum, 1)
if paren_lnum <= 0 if paren_lnum <= 0
return -2 return -2
endif endif
@@ -214,7 +226,7 @@ function! s:indent_like_opening_paren(lnum)
" from the next logical line. " from the next logical line.
if text =~# b:control_statement && res == base + s:sw() if text =~# b:control_statement && res == base + s:sw()
" But only if not inside parens itself (Flake's E127). " But only if not inside parens itself (Flake's E127).
let [paren_lnum, _] = s:find_opening_paren(paren_lnum) let [paren_lnum, _] = s:find_opening_paren(paren_lnum, 1)
if paren_lnum <= 0 if paren_lnum <= 0
return res + s:sw() return res + s:sw()
endif endif
@@ -267,24 +279,23 @@ function! s:indent_like_previous_line(lnum)
let base = indent(start) let base = indent(start)
let current = indent(a:lnum) let current = indent(a:lnum)
" Jump to last character in previous line. " Ignore last character in previous line?
call cursor(lnum, len(text)) let lastcol = len(text)
let ignore_last_char = eval(s:skip_special_chars) let col = lastcol
" Search for final colon that is not inside something to be ignored. " Search for final colon that is not inside something to be ignored.
while 1 while 1
let curpos = getpos('.')[2] if col == 1 | break | endif
if curpos == 1 | break | endif if text[col-1] =~# '\s' || s:_skip_special_chars(lnum, col)
if eval(s:skip_special_chars) || text[curpos-1] =~# '\s' let col = col - 1
normal! h
continue continue
elseif text[curpos-1] ==# ':' elseif text[col-1] ==# ':'
return base + s:sw() return base + s:sw()
endif endif
break break
endwhile endwhile
if text =~# '\\$' && !ignore_last_char if text =~# '\\$' && !s:_skip_special_chars(lnum, lastcol)
" If this line is the continuation of a control statement " If this line is the continuation of a control statement
" indent further to distinguish the continuation line " indent further to distinguish the continuation line
" from the next logical line. " from the next logical line.
@@ -315,7 +326,7 @@ function! s:indent_like_previous_line(lnum)
return -1 return -1
endif endif
if !empty && s:is_dedented_already(current, base) if (current || !empty) && s:is_dedented_already(current, base)
return -1 return -1
endif endif
@@ -366,11 +377,12 @@ function! GetPythonPEPIndent(lnum)
if match_quotes != -1 if match_quotes != -1
" closing multiline string " closing multiline string
let quotes = line[match_quotes:(match_quotes+2)] let quotes = line[match_quotes:(match_quotes+2)]
let pairpos = searchpairpos(quotes, '', quotes, 'b') call cursor(a:lnum, 1)
let pairpos = searchpairpos(quotes, '', quotes, 'bW', '', 0, g:python_pep8_indent_searchpair_timeout)
if pairpos[0] != 0 if pairpos[0] != 0
return indent(pairpos[0]) return indent(pairpos[0])
else else
" TODO: test to cover this! return -1
endif endif
endif endif

View File

@@ -26,7 +26,11 @@ if exists("*GoIndent")
finish finish
endif endif
function! GoIndent(lnum) " don't spam the user when Vim is started in Vi compatibility mode
let s:cpo_save = &cpo
set cpo&vim
function! GoIndent(lnum) abort
let prevlnum = prevnonblank(a:lnum-1) let prevlnum = prevnonblank(a:lnum-1)
if prevlnum == 0 if prevlnum == 0
" top of file " top of file
@@ -40,10 +44,17 @@ function! GoIndent(lnum)
let ind = previ let ind = previ
if prevl =~ ' = `[^`]*$' for synid in synstack(a:lnum, 1)
" previous line started a multi-line raw string if synIDattr(synid, 'name') == 'goRawString'
return 0 if prevl =~ '\%(\%(:\?=\)\|(\|,\)\s*`[^`]*$'
endif " previous line started a multi-line raw string
return 0
endif
" return -1 to keep the current indent.
return -1
endif
endfor
if prevl =~ '[({]\s*$' if prevl =~ '[({]\s*$'
" previous line opened a block " previous line opened a block
let ind += shiftwidth() let ind += shiftwidth()
@@ -70,6 +81,10 @@ function! GoIndent(lnum)
return ind return ind
endfunction endfunction
" restore Vi compatibility settings
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2 ts=2 et " vim: sw=2 ts=2 et
endif endif

View File

@@ -15,6 +15,10 @@ if exists("*GetGoHTMLTmplIndent")
finish finish
endif endif
" don't spam the user when Vim is started in Vi compatibility mode
let s:cpo_save = &cpo
set cpo&vim
function! GetGoHTMLTmplIndent(lnum) function! GetGoHTMLTmplIndent(lnum)
" Get HTML indent " Get HTML indent
if exists('*HtmlIndent') if exists('*HtmlIndent')
@@ -45,6 +49,10 @@ function! GetGoHTMLTmplIndent(lnum)
return ind return ind
endfunction endfunction
" restore Vi compatibility settings
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2 ts=2 et " vim: sw=2 ts=2 et
endif endif

View File

@@ -4,8 +4,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') ==
" Language: Mustache, Handlebars " Language: Mustache, Handlebars
" Maintainer: Juvenn Woo <machese@gmail.com> " Maintainer: Juvenn Woo <machese@gmail.com>
" Screenshot: http://imgur.com/6F408 " Screenshot: http://imgur.com/6F408
" Version: 2 " Version: 3
" Last Change: Oct 10th 2015 " Last Change: 26 Nov 2018
" Remarks: based on eruby indent plugin by tpope " Remarks: based on eruby indent plugin by tpope
" References: " References:
" [Mustache](http://github.com/defunkt/mustache) " [Mustache](http://github.com/defunkt/mustache)
@@ -21,6 +21,9 @@ endif
unlet! b:did_indent unlet! b:did_indent
setlocal indentexpr= setlocal indentexpr=
" keep track of whether or not we are in a block expression for indenting
unlet! s:in_block_expr
runtime! indent/html.vim runtime! indent/html.vim
unlet! b:did_indent unlet! b:did_indent
@@ -75,26 +78,48 @@ function! GetHandlebarsIndent(...)
let b:indent.lnum = -1 let b:indent.lnum = -1
endif endif
let lnum = prevnonblank(v:lnum-1) let lnum = prevnonblank(v:lnum-1)
let line = getline(lnum) let prevLine = getline(lnum)
let cline = getline(v:lnum) let currentLine = getline(v:lnum)
" all indent rules only apply if the block opening/closing " all indent rules only apply if the block opening/closing
" tag is on a separate line " tag is on a separate line
" indent after block {{#block " indent after block {{#block
if line =~# '\v\s*\{\{\#.*\s*' if prevLine =~# '\v\s*\{\{\#.*\s*'
let s:in_block_expr = 1
let ind = ind + sw let ind = ind + sw
endif endif
" unindent after block close {{/block}} " but not if the block ends on the same line
if cline =~# '\v^\s*\{\{\/\S*\}\}\s*' if prevLine =~# '\v\s*\{\{\#(.+)(\s+|\}\}).*\{\{\/\1'
let s:in_block_expr = 0
let ind = ind - sw let ind = ind - sw
endif endif
" unindent after block close {{/block}}
if currentLine =~# '\v^\s*\{\{\/\S*\}\}\s*'
let s:in_block_expr = 0
let ind = ind - sw
endif
" indent after component block {{a-component
if prevLine =~# '\v\s*\{\{\w'
let s:in_block_expr = 0
let ind = ind + sw
endif
" but not if the component block ends on the same line
if prevLine =~# '\v\s*\{\{\w(.+)\}\}'
let ind = ind - sw
endif
" unindent }} lines, and following lines if not inside a block expression
if currentLine =~# '\v^\s*\}\}\s*$' || (currentLine !~# '\v^\s*\{\{\/' && prevLine =~# '\v^\s*[^\{\} \t]+\}\}\s*$')
if !s:in_block_expr
let ind = ind - sw
endif
endif
" unindent {{else}} " unindent {{else}}
if cline =~# '\v^\s*\{\{else.*\}\}\s*$' if currentLine =~# '\v^\s*\{\{else.*\}\}\s*$'
let ind = ind - sw let ind = ind - sw
endif endif
" indent again after {{else}} " indent again after {{else}}
if line =~# '\v^\s*\{\{else.*\}\}\s*$' if prevLine =~# '\v^\s*\{\{else.*\}\}\s*$'
let ind = ind + sw let ind = ind + sw
endif endif

View File

@@ -113,7 +113,7 @@ function GetLuaIndent()
" restore cursor " restore cursor
call setpos(".", original_cursor_pos) call setpos(".", original_cursor_pos)
return indent(prev_line) + (&sw * i) return indent(prev_line) + (shiftwidth() * i)
endfunction endfunction

View File

@@ -40,6 +40,15 @@ if !exists('g:python_pep8_indent_hang_closing')
let g:python_pep8_indent_hang_closing = 0 let g:python_pep8_indent_hang_closing = 0
endif endif
" TODO: check required patch for timeout argument, likely lower than 7.3.429 though.
if !exists('g:python_pep8_indent_searchpair_timeout')
if has('patch-8.0.1483')
let g:python_pep8_indent_searchpair_timeout = 150
else
let g:python_pep8_indent_searchpair_timeout = 0
endif
endif
let s:block_rules = { let s:block_rules = {
\ '^\s*elif\>': ['if', 'elif'], \ '^\s*elif\>': ['if', 'elif'],
\ '^\s*except\>': ['try', 'except'], \ '^\s*except\>': ['try', 'except'],
@@ -59,29 +68,35 @@ else
endif endif
let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>' let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>'
" Skip strings and comments. Return 1 for chars to skip.
" jedi* refers to syntax definitions from jedi-vim for call signatures, which
" are inserted temporarily into the buffer.
let s:skip_special_chars = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
\ '=~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"'
let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' . let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
\ '=~? "\\vcomment|jedi\\S"' \ '=~? "\\vcomment|jedi\\S"'
" Also ignore anything concealed. if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
" Wrapper around synconcealed for older Vim (7.3.429, used on Travis CI). " Skip strings and comments. Return 1 for chars to skip.
function! s:is_concealed(line, col) " jedi* refers to syntax definitions from jedi-vim for call signatures, which
let concealed = synconcealed(a:line, a:col) " are inserted temporarily into the buffer.
return len(concealed) && concealed[0] function! s:_skip_special_chars(line, col)
endfunction return synIDattr(synID(a:line, a:col, 0), 'name')
if has('conceal') \ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
let s:skip_special_chars .= '|| s:is_concealed(line("."), col("."))' endfunction
else
" Also ignore anything concealed.
" TODO: doc; likely only necessary with jedi-vim, where a better version is
" planned (https://github.com/Vimjas/vim-python-pep8-indent/pull/98).
" Wrapper around synconcealed for older Vim (7.3.429, used on Travis CI).
function! s:is_concealed(line, col)
let concealed = synconcealed(a:line, a:col)
return len(concealed) && concealed[0]
endfunction
function! s:_skip_special_chars(line, col)
return synIDattr(synID(a:line, a:col, 0), 'name')
\ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
\ || s:is_concealed(a:line, a:col)
endfunction
endif endif
let s:skip_search = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
\ '=~? "comment"'
" Use 'shiftwidth()' instead of '&sw'. " Use 'shiftwidth()' instead of '&sw'.
" (Since Vim patch 7.3.629, 'shiftwidth' can be set to 0 to follow 'tabstop'). " (Since Vim patch 7.3.629, 'shiftwidth' can be set to 0 to follow 'tabstop').
if exists('*shiftwidth') if exists('*shiftwidth')
@@ -95,24 +110,21 @@ else
endif endif
" Find backwards the closest open parenthesis/bracket/brace. " Find backwards the closest open parenthesis/bracket/brace.
function! s:find_opening_paren(...) function! s:find_opening_paren(lnum, col)
" optional arguments: line and column (defaults to 1) to search around " Return if cursor is in a comment.
if a:0 > 0 if synIDattr(synID(a:lnum, a:col, 0), 'name') =~? 'comment'
let view = winsaveview() return [0, 0]
call cursor(a:1, a:0 > 1 ? a:2 : 1)
let ret = s:find_opening_paren()
call winrestview(view)
return ret
endif endif
" Return if cursor is in a comment. call cursor(a:lnum, a:col)
exe 'if' s:skip_search '| return [0, 0] | endif'
let nearest = [0, 0] let nearest = [0, 0]
let timeout = g:python_pep8_indent_searchpair_timeout
let skip_special_chars = 's:_skip_special_chars(line("."), col("."))'
for [p, maxoff] in items(s:paren_pairs) for [p, maxoff] in items(s:paren_pairs)
let stopline = max([0, line('.') - maxoff, nearest[0]]) let stopline = max([0, line('.') - maxoff, nearest[0]])
let next = searchpairpos( let next = searchpairpos(
\ '\V'.p[0], '', '\V'.p[1], 'bnW', s:skip_special_chars, stopline) \ '\V'.p[0], '', '\V'.p[1], 'bnW', skip_special_chars, stopline, timeout)
if next[0] && (next[0] > nearest[0] || (next[0] == nearest[0] && next[1] > nearest[1])) if next[0] && (next[0] > nearest[0] || (next[0] == nearest[0] && next[1] > nearest[1]))
let nearest = next let nearest = next
endif endif
@@ -127,7 +139,7 @@ function! s:find_start_of_multiline_statement(lnum)
if getline(lnum - 1) =~# '\\$' if getline(lnum - 1) =~# '\\$'
let lnum = prevnonblank(lnum - 1) let lnum = prevnonblank(lnum - 1)
else else
let [paren_lnum, _] = s:find_opening_paren(lnum) let [paren_lnum, _] = s:find_opening_paren(lnum, 1)
if paren_lnum < 1 if paren_lnum < 1
return lnum return lnum
else else
@@ -184,7 +196,7 @@ endfunction
" Line up with open parenthesis/bracket/brace. " Line up with open parenthesis/bracket/brace.
function! s:indent_like_opening_paren(lnum) function! s:indent_like_opening_paren(lnum)
let [paren_lnum, paren_col] = s:find_opening_paren(a:lnum) let [paren_lnum, paren_col] = s:find_opening_paren(a:lnum, 1)
if paren_lnum <= 0 if paren_lnum <= 0
return -2 return -2
endif endif
@@ -214,7 +226,7 @@ function! s:indent_like_opening_paren(lnum)
" from the next logical line. " from the next logical line.
if text =~# b:control_statement && res == base + s:sw() if text =~# b:control_statement && res == base + s:sw()
" But only if not inside parens itself (Flake's E127). " But only if not inside parens itself (Flake's E127).
let [paren_lnum, _] = s:find_opening_paren(paren_lnum) let [paren_lnum, _] = s:find_opening_paren(paren_lnum, 1)
if paren_lnum <= 0 if paren_lnum <= 0
return res + s:sw() return res + s:sw()
endif endif
@@ -267,24 +279,23 @@ function! s:indent_like_previous_line(lnum)
let base = indent(start) let base = indent(start)
let current = indent(a:lnum) let current = indent(a:lnum)
" Jump to last character in previous line. " Ignore last character in previous line?
call cursor(lnum, len(text)) let lastcol = len(text)
let ignore_last_char = eval(s:skip_special_chars) let col = lastcol
" Search for final colon that is not inside something to be ignored. " Search for final colon that is not inside something to be ignored.
while 1 while 1
let curpos = getpos('.')[2] if col == 1 | break | endif
if curpos == 1 | break | endif if text[col-1] =~# '\s' || s:_skip_special_chars(lnum, col)
if eval(s:skip_special_chars) || text[curpos-1] =~# '\s' let col = col - 1
normal! h
continue continue
elseif text[curpos-1] ==# ':' elseif text[col-1] ==# ':'
return base + s:sw() return base + s:sw()
endif endif
break break
endwhile endwhile
if text =~# '\\$' && !ignore_last_char if text =~# '\\$' && !s:_skip_special_chars(lnum, lastcol)
" If this line is the continuation of a control statement " If this line is the continuation of a control statement
" indent further to distinguish the continuation line " indent further to distinguish the continuation line
" from the next logical line. " from the next logical line.
@@ -315,7 +326,7 @@ function! s:indent_like_previous_line(lnum)
return -1 return -1
endif endif
if !empty && s:is_dedented_already(current, base) if (current || !empty) && s:is_dedented_already(current, base)
return -1 return -1
endif endif
@@ -366,11 +377,12 @@ function! GetPythonPEPIndent(lnum)
if match_quotes != -1 if match_quotes != -1
" closing multiline string " closing multiline string
let quotes = line[match_quotes:(match_quotes+2)] let quotes = line[match_quotes:(match_quotes+2)]
let pairpos = searchpairpos(quotes, '', quotes, 'b') call cursor(a:lnum, 1)
let pairpos = searchpairpos(quotes, '', quotes, 'bW', '', 0, g:python_pep8_indent_searchpair_timeout)
if pairpos[0] != 0 if pairpos[0] != 0
return indent(pairpos[0]) return indent(pairpos[0])
else else
" TODO: test to cover this! return -1
endif endif
endif endif

View File

@@ -23,7 +23,7 @@ syn keyword carpSyntax defmacro defdynamic quote cons list array fn
syn keyword carpSyntax expand deftype register system-include register-type syn keyword carpSyntax expand deftype register system-include register-type
syn keyword carpSyntax defmodule copy use module defalias definterface eval syn keyword carpSyntax defmodule copy use module defalias definterface eval
syn keyword carpSyntax expand instantiate type info help quit env build run syn keyword carpSyntax expand instantiate type info help quit env build run
syn keyword carpSyntax cat project-set! local-include syn keyword carpSyntax cat project-set! local-include cons-last
syn keyword carpSyntax add-cflag add-lib project load reload let-do ignore syn keyword carpSyntax add-cflag add-lib project load reload let-do ignore
syn keyword carpSyntax fmt mac-only linux-only windows-only use-all when syn keyword carpSyntax fmt mac-only linux-only windows-only use-all when
syn keyword carpSyntax unless defn-do comment forever-do case and* or* syn keyword carpSyntax unless defn-do comment forever-do case and* or*

File diff suppressed because one or more lines are too long

View File

@@ -25,6 +25,7 @@ syn keyword cqlKeyword limit key keyspace
syn keyword cqlKeyword on or primary reversed syn keyword cqlKeyword on or primary reversed
syn keyword cqlKeyword select set truncate syn keyword cqlKeyword select set truncate
syn keyword cqlKeyword where with update use using values syn keyword cqlKeyword where with update use using values
syn keyword cqlKeyword asc desc
" CQL 3 additions " CQL 3 additions
syn keyword cqlKeyword table order by type if exists not frozen syn keyword cqlKeyword table order by type if exists not frozen
@@ -81,8 +82,8 @@ syn keyword cqlSpecial false null true
syn keyword cqlType SizeTieredCompactionStrategy LeveledCompactionStrategy syn keyword cqlType SizeTieredCompactionStrategy LeveledCompactionStrategy
" Variable Types " Variable Types
syn keyword cqlType bytea ascii text varchar uuid varint int bigint syn keyword cqlType bytea ascii text varchar uuid inet varint int bigint tinyint smallint
syn keyword cqlType bytestype utf8type timeuuidtype timeuuid timestamp syn keyword cqlType bytestype utf8type timeuuidtype timeuuid timestamp date time duration
syn keyword cqlType blob boolean counter decimal double float syn keyword cqlType blob boolean counter decimal double float
syn keyword cqlType serializingcacheprovider syn keyword cqlType serializingcacheprovider
syn keyword cqlType set list map tuple syn keyword cqlType set list map tuple

View File

@@ -25,7 +25,7 @@ syntax keyword dartConditional if else switch
syntax keyword dartRepeat do while for syntax keyword dartRepeat do while for
syntax keyword dartBoolean true false syntax keyword dartBoolean true false
syntax keyword dartConstant null syntax keyword dartConstant null
syntax keyword dartTypedef this super class typedef enum 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 covariant

View File

@@ -105,8 +105,8 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l("
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\/" end="\/" skip="\\\\\|\\\/" contains=@elixirStringContained,elixirRegexEscapePunctuation fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\/" end="\/" skip="\\\\\|\\\/" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
" Sigils surrounded with heredoc " Sigils surrounded with heredoc
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\zs\z1\s*$+ skip=+\\"+ fold syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\z1+ skip=+\\"+ fold
syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\zs\z1\s*$+ skip=+\\'+ fold syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\z1+ skip=+\\'+ fold
" Documentation " Documentation
if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs

View File

@@ -47,7 +47,7 @@ syn match fsharpSymbol "\%(member\)\@<=\s\+\w\+\.\zs\w\+"
" types " types
syn match fsharpTypeName "\%(\<type\s\+\)\@<=\w\+" syn match fsharpTypeName "\%#=1\%(\<type\s\+\)\@<=\w\+"
" errors " errors
@@ -182,7 +182,7 @@ syn match fsharpFloat "\<-\=\d\(_\|\d\)*\.\(_\|\d\)*\([eE][-+]\=\d\(_
syn match fsharpFloat "\<\d\+\.\d*" syn match fsharpFloat "\<\d\+\.\d*"
" modules " modules
syn match fsharpModule "\%(\<open\s\+\)\@<=[a-zA-Z.]\+" syn match fsharpModule "\%#=1\%(\<open\s\+\)\@<=[a-zA-Z.]\+"
" attributes " attributes
syn region fsharpAttrib matchgroup=fsharpAttribute start="\[<" end=">]" syn region fsharpAttrib matchgroup=fsharpAttribute start="\[<" end=">]"

View File

@@ -21,6 +21,7 @@ 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 gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseBreak "\v^b%(reak)=>" nextgroup=gitrebaseCommit skipwhite
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,6 +36,7 @@ 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 gitrebaseDrop Comment
hi def link gitrebaseBreak Macro
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

View File

@@ -376,8 +376,10 @@ function! s:hi()
hi def goCoverageUncover ctermfg=red guifg=#F92672 hi def goCoverageUncover ctermfg=red guifg=#F92672
" :GoDebug commands " :GoDebug commands
hi GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black if go#config#HighlightDebug()
hi GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White hi GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black
hi GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White
endif
endfunction endfunction
augroup vim-go-hi augroup vim-go-hi

View File

@@ -39,10 +39,26 @@ syntax match gomodReplaceOperator "\v\=\>"
highlight default link gomodReplaceOperator Operator highlight default link gomodReplaceOperator Operator
" highlight semver, note that this is very simple. But it works for now " highlight versions:
syntax match gomodVersion "v\d\+\.\d\+\.\d\+" " * vX.Y.Z
syntax match gomodVersion "v\d\+\.\d\+\.\d\+-\S*" " * vX.0.0-yyyyymmddhhmmss-abcdefabcdef
syntax match gomodVersion "v\d\+\.\d\+\.\d\++incompatible" " * vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef
" * vX.Y.(Z+1)-0.yyyymmddhhss-abcdefabcdef
" * +incompatible suffix when X > 1
" match vX.Y.Z and their prereleases
syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(-\%(\w\+\.\)\+0\.\d\{14}-\x\+\)\?"
" match target when most recent version before the target is X.Y.Z
syntax match gomodVersion "v\d\+\.\d\+\.[1-9]\{1}\d*\%(-0\.\%(\d\{14}-\x\+\)\)\?"
" match target without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef)
syntax match gomodVersion "v\d\+\.0\.0-\d\{14\}-\x\+"
" match vX.Y.Z and their prereleases for X>1
syntax match gomodVersion "v[2-9]\{1}\d\?\.\d\+\.\d\+\%(-\%(\w\+\.\)\+0\.\d\{14\}-\x\+\)\?\%(+incompatible\>\)\?"
" match target when most recent version before the target is X.Y.Z for X>1
syntax match gomodVersion "v[2-9]\{1}\d\?\.\d\+\.[1-9]\{1}\d*\%(-0\.\%(\d\{14\}-\x\+\)\)\?\%(+incompatible\>\)\?"
" match target without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef) for X>1
syntax match gomodVersion "v[2-9]\{1}\d\?\.0\.0-\d\{14\}-\x\+\%(+incompatible\>\)\?"
highlight default link gomodVersion Identifier highlight default link gomodVersion Identifier
let b:current_syntax = "gomod" let b:current_syntax = "gomod"

View File

@@ -172,10 +172,10 @@ syntax match jsArrowFuncArgs /\<\K\k*\ze\s*=>/ skipwhite contains=jsFuncArgs
" Matches a series of arguments surrounded in parens " Matches a series of arguments surrounded in parens
syntax match jsArrowFuncArgs /([^()]*)\ze\s*=>/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend syntax match jsArrowFuncArgs /([^()]*)\ze\s*=>/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend
exe 'syntax match jsFunction /\<function\>/ skipwhite skipempty nextgroup=jsGenerator,jsFuncName,jsFuncArgs,jsFlowFunctionGroup skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '') exe 'syntax match jsFunction /\<function\>/ skipwhite skipempty nextgroup=jsGenerator,jsFuncName,jsFuncArgs,jsFlowFunctionGroup skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock,jsCommentFunction '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '') exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock,jsCommentFunction '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '')
exe 'syntax match jsArrowFunction /()\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_noarg_arrow_function') ? 'conceal cchar='.g:javascript_conceal_noarg_arrow_function : '') exe 'syntax match jsArrowFunction /()\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_noarg_arrow_function') ? 'conceal cchar='.g:javascript_conceal_noarg_arrow_function : '')
exe 'syntax match jsArrowFunction /_\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_function : '') exe 'syntax match jsArrowFunction /_\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_function : '')
" Classes " Classes
syntax keyword jsClassKeyword contained class syntax keyword jsClassKeyword contained class

View File

@@ -192,7 +192,7 @@ exec 'syntax match juliaOuter contained "\<outer\ze\s\+' . s:idregex . '\>"
syntax match juliaBaseTypeBasic display "\<\%(Tuple\|NTuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\)\>" syntax match juliaBaseTypeBasic display "\<\%(Tuple\|NTuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\)\>"
syntax match juliaBaseTypeBasic06 display "\<\%(Void\|\%(Label\|Goto\)Node\|Associative\|MethodTable\|Nullable\|TypeMap\%(Level\|Entry\)\|CodeInfo\)\>" syntax match juliaBaseTypeBasic06 display "\<\%(Void\|\%(Label\|Goto\)Node\|Associative\|MethodTable\|Nullable\|TypeMap\%(Level\|Entry\)\|CodeInfo\)\>"
syntax match juliaBaseTypeBasic1011 display "\<\%(Nothing\|Some\|Missing\)\>" syntax match juliaBaseTypeBasic1011 display "\<\%(Nothing\|Some\|Missing\|NamedTuple\)\>"
syntax match juliaBaseTypeNum display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|Irrational\|Enum\|BigInt\|BigFloat\|MathConst\)\>" syntax match juliaBaseTypeNum display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|Irrational\|Enum\|BigInt\|BigFloat\|MathConst\)\>"
syntax match juliaBaseTypeNum06 display "\<Complex\%(32\|64\|128\)\>" syntax match juliaBaseTypeNum06 display "\<Complex\%(32\|64\|128\)\>"
syntax match juliaBaseTypeNum1011 display "\<\%(AbstractIrrational\|ComplexF\%(16\|32\|64\)\)\>" syntax match juliaBaseTypeNum1011 display "\<\%(AbstractIrrational\|ComplexF\%(16\|32\|64\)\)\>"
@@ -205,7 +205,7 @@ syntax match juliaBaseTypeIter1011 display "\<CartesianIndices\>"
syntax match juliaBaseTypeString display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\)\?String\>" syntax match juliaBaseTypeString display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\)\?String\>"
syntax match juliaBaseTypeString1011 display "\<SubstitutionString\>" syntax match juliaBaseTypeString1011 display "\<SubstitutionString\>"
syntax match juliaBaseTypeArray display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|SparseVector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|RowVector\)\>" syntax match juliaBaseTypeArray display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|SparseVector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|RowVector\)\>"
syntax match juliaBaseTypeArray1011 display "\<\%(Broadcast\|Adjoint\|Transpose\|LinearIndices\)\>" syntax match juliaBaseTypeArray1011 display "\<\%(Broadcasted\|Adjoint\|Transpose\|LinearIndices\)\>"
syntax match juliaBaseTypeDict display "\<\%(WeakKey\)\?Dict\>" syntax match juliaBaseTypeDict display "\<\%(WeakKey\)\?Dict\>"
syntax match juliaBaseTypeDict06 display "\<ObjectIdDict\>" syntax match juliaBaseTypeDict06 display "\<ObjectIdDict\>"
syntax match juliaBaseTypeDict1011 display "\<IdDict\>" syntax match juliaBaseTypeDict1011 display "\<IdDict\>"
@@ -251,10 +251,10 @@ syntax match juliaPossibleMacro transparent "@" contains=juliaMacroCall,juliaM
exec 'syntax match juliaMacro contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"' exec 'syntax match juliaMacro contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
syntax match juliaMacro contained "@\.\ze[^0-9]" syntax match juliaMacro contained "@\.\ze[^0-9]"
exec 'syntax region juliaMacroCall contained transparent start="\(@' . s:idregex . '\%(\.' . s:idregex . '\)*\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
exec 'syntax region juliaMacroCall contained transparent start="\(@.\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
exec 'syntax region juliaMacroCallP contained transparent start="@' . s:idregex . '\%(\.' . s:idregex . '\)*(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock' exec 'syntax region juliaMacroCallP contained transparent start="@' . s:idregex . '\%(\.' . s:idregex . '\)*(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
exec 'syntax region juliaMacroCallP contained transparent start="@.(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock' exec 'syntax region juliaMacroCallP contained transparent start="@.(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
exec 'syntax region juliaMacroCall contained transparent start="\(@' . s:idregex . '\%(\.' . s:idregex . '\)*\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
exec 'syntax region juliaMacroCall contained transparent start="\(@.\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
syntax match juliaNumbers transparent "\<\d\|\.\d\|\<im\>" contains=juliaNumber,juliaFloat,juliaComplexUnit syntax match juliaNumbers transparent "\<\d\|\.\d\|\<im\>" contains=juliaNumber,juliaFloat,juliaComplexUnit

View File

@@ -21,7 +21,7 @@ syn keyword ktException try catch finally throw
syn keyword ktInclude import package syn keyword ktInclude import package
syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit
syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic header impl expect actual syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic expect actual
syn keyword ktStructure class object interface typealias fun val var constructor init syn keyword ktStructure class object interface typealias fun val var constructor init
syn keyword ktReservedKeyword typeof syn keyword ktReservedKeyword typeof

View File

@@ -117,7 +117,7 @@ syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_\(_\|\s\)*$/
" YAML frontmatter " YAML frontmatter
if get(g:, 'vim_markdown_frontmatter', 0) if get(g:, 'vim_markdown_frontmatter', 0)
syn include @yamlTop syntax/yaml.vim syn include @yamlTop syntax/yaml.vim
syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^\(---\|...\)$" contains=@yamlTop keepend syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^\(---\|\.\.\.\)$" contains=@yamlTop keepend
unlet! b:current_syntax unlet! b:current_syntax
endif endif

View File

@@ -4,8 +4,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') ==
" Language: Mustache, Handlebars " Language: Mustache, Handlebars
" Maintainer: Juvenn Woo <machese@gmail.com> " Maintainer: Juvenn Woo <machese@gmail.com>
" Screenshot: http://imgur.com/6F408 " Screenshot: http://imgur.com/6F408
" Version: 2 " Version: 5
" Last Change: Oct 26th 2013 " Last Change: Nov 23rd 2018
" Remark: " Remark:
" It lexically hilights embedded mustaches (exclusively) in html file. " It lexically hilights embedded mustaches (exclusively) in html file.
" While it was written for Ruby-based Mustache template system, it should " While it was written for Ruby-based Mustache template system, it should
@@ -43,15 +43,17 @@ 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,@htmlMustacheContainer syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,mustacheParam,@htmlMustacheContainer
syntax region mustacheSection start='{{[$#^/]'lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer 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
syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@htmlMustacheContainer syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@htmlMustacheContainer
syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer
syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside syntax match mustacheConditionals '\([/#]\?if\|unless\|else\)' contained containedin=mustacheInside
syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection syntax match mustacheHelpers '[/#]\?\(with\|link\-to\|each\(\-in\)\?\)' contained containedin=mustacheInside
syntax match mustacheHelpers 'else \(if\|unless\|with\|link\-to\|each\(\-in\)\?\)' contained containedin=mustacheInside
syntax match mustacheParam /[a-z@_-]\+=/he=e-1 contained containedin=mustacheInside
syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=TOP,mustacheInside,@htmlMustacheContainer syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=TOP,mustacheInside,@htmlMustacheContainer
syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=TOP,mustacheInside,@htmlMustacheContainer syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=TOP,mustacheInside,@htmlMustacheContainer
syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside
@@ -67,8 +69,8 @@ syntax cluster htmlMustacheContainer add=htmlHead,htmlTitle,htmlString,htmlH1,ht
HtmlHiLink mustacheVariable Number HtmlHiLink mustacheVariable Number
HtmlHiLink mustacheVariableUnescape Number HtmlHiLink mustacheVariableUnescape Number
HtmlHiLink mustachePartial Number HtmlHiLink mustachePartial Number
HtmlHiLink mustacheSection Number
HtmlHiLink mustacheMarkerSet Number HtmlHiLink mustacheMarkerSet Number
HtmlHiLink mustacheParam htmlArg
HtmlHiLink mustacheComment Comment HtmlHiLink mustacheComment Comment
HtmlHiLink mustacheBlockComment Comment HtmlHiLink mustacheBlockComment Comment

View File

@@ -40,14 +40,14 @@ syn keyword nimKeyword bind block break
syn keyword nimKeyword case cast concept const continue converter syn keyword nimKeyword case cast concept const continue converter
syn keyword nimKeyword defer discard distinct div do syn keyword nimKeyword defer discard distinct div do
syn keyword nimKeyword elif else end enum except export syn keyword nimKeyword elif else end enum except export
syn keyword nimKeyword finally for from func syn keyword nimKeyword finally for from
syn keyword nimKeyword generic syn keyword nimKeyword generic
syn keyword nimKeyword if import in include interface is isnot iterator syn keyword nimKeyword if import in include interface is isnot iterator
syn keyword nimKeyword let syn keyword nimKeyword let
syn keyword nimKeyword mixin using mod syn keyword nimKeyword mixin using mod
syn keyword nimKeyword nil not notin syn keyword nimKeyword nil not notin
syn keyword nimKeyword object of or out syn keyword nimKeyword object of or out
syn keyword nimKeyword proc method macro template nextgroup=nimFunction skipwhite syn keyword nimKeyword proc func method macro template nextgroup=nimFunction skipwhite
syn keyword nimKeyword ptr syn keyword nimKeyword ptr
syn keyword nimKeyword raise ref return syn keyword nimKeyword raise ref return
syn keyword nimKeyword shared shl shr static syn keyword nimKeyword shared shl shr static

View File

@@ -39,6 +39,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'php') == -1
" php_sql_nowdoc = 1 for SQL syntax highlighting inside nowdocs (default: 1) " php_sql_nowdoc = 1 for SQL syntax highlighting inside nowdocs (default: 1)
" b:sql_type_override = 'postgresql' for PostgreSQL syntax highlighting in current buffer (default: 'mysql') " b:sql_type_override = 'postgresql' for PostgreSQL syntax highlighting in current buffer (default: 'mysql')
" g:sql_type_default = 'postgresql' to set global SQL syntax highlighting language default (default: 'mysql')" " g:sql_type_default = 'postgresql' to set global SQL syntax highlighting language default (default: 'mysql')"
" php_xml_heredoc = 1 for XML syntax highlighting inside heredocs (default: 0)
" php_xml_nowdoc = 1 for XML syntax highlighting inside nowdocs (default: 0)
" php_html_in_strings = 1 for HTML syntax highlighting inside strings (default: 0) " php_html_in_strings = 1 for HTML syntax highlighting inside strings (default: 0)
" php_html_in_heredoc = 1 for HTML syntax highlighting inside heredocs (default: 1) " php_html_in_heredoc = 1 for HTML syntax highlighting inside heredocs (default: 1)
" php_html_in_nowdoc = 1 for HTML syntax highlighting inside nowdocs (default: 1) " php_html_in_nowdoc = 1 for HTML syntax highlighting inside nowdocs (default: 1)
@@ -160,6 +162,21 @@ if ((exists("php_sql_query") && php_sql_query) || (exists("php_sql_heredoc") &&
endif endif
endif endif
if !exists("php_xml_heredoc")
let php_xml_heredoc=0
endif
if !exists("php_xml_nowdoc")
let php_xml_nowdoc=0
endif
if ((exists("php_xml_heredoc") && php_xml_heredoc) || (exists("php_xml_nowdoc") && php_xml_nowdoc))
syn include @xmlTop syntax/xml.vim
syn sync clear
unlet! b:current_syntax
endif
" set default for php_folding so we don't have to keep checking its existence. " set default for php_folding so we don't have to keep checking its existence.
if !exists("php_folding") if !exists("php_folding")
let php_folding = 0 let php_folding = 0
@@ -667,6 +684,9 @@ if version >= 704
if (exists("php_sql_heredoc") && php_sql_heredoc) if (exists("php_sql_heredoc") && php_sql_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif endif
if (exists("php_xml_heredoc") && php_xml_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
" @end phpHereDoc " @end phpHereDoc
else else
" @copy phpHereDoc strip_maximum_size " @copy phpHereDoc strip_maximum_size
@@ -680,6 +700,9 @@ else
if (exists("php_sql_heredoc") && php_sql_heredoc) if (exists("php_sql_heredoc") && php_sql_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif endif
if (exists("php_xml_heredoc") && php_xml_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
" @end phpHereDoc " @end phpHereDoc
endif endif
@@ -695,6 +718,9 @@ if version >= 704
if (exists("php_sql_nowdoc") && php_sql_nowdoc) if (exists("php_sql_nowdoc") && php_sql_nowdoc)
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif endif
if (exists("php_xml_nowdoc") && php_xml_nowdoc)
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
" @end phpNowDoc " @end phpNowDoc
else else
" @copy phpHereDoc strip_maximum_size " @copy phpHereDoc strip_maximum_size
@@ -708,6 +734,9 @@ else
if (exists("php_sql_heredoc") && php_sql_heredoc) if (exists("php_sql_heredoc") && php_sql_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif endif
if (exists("php_xml_heredoc") && php_xml_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
" @end phpNowDoc " @end phpNowDoc
endif endif

View File

@@ -110,7 +110,7 @@ syn match purescriptForall "∀"
" Keywords " Keywords
syn keyword purescriptConditional if then else syn keyword purescriptConditional if then else
syn keyword purescriptStatement do case of in syn keyword purescriptStatement do case of in ado
syn keyword purescriptLet let syn keyword purescriptLet let
syn keyword purescriptWhere where syn keyword purescriptWhere where
syn match purescriptStructure "\<\(data\|newtype\|type\|kind\)\>" syn match purescriptStructure "\<\(data\|newtype\|type\|kind\)\>"

View File

@@ -3,7 +3,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'raml') == -1
" Vim syntax file " Vim syntax file
" Language: RAML (RESTful API Modeling Language) " Language: RAML (RESTful API Modeling Language)
" Maintainer: Eric Hopkins <eric.on.tech@gmail.com> " Maintainer: Eric Hopkins <eric.on.tech@gmail.com>
" Last Change: 2016-02-29 " URL: https://github.com/in3d/vim-raml
" License: Same as Vim
" Last Change: 2018-11-03
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish

View File

@@ -23,9 +23,12 @@ syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipe
syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained
syn match rustUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=rustUnion syn match rustUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=rustUnion
syn keyword rustOperator as syn keyword rustOperator as
syn keyword rustExistential existential nextgroup=rustTypedef skipwhite skipempty contained
syn match rustExistentialContextual /\<existential\_s\+type/ transparent contains=rustExistential,rustTypedef
syn match rustAssert "\<assert\(\w\)*!" contained syn match rustAssert "\<assert\(\w\)*!" contained
syn match rustPanic "\<panic\(\w\)*!" contained syn match rustPanic "\<panic\(\w\)*!" contained
syn match rustKeyword "\<async\%(\s\|\n\)\@="
syn keyword rustKeyword break syn keyword rustKeyword break
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
syn keyword rustKeyword continue syn keyword rustKeyword continue
@@ -293,6 +296,7 @@ hi def link rustDynKeyword rustKeyword
hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust
hi def link rustStructure Keyword " More precise is Structure hi def link rustStructure Keyword " More precise is Structure
hi def link rustUnion rustStructure hi def link rustUnion rustStructure
hi def link rustExistential rustKeyword
hi def link rustPubScopeDelim Delimiter hi def link rustPubScopeDelim Delimiter
hi def link rustPubScopeCrate rustKeyword hi def link rustPubScopeCrate rustKeyword
hi def link rustSuper rustKeyword hi def link rustSuper rustKeyword

File diff suppressed because it is too large Load Diff

View File

@@ -48,7 +48,7 @@ syn match tomlDate /\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?/ display
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}[T ]\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)\?/ display syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}[T ]\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)\?/ display
hi def link tomlDate Constant hi def link tomlDate Constant
syn match tomlKey /\v(^|[{,])\s*\zs[[:alnum:]_-]+\ze\s*\=/ display syn match tomlKey /\v(^|[{,])\s*\zs[[:alnum:]._-]+\ze\s*\=/ display
hi def link tomlKey Identifier hi def link tomlKey Identifier
syn region tomlKeyDq oneline start=/\v(^|[{,])\s*\zs"/ end=/"\ze\s*=/ contains=tomlEscape syn region tomlKeyDq oneline start=/\v(^|[{,])\s*\zs"/ end=/"\ze\s*=/ contains=tomlEscape
@@ -58,10 +58,10 @@ syn region tomlKeySq oneline start=/\v(^|[{,])\s*\zs'/ end=/'\ze\s*=/
hi def link tomlKeySq Identifier hi def link tomlKeySq Identifier
syn region tomlTable oneline start=/^\s*\[[^\[]/ end=/\]/ contains=tomlKey,tomlKeyDq,tomlKeySq syn region tomlTable oneline start=/^\s*\[[^\[]/ end=/\]/ contains=tomlKey,tomlKeyDq,tomlKeySq
hi def link tomlTable Identifier hi def link tomlTable Title
syn region tomlTableArray oneline start=/^\s*\[\[/ end=/\]\]/ contains=tomlKey,tomlKeyDq,tomlKeySq syn region tomlTableArray oneline start=/^\s*\[\[/ end=/\]\]/ contains=tomlKey,tomlKeyDq,tomlKeySq
hi def link tomlTableArray Identifier hi def link tomlTableArray Title
syn keyword tomlTodo TODO FIXME XXX BUG contained syn keyword tomlTodo TODO FIXME XXX BUG contained
hi def link tomlTodo Todo hi def link tomlTodo Todo

View File

@@ -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: September 22, 2018 " Last Change: December 19, 2018
" 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')
@@ -15,16 +15,16 @@ let s:cpo_save = &cpo
set cpo-=C set cpo-=C
" General commands " General commands
syntax keyword vifmCommand contained alink apropos bmark bmarks bmgo change syntax keyword vifmCommand contained alink apropos bmark bmarks bmgo cds change
\ chmod chown clone compare cope[n] co[py] cq[uit] d[elete] delbmarks \ chmod chown clone compare cope[n] co[py] cq[uit] d[elete] delbmarks
\ delm[arks] di[splay] dirs e[dit] el[se] empty en[dif] exi[t] file fin[d] \ delm[arks] di[splay] dirs e[dit] el[se] empty en[dif] exi[t] file fin[d]
\ fini[sh] go[to] gr[ep] h[elp] histnext his[tory] histprev jobs locate ls \ fini[sh] go[to] gr[ep] h[elp] hideui histnext his[tory] histprev jobs
\ lstrash marks media mes[sages] mkdir m[ove] noh[lsearch] on[ly] popd pushd \ locate ls lstrash marks media mes[sages] mkdir m[ove] noh[lsearch] on[ly]
\ pu[t] pw[d] qa[ll] q[uit] redr[aw] reg[isters] regular rename restart \ popd pushd pu[t] pw[d] qa[ll] q[uit] redr[aw] reg[isters] regular rename
\ restore rlink screen sh[ell] siblnext siblprev sor[t] sp[lit] s[ubstitute] \ restart restore rlink screen sh[ell] siblnext siblprev sor[t] sp[lit]
\ tabc[lose] tabm[ove] tabname tabnew touch tr trashes tree sync undol[ist] \ s[ubstitute] tabc[lose] tabm[ove] tabname tabnew tabn[ext] tabp[revious]
\ ve[rsion] vie[w] vifm vs[plit] winc[md] w[rite] wq wqa[ll] xa[ll] x[it] \ touch tr trashes tree sync undol[ist] ve[rsion] vie[w] vifm vs[plit]
\ y[ank] \ winc[md] w[rite] wq wqa[ll] xa[ll] x[it] y[ank]
\ nextgroup=vifmArgs \ nextgroup=vifmArgs
" commands that might be prepended to a command without changing everything else " commands that might be prepended to a command without changing everything else