Update
This commit is contained in:
parent
ec1c943069
commit
d43b70d939
@ -21,6 +21,9 @@ function! s:L2U_Setup()
|
||||
if !has_key(b:, "l2u_cmdtab_set")
|
||||
let b:l2u_cmdtab_set = 0
|
||||
endif
|
||||
if !has_key(b:, "l2u_keymap_set")
|
||||
let b:l2u_keymap_set = 0
|
||||
endif
|
||||
|
||||
" Did we activate the L2U as-you-type substitutions?
|
||||
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
|
||||
" this string with feedkeys()
|
||||
if has("win32") || has("win64")
|
||||
if has("gui_running")
|
||||
let s:l2u_esc_sequence = "\u0006"
|
||||
else
|
||||
let s:l2u_esc_sequence = "\u0006\b"
|
||||
endif
|
||||
let s:l2u_esc_sequence = "\u0006"
|
||||
else
|
||||
let s:l2u_esc_sequence = "\u0091\b"
|
||||
end
|
||||
@ -409,8 +408,8 @@ function! LaTeXtoUnicode#FallbackCallback()
|
||||
return
|
||||
endfunction
|
||||
|
||||
" This is the function which is mapped to <S-Tab> in command-line mode
|
||||
function! LaTeXtoUnicode#CmdTab()
|
||||
" This is the function that performs the substitution in command-line mode
|
||||
function! LaTeXtoUnicode#CmdTab(triggeredbytab)
|
||||
" first stage
|
||||
" analyse command line
|
||||
let col1 = getcmdpos() - 1
|
||||
@ -419,6 +418,9 @@ function! LaTeXtoUnicode#CmdTab()
|
||||
let b:l2u_singlebslash = (match(l[0:col1-1], '\\$') >= 0)
|
||||
" completion not found
|
||||
if col0 == -1
|
||||
if a:triggeredbytab
|
||||
call feedkeys("\<Tab>", 'nt') " fall-back to the default <Tab>
|
||||
endif
|
||||
return l
|
||||
endif
|
||||
let base = l[col0 : col1-1]
|
||||
@ -434,6 +436,9 @@ function! LaTeXtoUnicode#CmdTab()
|
||||
endif
|
||||
endfor
|
||||
if len(partmatches) == 0
|
||||
if a:triggeredbytab
|
||||
call feedkeys("\<Tab>", 'nt') " fall-back to the default <Tab>
|
||||
endif
|
||||
return l
|
||||
endif
|
||||
" exact matches are replaced with Unicode
|
||||
@ -463,8 +468,13 @@ endfunction
|
||||
" Setup the L2U tab mapping
|
||||
function! s:L2U_SetTab(wait_insert_enter)
|
||||
if !b:l2u_cmdtab_set && get(g:, "latex_to_unicode_tab", 1) && b:l2u_enabled
|
||||
cmap <buffer> <S-Tab> <Plug>L2UCmdTab
|
||||
cnoremap <buffer> <Plug>L2UCmdTab <C-\>eLaTeXtoUnicode#CmdTab()<CR>
|
||||
let b:l2u_cmdtab_keys = get(g:, "latex_to_unicode_cmd_mapping", ['<Tab>','<S-Tab>'])
|
||||
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
|
||||
endif
|
||||
if b:l2u_tab_set
|
||||
@ -500,7 +510,9 @@ endfunction
|
||||
" Revert the LaTeX-to-Unicode tab mapping settings
|
||||
function! s:L2U_UnsetTab()
|
||||
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
|
||||
endif
|
||||
if !b:l2u_tab_set
|
||||
@ -593,6 +605,21 @@ function! s:L2U_UnsetAutoSub()
|
||||
let b:l2u_autosub_set = 0
|
||||
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.
|
||||
function! LaTeXtoUnicode#Init(...)
|
||||
let wait_insert_enter = a:0 > 0 ? a:1 : 1
|
||||
@ -605,9 +632,11 @@ function! LaTeXtoUnicode#Init(...)
|
||||
|
||||
call s:L2U_UnsetTab()
|
||||
call s:L2U_UnsetAutoSub()
|
||||
call s:L2U_UnsetKeymap()
|
||||
|
||||
call s:L2U_SetTab(wait_insert_enter)
|
||||
call s:L2U_SetAutoSub(wait_insert_enter)
|
||||
call s:L2U_SetKeymap()
|
||||
endfunction
|
||||
|
||||
function! LaTeXtoUnicode#Toggle()
|
||||
|
@ -86,6 +86,34 @@ function! cargo#bench(args)
|
||||
call cargo#cmd("bench " . a:args)
|
||||
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:
|
||||
|
||||
endif
|
||||
|
@ -14,7 +14,7 @@ function! cargo#quickfix#CmdPre() abort
|
||||
endfunction
|
||||
|
||||
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.
|
||||
if b:rust_compiler_cargo_qf_has_lcd
|
||||
execute 'lchdir! '.b:rust_compiler_cargo_qf_prev_cd
|
||||
|
@ -349,11 +349,14 @@ function! elm#FindRootDirectory() abort
|
||||
if empty(l:elm_root)
|
||||
let l:current_file = expand('%:p')
|
||||
let l:dir_current_file = fnameescape(fnamemodify(l:current_file, ':h'))
|
||||
let l:match = findfile('elm-package.json', l:dir_current_file . ';')
|
||||
if empty(l:match)
|
||||
let l:elm_root = ''
|
||||
let l:old_match = findfile('elm-package.json', l:dir_current_file . ';')
|
||||
let l:new_match = findfile('elm.json', l:dir_current_file . ';')
|
||||
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
|
||||
let l:elm_root = fnamemodify(l:match, ':p:h')
|
||||
let l:elm_root = ''
|
||||
endif
|
||||
|
||||
if !empty(l:elm_root)
|
||||
|
@ -1,5 +1,9 @@
|
||||
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
|
||||
return get(g:, 'go_autodetect_gopath', 0)
|
||||
endfunction
|
||||
@ -137,6 +141,10 @@ function! go#config#SetGuruScope(scope) abort
|
||||
endif
|
||||
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'
|
||||
function! go#config#GocodeSocketType() abort
|
||||
return get(g:, 'go_gocode_socket_type', s:sock_type)
|
||||
@ -147,7 +155,7 @@ function! go#config#GocodeProposeBuiltins() abort
|
||||
endfunction
|
||||
|
||||
function! go#config#GocodeProposeSource() abort
|
||||
return get(g:, 'go_gocode_propose_source', 1)
|
||||
return get(g:, 'go_gocode_propose_source', 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#EchoCommandInfo() abort
|
||||
@ -200,7 +208,7 @@ endfunction
|
||||
|
||||
function! go#config#DebugCommands() abort
|
||||
" 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
|
||||
endfunction
|
||||
|
||||
@ -308,10 +316,6 @@ function! go#config#DeclsMode() abort
|
||||
return get(g:, "go_decls_mode", "")
|
||||
endfunction
|
||||
|
||||
function! go#config#DocCommand() abort
|
||||
return get(g:, "go_doc_command", ["godoc"])
|
||||
endfunction
|
||||
|
||||
function! go#config#FmtCommand() abort
|
||||
return get(g:, "go_fmt_command", "gofmt")
|
||||
endfunction
|
||||
@ -354,6 +358,10 @@ function! go#config#BinPath() abort
|
||||
return get(g:, "go_bin_path", "")
|
||||
endfunction
|
||||
|
||||
function! go#config#SearchBinPathFirst() abort
|
||||
return get(g:, 'go_search_bin_path_first', 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#HighlightArrayWhitespaceError() abort
|
||||
return get(g:, 'go_highlight_array_whitespace_error', 0)
|
||||
endfunction
|
||||
@ -422,6 +430,10 @@ function! go#config#HighlightVariableDeclarations() abort
|
||||
return get(g:, 'go_highlight_variable_declarations', 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#HighlightDebug() abort
|
||||
return get(g:, 'go_highlight_debug', 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#FoldEnable(...) abort
|
||||
if a:0 > 0
|
||||
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
|
||||
endif
|
||||
|
||||
" restore Vi compatibility settings
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||
|
||||
" 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
|
||||
|
||||
|
@ -445,12 +445,12 @@ function! s:SearchTestFunctionNameUnderCursor() abort
|
||||
let cursor_line = line('.')
|
||||
|
||||
" Find #[test] attribute
|
||||
if search('#\[test]', 'bcW') is 0
|
||||
if search('\m\C#\[test\]', 'bcW') is 0
|
||||
return ''
|
||||
endif
|
||||
|
||||
" 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
|
||||
return ''
|
||||
endif
|
||||
@ -462,19 +462,36 @@ function! s:SearchTestFunctionNameUnderCursor() abort
|
||||
return ''
|
||||
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
|
||||
|
||||
function! rust#Test(all, options) abort
|
||||
let pwd = expand('%:p:h')
|
||||
if findfile('Cargo.toml', pwd . ';') ==# ''
|
||||
let manifest = findfile('Cargo.toml', expand('%:p:h') . ';')
|
||||
if manifest ==# ''
|
||||
return rust#Run(1, '--test ' . a:options)
|
||||
endif
|
||||
|
||||
let pwd = shellescape(pwd)
|
||||
if exists(':terminal')
|
||||
let cmd = 'terminal '
|
||||
else
|
||||
let cmd = '!'
|
||||
let manifest = shellescape(manifest)
|
||||
endif
|
||||
|
||||
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
|
||||
endif
|
||||
|
||||
@ -487,7 +504,13 @@ function! rust#Test(all, options) abort
|
||||
echohl None
|
||||
return
|
||||
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
|
||||
call setpos('.', saved)
|
||||
endtry
|
||||
|
@ -73,6 +73,12 @@ function! rust#debugging#Info() abort
|
||||
echo l:output
|
||||
|
||||
version
|
||||
|
||||
if exists(":SyntasticInfo")
|
||||
echo "----"
|
||||
echo "Info from Syntastic:"
|
||||
execute "SyntasticInfo"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! rust#debugging#InfoToClipboard() abort
|
||||
|
@ -24,18 +24,17 @@ endif
|
||||
function! rustfmt#DetectVersion()
|
||||
" Save rustfmt '--help' for feature inspection
|
||||
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:
|
||||
silent let s:rustfmt_version = system(g:rustfmt_command . " --version")
|
||||
let s:rustfmt_version = matchlist(s:rustfmt_version, '\vrustfmt ([0-9]+[.][0-9]+[.][0-9]+)')
|
||||
|
||||
if len(s:rustfmt_version) < 3
|
||||
silent let l:rustfmt_version_full = system(g:rustfmt_command . " --version")
|
||||
let l:rustfmt_version_list = matchlist(l:rustfmt_version_full,
|
||||
\ '\vrustfmt ([0-9]+[.][0-9]+[.][0-9]+)')
|
||||
if len(l:rustfmt_version_list) < 3
|
||||
let s:rustfmt_version = "0"
|
||||
else
|
||||
let s:rustfmt_version = s:rustfmt_version[1]
|
||||
let s:rustfmt_version = l:rustfmt_version_list[1]
|
||||
endif
|
||||
|
||||
return s:rustfmt_version
|
||||
endfunction
|
||||
|
||||
@ -46,7 +45,7 @@ if !exists("g:rustfmt_emit_files")
|
||||
endif
|
||||
|
||||
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
|
||||
|
||||
let s:got_fmt_error = 0
|
||||
@ -87,11 +86,9 @@ function! s:RustfmtCommandRange(filename, line1, line2)
|
||||
let l:write_mode = s:RustfmtWriteMode()
|
||||
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.
|
||||
let l:unstable_features =
|
||||
\ (s:rustfmt_unstable_features && (s:rustfmt_version < '1.'))
|
||||
\ ? '--unstable-features' : ''
|
||||
let l:unstable_features = s:rustfmt_unstable_features ? '--unstable-features' : ''
|
||||
|
||||
let l:cmd = printf("%s %s %s %s %s --file-lines '[%s]' %s", g:rustfmt_command,
|
||||
\ l:write_mode, g:rustfmt_options,
|
||||
@ -119,6 +116,8 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
||||
mkview!
|
||||
|
||||
let l:stderr_tmpname = tempname()
|
||||
call writefile([], l:stderr_tmpname)
|
||||
|
||||
let l:command = a:command . ' 2> ' . l:stderr_tmpname
|
||||
|
||||
if a:tmpname ==# ''
|
||||
@ -133,7 +132,8 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
||||
if exists("*systemlist")
|
||||
silent let out = systemlist(l:command, l:buffer)
|
||||
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
|
||||
else
|
||||
if exists("*systemlist")
|
||||
|
@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1
|
||||
|
||||
" common functions for vifm plugin related to globals
|
||||
" 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
|
||||
function! vifm#globals#Init()
|
||||
@ -26,6 +26,10 @@ function! vifm#globals#Init()
|
||||
let g:vifm_term = 'xterm -e'
|
||||
endif
|
||||
endif
|
||||
|
||||
if !exists('g:vifm_embed_term')
|
||||
let g:vifm_embed_term = has('gui_running')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
@ -11,6 +11,10 @@ if exists("g:current_compiler")
|
||||
endif
|
||||
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
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
@ -40,6 +44,10 @@ CompilerSet errorformat+=%-G%.%# " All lines not matching a
|
||||
let &cpo = 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
|
||||
|
||||
endif
|
||||
|
@ -23,5 +23,7 @@ CompilerSet errorformat=
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
let g:syntastic_nim_checkers = ['nim']
|
||||
|
||||
|
||||
endif
|
||||
|
@ -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 match jsFlowReturnArrow contained /=>/ skipwhite skipempty nextgroup=@jsFlowReturnCluster
|
||||
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 match jsFlowReturnOrOp contained /\s*|\s*/ skipwhite skipempty nextgroup=@jsFlowReturnCluster
|
||||
syntax match jsFlowWildcardReturn contained /*/ skipwhite skipempty nextgroup=jsFuncBlock
|
||||
|
@ -340,6 +340,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
" go, from gofiletype.vim in fatih/vim-go:_BASIC
|
||||
" 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,
|
||||
" 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.
|
||||
@ -361,16 +365,21 @@ function! s:gofiletype_post()
|
||||
endfunction
|
||||
|
||||
" 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 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 BufReadPost *.s call s:gofiletype_post()
|
||||
|
||||
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
|
||||
" 'module <path>'.
|
||||
au BufNewFile,BufRead go.mod call s:gomod()
|
||||
@ -390,6 +399,10 @@ fun! s:gomod()
|
||||
endfor
|
||||
endfun
|
||||
|
||||
" restore Vi compatibility settings
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
augroup end
|
||||
endif
|
||||
@ -397,6 +410,7 @@ endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
augroup filetypedetect
|
||||
" graphql, from graphql.vim in jparise/vim-graphql
|
||||
" vint: -ProhibitAutocmdWithNoGroup
|
||||
au BufRead,BufNewFile *.graphql,*.graphqls,*.gql setfiletype graphql
|
||||
augroup end
|
||||
endif
|
||||
@ -484,6 +498,7 @@ autocmd BufRead,BufNewFile Jenkinsfile set ft=Jenkinsfile
|
||||
autocmd BufRead,BufNewFile Jenkinsfile* setf Jenkinsfile
|
||||
autocmd BufRead,BufNewFile *.jenkinsfile set ft=Jenkinsfile
|
||||
autocmd BufRead,BufNewFile *.jenkinsfile setf Jenkinsfile
|
||||
autocmd BufRead,BufNewFile *.Jenkinsfile setf Jenkinsfile
|
||||
augroup end
|
||||
endif
|
||||
|
||||
@ -912,6 +927,9 @@ au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
||||
" Autotest
|
||||
au BufNewFile,BufRead .autotest call s:setf('ruby')
|
||||
|
||||
" Axlsx
|
||||
au BufNewFile,BufRead *.axlsx call s:setf('ruby')
|
||||
|
||||
" Buildr Buildfile
|
||||
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
|
||||
au BufRead,BufNewFile *.tf 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
|
||||
endif
|
||||
|
||||
|
@ -34,7 +34,10 @@ if exists("loaded_matchit")
|
||||
" note: begin_keywords must contain all blocks in order
|
||||
" 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 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:yesmacro = s:nomacro . '\%('. s:macro_regex . '\)\+'
|
||||
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 attr = synIDattr(synID(l, c, 1),"name")
|
||||
let c1 = c
|
||||
while attr == 'juliaMacro'
|
||||
while attr == 'juliaMacro' || expand('<cword>') =~# '\<\%(global\|local\)\>'
|
||||
normal! W
|
||||
if line('.') > l || col('.') == c1
|
||||
call cursor(l, c)
|
||||
|
@ -1,9 +1,9 @@
|
||||
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
|
||||
endif
|
||||
let g:loaded_mustache_handlebars = 1
|
||||
let b:loaded_mustache_handlebars = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
@ -17,176 +17,178 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
augroup rust.vim
|
||||
autocmd!
|
||||
|
||||
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:*/,:///,://!,://
|
||||
if get(b:, 'current_compiler', '') ==# ''
|
||||
if strlen(findfile('Cargo.toml', '.;')) > 0
|
||||
compiler cargo
|
||||
else
|
||||
setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
|
||||
compiler rustc
|
||||
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
|
||||
endif
|
||||
|
||||
" smartindent will be overridden by indentexpr if filetype indent is on, but
|
||||
" otherwise it's better than nothing.
|
||||
setlocal smartindent nocindent
|
||||
" Variables {{{1
|
||||
|
||||
if get(g:, 'rust_recommended_style', 1)
|
||||
let b:rust_set_style = 1
|
||||
setlocal tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
setlocal textwidth=99
|
||||
" 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
|
||||
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
|
||||
|
||||
" 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
|
||||
augroup rust.vim.DelimitMate
|
||||
autocmd!
|
||||
|
||||
autocmd User delimitMate_map :call rust#delimitmate#onMap()
|
||||
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
|
||||
|
||||
" 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('conceal') && get(g:, 'rust_conceal', 0)
|
||||
let b:rust_set_conceallevel=1
|
||||
setlocal conceallevel=2
|
||||
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
|
||||
" Motion Commands {{{1
|
||||
|
||||
if has('conceal') && get(g:, 'rust_conceal', 0)
|
||||
let b:rust_set_conceallevel=1
|
||||
setlocal conceallevel=2
|
||||
endif
|
||||
" Bind motion commands to support hanging indents
|
||||
nnoremap <silent> <buffer> [[ :call rust#Jump('n', 'Back')<CR>
|
||||
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>
|
||||
|
||||
" Motion Commands {{{1
|
||||
" Commands {{{1
|
||||
|
||||
" Bind motion commands to support hanging indents
|
||||
nnoremap <silent> <buffer> [[ :call rust#Jump('n', 'Back')<CR>
|
||||
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>
|
||||
" See |:RustRun| for docs
|
||||
command! -nargs=* -complete=file -bang -buffer RustRun call rust#Run(<bang>0, <q-args>)
|
||||
|
||||
" 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
|
||||
command! -nargs=* -complete=file -bang -buffer RustRun call rust#Run(<bang>0, <q-args>)
|
||||
" See |:RustEmitIr| for docs
|
||||
command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>)
|
||||
|
||||
" See |:RustExpand| for docs
|
||||
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -buffer RustExpand call rust#Expand(<bang>0, <q-args>)
|
||||
" See |:RustEmitAsm| for docs
|
||||
command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
|
||||
|
||||
" See |:RustEmitIr| for docs
|
||||
command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>)
|
||||
" See |:RustPlay| for docs
|
||||
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
|
||||
|
||||
" See |:RustEmitAsm| for docs
|
||||
command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
|
||||
" See |:RustFmt| for docs
|
||||
command! -buffer RustFmt call rustfmt#Format()
|
||||
|
||||
" See |:RustPlay| for docs
|
||||
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
|
||||
" See |:RustFmtRange| for docs
|
||||
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
|
||||
|
||||
" See |:RustFmt| for docs
|
||||
command! -buffer RustFmt call rustfmt#Format()
|
||||
" See |:RustInfo| for docs
|
||||
command! -bar RustInfo call rust#debugging#Info()
|
||||
|
||||
" See |:RustFmtRange| for docs
|
||||
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
|
||||
" See |:RustInfoToClipboard| for docs
|
||||
command! -bar RustInfoToClipboard call rust#debugging#InfoToClipboard()
|
||||
|
||||
" See |:RustInfo| for docs
|
||||
command! -bar RustInfo call rust#debugging#Info()
|
||||
" See |:RustInfoToFile| for docs
|
||||
command! -bar -nargs=1 RustInfoToFile call rust#debugging#InfoToFile(<f-args>)
|
||||
|
||||
" See |:RustInfoToClipboard| for docs
|
||||
command! -bar RustInfoToClipboard call rust#debugging#InfoToClipboard()
|
||||
" See |:RustTest| for docs
|
||||
command! -buffer -nargs=* -bang RustTest call rust#Test(<bang>0, <q-args>)
|
||||
|
||||
" See |:RustInfoToFile| for docs
|
||||
command! -bar -nargs=1 RustInfoToFile call rust#debugging#InfoToFile(<f-args>)
|
||||
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
|
||||
let b:rust_last_rustc_args = []
|
||||
let b:rust_last_args = []
|
||||
endif
|
||||
|
||||
" See |:RustTest| for docs
|
||||
command! -buffer -nargs=* -bang RustTest call rust#Test(<bang>0, <q-args>)
|
||||
" Cleanup {{{1
|
||||
|
||||
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
|
||||
let b:rust_last_rustc_args = []
|
||||
let b:rust_last_args = []
|
||||
endif
|
||||
|
||||
" Cleanup {{{1
|
||||
|
||||
let b:undo_ftplugin = "
|
||||
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
|
||||
\|if exists('b:rust_set_style')
|
||||
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
|
||||
\|endif
|
||||
\|if exists('b:rust_original_delimitMate_excluded_regions')
|
||||
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
|
||||
\|unlet b:rust_original_delimitMate_excluded_regions
|
||||
\|else
|
||||
\|unlet! b:delimitMate_excluded_regions
|
||||
let b:undo_ftplugin = "
|
||||
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
|
||||
\|if exists('b:rust_set_style')
|
||||
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
|
||||
\|endif
|
||||
\|if exists('b:rust_original_delimitMate_excluded_regions')
|
||||
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
|
||||
\|unlet b:rust_original_delimitMate_excluded_regions
|
||||
\|else
|
||||
\|unlet! b:delimitMate_excluded_regions
|
||||
\|endif
|
||||
\|if exists('b:rust_set_foldmethod')
|
||||
\|setlocal foldmethod< foldlevel<
|
||||
\|unlet b:rust_set_foldmethod
|
||||
\|endif
|
||||
\|if exists('b:rust_set_foldmethod')
|
||||
\|setlocal foldmethod< foldlevel<
|
||||
\|unlet b:rust_set_foldmethod
|
||||
\|if exists('b:rust_set_conceallevel')
|
||||
\|setlocal conceallevel<
|
||||
\|unlet b:rust_set_conceallevel
|
||||
\|endif
|
||||
\|if exists('b:rust_set_conceallevel')
|
||||
\|setlocal conceallevel<
|
||||
\|unlet b:rust_set_conceallevel
|
||||
\|endif
|
||||
\|unlet! b:rust_last_rustc_args b:rust_last_args
|
||||
\|delcommand RustRun
|
||||
\|delcommand RustExpand
|
||||
\|delcommand RustEmitIr
|
||||
\|delcommand RustEmitAsm
|
||||
\|delcommand RustPlay
|
||||
\|nunmap <buffer> [[
|
||||
\|nunmap <buffer> ]]
|
||||
\|xunmap <buffer> [[
|
||||
\|xunmap <buffer> ]]
|
||||
\|ounmap <buffer> [[
|
||||
\|ounmap <buffer> ]]
|
||||
\|setlocal matchpairs-=<:>
|
||||
\|unlet b:match_skip
|
||||
\"
|
||||
\|unlet! b:rust_last_rustc_args b:rust_last_args
|
||||
\|delcommand RustRun
|
||||
\|delcommand RustExpand
|
||||
\|delcommand RustEmitIr
|
||||
\|delcommand RustEmitAsm
|
||||
\|delcommand RustPlay
|
||||
\|nunmap <buffer> [[
|
||||
\|nunmap <buffer> ]]
|
||||
\|xunmap <buffer> [[
|
||||
\|xunmap <buffer> ]]
|
||||
\|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()
|
||||
|
||||
augroup END
|
||||
|
||||
setlocal matchpairs+=<:>
|
||||
|
@ -61,9 +61,9 @@ endfunction
|
||||
|
||||
augroup terraform
|
||||
autocmd!
|
||||
autocmd VimEnter *
|
||||
autocmd BufEnter *
|
||||
\ 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)
|
||||
autocmd BufWritePre *.tf call terraform#fmt()
|
||||
autocmd BufWritePre *.tfvars call terraform#fmt()
|
||||
|
@ -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>
|
||||
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
|
||||
|
@ -40,6 +40,15 @@ if !exists('g:python_pep8_indent_hang_closing')
|
||||
let g:python_pep8_indent_hang_closing = 0
|
||||
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 = {
|
||||
\ '^\s*elif\>': ['if', 'elif'],
|
||||
\ '^\s*except\>': ['try', 'except'],
|
||||
@ -59,29 +68,35 @@ else
|
||||
endif
|
||||
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") ' .
|
||||
\ '=~? "\\vcomment|jedi\\S"'
|
||||
|
||||
" Also ignore anything concealed.
|
||||
" 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
|
||||
if has('conceal')
|
||||
let s:skip_special_chars .= '|| s:is_concealed(line("."), col("."))'
|
||||
if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
|
||||
" 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.
|
||||
function! s:_skip_special_chars(line, col)
|
||||
return synIDattr(synID(a:line, a:col, 0), 'name')
|
||||
\ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
|
||||
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
|
||||
|
||||
|
||||
let s:skip_search = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
|
||||
\ '=~? "comment"'
|
||||
|
||||
" Use 'shiftwidth()' instead of '&sw'.
|
||||
" (Since Vim patch 7.3.629, 'shiftwidth' can be set to 0 to follow 'tabstop').
|
||||
if exists('*shiftwidth')
|
||||
@ -95,24 +110,21 @@ else
|
||||
endif
|
||||
|
||||
" Find backwards the closest open parenthesis/bracket/brace.
|
||||
function! s:find_opening_paren(...)
|
||||
" optional arguments: line and column (defaults to 1) to search around
|
||||
if a:0 > 0
|
||||
let view = winsaveview()
|
||||
call cursor(a:1, a:0 > 1 ? a:2 : 1)
|
||||
let ret = s:find_opening_paren()
|
||||
call winrestview(view)
|
||||
return ret
|
||||
function! s:find_opening_paren(lnum, col)
|
||||
" Return if cursor is in a comment.
|
||||
if synIDattr(synID(a:lnum, a:col, 0), 'name') =~? 'comment'
|
||||
return [0, 0]
|
||||
endif
|
||||
|
||||
" Return if cursor is in a comment.
|
||||
exe 'if' s:skip_search '| return [0, 0] | endif'
|
||||
call cursor(a:lnum, a:col)
|
||||
|
||||
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)
|
||||
let stopline = max([0, line('.') - maxoff, nearest[0]])
|
||||
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]))
|
||||
let nearest = next
|
||||
endif
|
||||
@ -127,7 +139,7 @@ function! s:find_start_of_multiline_statement(lnum)
|
||||
if getline(lnum - 1) =~# '\\$'
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
else
|
||||
let [paren_lnum, _] = s:find_opening_paren(lnum)
|
||||
let [paren_lnum, _] = s:find_opening_paren(lnum, 1)
|
||||
if paren_lnum < 1
|
||||
return lnum
|
||||
else
|
||||
@ -184,7 +196,7 @@ endfunction
|
||||
|
||||
" Line up with open parenthesis/bracket/brace.
|
||||
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
|
||||
return -2
|
||||
endif
|
||||
@ -214,7 +226,7 @@ function! s:indent_like_opening_paren(lnum)
|
||||
" from the next logical line.
|
||||
if text =~# b:control_statement && res == base + s:sw()
|
||||
" 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
|
||||
return res + s:sw()
|
||||
endif
|
||||
@ -267,24 +279,23 @@ function! s:indent_like_previous_line(lnum)
|
||||
let base = indent(start)
|
||||
let current = indent(a:lnum)
|
||||
|
||||
" Jump to last character in previous line.
|
||||
call cursor(lnum, len(text))
|
||||
let ignore_last_char = eval(s:skip_special_chars)
|
||||
" Ignore last character in previous line?
|
||||
let lastcol = len(text)
|
||||
let col = lastcol
|
||||
|
||||
" Search for final colon that is not inside something to be ignored.
|
||||
while 1
|
||||
let curpos = getpos('.')[2]
|
||||
if curpos == 1 | break | endif
|
||||
if eval(s:skip_special_chars) || text[curpos-1] =~# '\s'
|
||||
normal! h
|
||||
if col == 1 | break | endif
|
||||
if text[col-1] =~# '\s' || s:_skip_special_chars(lnum, col)
|
||||
let col = col - 1
|
||||
continue
|
||||
elseif text[curpos-1] ==# ':'
|
||||
elseif text[col-1] ==# ':'
|
||||
return base + s:sw()
|
||||
endif
|
||||
break
|
||||
endwhile
|
||||
|
||||
if text =~# '\\$' && !ignore_last_char
|
||||
if text =~# '\\$' && !s:_skip_special_chars(lnum, lastcol)
|
||||
" If this line is the continuation of a control statement
|
||||
" indent further to distinguish the continuation line
|
||||
" from the next logical line.
|
||||
@ -315,7 +326,7 @@ function! s:indent_like_previous_line(lnum)
|
||||
return -1
|
||||
endif
|
||||
|
||||
if !empty && s:is_dedented_already(current, base)
|
||||
if (current || !empty) && s:is_dedented_already(current, base)
|
||||
return -1
|
||||
endif
|
||||
|
||||
@ -366,11 +377,12 @@ function! GetPythonPEPIndent(lnum)
|
||||
if match_quotes != -1
|
||||
" closing multiline string
|
||||
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
|
||||
return indent(pairpos[0])
|
||||
else
|
||||
" TODO: test to cover this!
|
||||
return -1
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -26,7 +26,11 @@ if exists("*GoIndent")
|
||||
finish
|
||||
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)
|
||||
if prevlnum == 0
|
||||
" top of file
|
||||
@ -40,10 +44,17 @@ function! GoIndent(lnum)
|
||||
|
||||
let ind = previ
|
||||
|
||||
if prevl =~ ' = `[^`]*$'
|
||||
" previous line started a multi-line raw string
|
||||
return 0
|
||||
endif
|
||||
for synid in synstack(a:lnum, 1)
|
||||
if synIDattr(synid, 'name') == 'goRawString'
|
||||
if prevl =~ '\%(\%(:\?=\)\|(\|,\)\s*`[^`]*$'
|
||||
" 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*$'
|
||||
" previous line opened a block
|
||||
let ind += shiftwidth()
|
||||
@ -70,6 +81,10 @@ function! GoIndent(lnum)
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" restore Vi compatibility settings
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
@ -15,6 +15,10 @@ if exists("*GetGoHTMLTmplIndent")
|
||||
finish
|
||||
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)
|
||||
" Get HTML indent
|
||||
if exists('*HtmlIndent')
|
||||
@ -45,6 +49,10 @@ function! GetGoHTMLTmplIndent(lnum)
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" restore Vi compatibility settings
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
@ -4,8 +4,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') ==
|
||||
" Language: Mustache, Handlebars
|
||||
" Maintainer: Juvenn Woo <machese@gmail.com>
|
||||
" Screenshot: http://imgur.com/6F408
|
||||
" Version: 2
|
||||
" Last Change: Oct 10th 2015
|
||||
" Version: 3
|
||||
" Last Change: 26 Nov 2018
|
||||
" Remarks: based on eruby indent plugin by tpope
|
||||
" References:
|
||||
" [Mustache](http://github.com/defunkt/mustache)
|
||||
@ -21,6 +21,9 @@ endif
|
||||
unlet! b:did_indent
|
||||
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
|
||||
unlet! b:did_indent
|
||||
|
||||
@ -75,26 +78,48 @@ function! GetHandlebarsIndent(...)
|
||||
let b:indent.lnum = -1
|
||||
endif
|
||||
let lnum = prevnonblank(v:lnum-1)
|
||||
let line = getline(lnum)
|
||||
let cline = getline(v:lnum)
|
||||
let prevLine = getline(lnum)
|
||||
let currentLine = getline(v:lnum)
|
||||
|
||||
" all indent rules only apply if the block opening/closing
|
||||
" tag is on a separate line
|
||||
|
||||
" indent after block {{#block
|
||||
if line =~# '\v\s*\{\{\#.*\s*'
|
||||
if prevLine =~# '\v\s*\{\{\#.*\s*'
|
||||
let s:in_block_expr = 1
|
||||
let ind = ind + sw
|
||||
endif
|
||||
" unindent after block close {{/block}}
|
||||
if cline =~# '\v^\s*\{\{\/\S*\}\}\s*'
|
||||
" but not if the block ends on the same line
|
||||
if prevLine =~# '\v\s*\{\{\#(.+)(\s+|\}\}).*\{\{\/\1'
|
||||
let s:in_block_expr = 0
|
||||
let ind = ind - sw
|
||||
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}}
|
||||
if cline =~# '\v^\s*\{\{else.*\}\}\s*$'
|
||||
if currentLine =~# '\v^\s*\{\{else.*\}\}\s*$'
|
||||
let ind = ind - sw
|
||||
endif
|
||||
" indent again after {{else}}
|
||||
if line =~# '\v^\s*\{\{else.*\}\}\s*$'
|
||||
if prevLine =~# '\v^\s*\{\{else.*\}\}\s*$'
|
||||
let ind = ind + sw
|
||||
endif
|
||||
|
||||
|
@ -113,7 +113,7 @@ function GetLuaIndent()
|
||||
" restore cursor
|
||||
call setpos(".", original_cursor_pos)
|
||||
|
||||
return indent(prev_line) + (&sw * i)
|
||||
return indent(prev_line) + (shiftwidth() * i)
|
||||
|
||||
endfunction
|
||||
|
||||
|
@ -40,6 +40,15 @@ if !exists('g:python_pep8_indent_hang_closing')
|
||||
let g:python_pep8_indent_hang_closing = 0
|
||||
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 = {
|
||||
\ '^\s*elif\>': ['if', 'elif'],
|
||||
\ '^\s*except\>': ['try', 'except'],
|
||||
@ -59,29 +68,35 @@ else
|
||||
endif
|
||||
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") ' .
|
||||
\ '=~? "\\vcomment|jedi\\S"'
|
||||
|
||||
" Also ignore anything concealed.
|
||||
" 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
|
||||
if has('conceal')
|
||||
let s:skip_special_chars .= '|| s:is_concealed(line("."), col("."))'
|
||||
if !get(g:, 'python_pep8_indent_skip_concealed', 0) || !has('conceal')
|
||||
" 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.
|
||||
function! s:_skip_special_chars(line, col)
|
||||
return synIDattr(synID(a:line, a:col, 0), 'name')
|
||||
\ =~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"
|
||||
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
|
||||
|
||||
|
||||
let s:skip_search = 'synIDattr(synID(line("."), col("."), 0), "name") ' .
|
||||
\ '=~? "comment"'
|
||||
|
||||
" Use 'shiftwidth()' instead of '&sw'.
|
||||
" (Since Vim patch 7.3.629, 'shiftwidth' can be set to 0 to follow 'tabstop').
|
||||
if exists('*shiftwidth')
|
||||
@ -95,24 +110,21 @@ else
|
||||
endif
|
||||
|
||||
" Find backwards the closest open parenthesis/bracket/brace.
|
||||
function! s:find_opening_paren(...)
|
||||
" optional arguments: line and column (defaults to 1) to search around
|
||||
if a:0 > 0
|
||||
let view = winsaveview()
|
||||
call cursor(a:1, a:0 > 1 ? a:2 : 1)
|
||||
let ret = s:find_opening_paren()
|
||||
call winrestview(view)
|
||||
return ret
|
||||
function! s:find_opening_paren(lnum, col)
|
||||
" Return if cursor is in a comment.
|
||||
if synIDattr(synID(a:lnum, a:col, 0), 'name') =~? 'comment'
|
||||
return [0, 0]
|
||||
endif
|
||||
|
||||
" Return if cursor is in a comment.
|
||||
exe 'if' s:skip_search '| return [0, 0] | endif'
|
||||
call cursor(a:lnum, a:col)
|
||||
|
||||
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)
|
||||
let stopline = max([0, line('.') - maxoff, nearest[0]])
|
||||
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]))
|
||||
let nearest = next
|
||||
endif
|
||||
@ -127,7 +139,7 @@ function! s:find_start_of_multiline_statement(lnum)
|
||||
if getline(lnum - 1) =~# '\\$'
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
else
|
||||
let [paren_lnum, _] = s:find_opening_paren(lnum)
|
||||
let [paren_lnum, _] = s:find_opening_paren(lnum, 1)
|
||||
if paren_lnum < 1
|
||||
return lnum
|
||||
else
|
||||
@ -184,7 +196,7 @@ endfunction
|
||||
|
||||
" Line up with open parenthesis/bracket/brace.
|
||||
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
|
||||
return -2
|
||||
endif
|
||||
@ -214,7 +226,7 @@ function! s:indent_like_opening_paren(lnum)
|
||||
" from the next logical line.
|
||||
if text =~# b:control_statement && res == base + s:sw()
|
||||
" 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
|
||||
return res + s:sw()
|
||||
endif
|
||||
@ -267,24 +279,23 @@ function! s:indent_like_previous_line(lnum)
|
||||
let base = indent(start)
|
||||
let current = indent(a:lnum)
|
||||
|
||||
" Jump to last character in previous line.
|
||||
call cursor(lnum, len(text))
|
||||
let ignore_last_char = eval(s:skip_special_chars)
|
||||
" Ignore last character in previous line?
|
||||
let lastcol = len(text)
|
||||
let col = lastcol
|
||||
|
||||
" Search for final colon that is not inside something to be ignored.
|
||||
while 1
|
||||
let curpos = getpos('.')[2]
|
||||
if curpos == 1 | break | endif
|
||||
if eval(s:skip_special_chars) || text[curpos-1] =~# '\s'
|
||||
normal! h
|
||||
if col == 1 | break | endif
|
||||
if text[col-1] =~# '\s' || s:_skip_special_chars(lnum, col)
|
||||
let col = col - 1
|
||||
continue
|
||||
elseif text[curpos-1] ==# ':'
|
||||
elseif text[col-1] ==# ':'
|
||||
return base + s:sw()
|
||||
endif
|
||||
break
|
||||
endwhile
|
||||
|
||||
if text =~# '\\$' && !ignore_last_char
|
||||
if text =~# '\\$' && !s:_skip_special_chars(lnum, lastcol)
|
||||
" If this line is the continuation of a control statement
|
||||
" indent further to distinguish the continuation line
|
||||
" from the next logical line.
|
||||
@ -315,7 +326,7 @@ function! s:indent_like_previous_line(lnum)
|
||||
return -1
|
||||
endif
|
||||
|
||||
if !empty && s:is_dedented_already(current, base)
|
||||
if (current || !empty) && s:is_dedented_already(current, base)
|
||||
return -1
|
||||
endif
|
||||
|
||||
@ -366,11 +377,12 @@ function! GetPythonPEPIndent(lnum)
|
||||
if match_quotes != -1
|
||||
" closing multiline string
|
||||
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
|
||||
return indent(pairpos[0])
|
||||
else
|
||||
" TODO: test to cover this!
|
||||
return -1
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -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 defmodule copy use module defalias definterface eval
|
||||
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 fmt mac-only linux-only windows-only use-all when
|
||||
syn keyword carpSyntax unless defn-do comment forever-do case and* or*
|
||||
|
3003
syntax/cmake.vim
3003
syntax/cmake.vim
File diff suppressed because one or more lines are too long
@ -25,6 +25,7 @@ syn keyword cqlKeyword limit key keyspace
|
||||
syn keyword cqlKeyword on or primary reversed
|
||||
syn keyword cqlKeyword select set truncate
|
||||
syn keyword cqlKeyword where with update use using values
|
||||
syn keyword cqlKeyword asc desc
|
||||
|
||||
" CQL 3 additions
|
||||
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
|
||||
|
||||
" Variable Types
|
||||
syn keyword cqlType bytea ascii text varchar uuid varint int bigint
|
||||
syn keyword cqlType bytestype utf8type timeuuidtype timeuuid timestamp
|
||||
syn keyword cqlType bytea ascii text varchar uuid inet varint int bigint tinyint smallint
|
||||
syn keyword cqlType bytestype utf8type timeuuidtype timeuuid timestamp date time duration
|
||||
syn keyword cqlType blob boolean counter decimal double float
|
||||
syn keyword cqlType serializingcacheprovider
|
||||
syn keyword cqlType set list map tuple
|
||||
|
@ -25,7 +25,7 @@ syntax keyword dartConditional if else switch
|
||||
syntax keyword dartRepeat do while for
|
||||
syntax keyword dartBoolean true false
|
||||
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 match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
|
||||
syntax keyword dartType void var bool int double num dynamic covariant
|
||||
|
@ -105,8 +105,8 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l("
|
||||
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\/" end="\/" skip="\\\\\|\\\/" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
|
||||
|
||||
" 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*\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*\z1+ skip=+\\'+ fold
|
||||
|
||||
" Documentation
|
||||
if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs
|
||||
|
@ -47,7 +47,7 @@ syn match fsharpSymbol "\%(member\)\@<=\s\+\w\+\.\zs\w\+"
|
||||
|
||||
|
||||
" types
|
||||
syn match fsharpTypeName "\%(\<type\s\+\)\@<=\w\+"
|
||||
syn match fsharpTypeName "\%#=1\%(\<type\s\+\)\@<=\w\+"
|
||||
|
||||
|
||||
" errors
|
||||
@ -182,7 +182,7 @@ syn match fsharpFloat "\<-\=\d\(_\|\d\)*\.\(_\|\d\)*\([eE][-+]\=\d\(_
|
||||
syn match fsharpFloat "\<\d\+\.\d*"
|
||||
|
||||
" modules
|
||||
syn match fsharpModule "\%(\<open\s\+\)\@<=[a-zA-Z.]\+"
|
||||
syn match fsharpModule "\%#=1\%(\<open\s\+\)\@<=[a-zA-Z.]\+"
|
||||
|
||||
" attributes
|
||||
syn region fsharpAttrib matchgroup=fsharpAttribute start="\[<" end=">]"
|
||||
|
@ -21,6 +21,7 @@ syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite
|
||||
syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseBreak "\v^b%(reak)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
|
||||
syn match gitrebaseCommand ".*" contained
|
||||
syn match gitrebaseComment "^\s*#.*" contains=gitrebaseHash
|
||||
@ -35,6 +36,7 @@ hi def link gitrebaseSquash Type
|
||||
hi def link gitrebaseFixup Special
|
||||
hi def link gitrebaseExec Function
|
||||
hi def link gitrebaseDrop Comment
|
||||
hi def link gitrebaseBreak Macro
|
||||
hi def link gitrebaseSummary String
|
||||
hi def link gitrebaseComment Comment
|
||||
hi def link gitrebaseSquashError Error
|
||||
|
@ -376,8 +376,10 @@ function! s:hi()
|
||||
hi def goCoverageUncover ctermfg=red guifg=#F92672
|
||||
|
||||
" :GoDebug commands
|
||||
hi GoDebugBreakpoint term=standout ctermbg=117 ctermfg=0 guibg=#BAD4F5 guifg=Black
|
||||
hi GoDebugCurrent term=reverse ctermbg=12 ctermfg=7 guibg=DarkBlue guifg=White
|
||||
if go#config#HighlightDebug()
|
||||
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
|
||||
|
||||
augroup vim-go-hi
|
||||
|
@ -39,10 +39,26 @@ syntax match gomodReplaceOperator "\v\=\>"
|
||||
highlight default link gomodReplaceOperator Operator
|
||||
|
||||
|
||||
" highlight semver, note that this is very simple. But it works for now
|
||||
syntax match gomodVersion "v\d\+\.\d\+\.\d\+"
|
||||
syntax match gomodVersion "v\d\+\.\d\+\.\d\+-\S*"
|
||||
syntax match gomodVersion "v\d\+\.\d\+\.\d\++incompatible"
|
||||
" highlight versions:
|
||||
" * vX.Y.Z
|
||||
" * vX.0.0-yyyyymmddhhmmss-abcdefabcdef
|
||||
" * 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
|
||||
|
||||
let b:current_syntax = "gomod"
|
||||
|
@ -172,10 +172,10 @@ syntax match jsArrowFuncArgs /\<\K\k*\ze\s*=>/ skipwhite contains=jsFuncArgs
|
||||
" Matches a series of arguments surrounded in parens
|
||||
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 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_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_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 /()\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 : '')
|
||||
|
||||
" Classes
|
||||
syntax keyword jsClassKeyword contained class
|
||||
|
@ -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 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 juliaBaseTypeNum06 display "\<Complex\%(32\|64\|128\)\>"
|
||||
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 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 juliaBaseTypeArray1011 display "\<\%(Broadcast\|Adjoint\|Transpose\|LinearIndices\)\>"
|
||||
syntax match juliaBaseTypeArray1011 display "\<\%(Broadcasted\|Adjoint\|Transpose\|LinearIndices\)\>"
|
||||
syntax match juliaBaseTypeDict display "\<\%(WeakKey\)\?Dict\>"
|
||||
syntax match juliaBaseTypeDict06 display "\<ObjectIdDict\>"
|
||||
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 . '\)*"'
|
||||
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="@.(" 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
|
||||
|
||||
|
@ -21,7 +21,7 @@ syn keyword ktException try catch finally throw
|
||||
syn keyword ktInclude import package
|
||||
|
||||
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 ktReservedKeyword typeof
|
||||
|
@ -117,7 +117,7 @@ syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_\(_\|\s\)*$/
|
||||
" YAML frontmatter
|
||||
if get(g:, 'vim_markdown_frontmatter', 0)
|
||||
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
|
||||
endif
|
||||
|
||||
|
@ -4,8 +4,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') ==
|
||||
" Language: Mustache, Handlebars
|
||||
" Maintainer: Juvenn Woo <machese@gmail.com>
|
||||
" Screenshot: http://imgur.com/6F408
|
||||
" Version: 2
|
||||
" Last Change: Oct 26th 2013
|
||||
" Version: 5
|
||||
" Last Change: Nov 23rd 2018
|
||||
" Remark:
|
||||
" It lexically hilights embedded mustaches (exclusively) in html file.
|
||||
" While it was written for Ruby-based Mustache template system, it should
|
||||
@ -43,15 +43,17 @@ endif
|
||||
|
||||
syntax match mustacheError '}}}\?'
|
||||
syntax match mustacheInsideError '{{[{$#<>=!\/]\?'
|
||||
syntax region mustacheInside start=/{{[^!]/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer
|
||||
syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax region mustacheSection start='{{[$#^/]'lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax region mustacheInside start=/{{[^!][$#^/]\?/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer
|
||||
syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,mustacheParam,@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 mustacheMarkerSet start=/{{=/lc=2 end=/=}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer
|
||||
syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside
|
||||
syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection
|
||||
syntax match mustacheConditionals '\([/#]\?if\|unless\|else\)' contained containedin=mustacheInside
|
||||
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 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
|
||||
@ -67,8 +69,8 @@ syntax cluster htmlMustacheContainer add=htmlHead,htmlTitle,htmlString,htmlH1,ht
|
||||
HtmlHiLink mustacheVariable Number
|
||||
HtmlHiLink mustacheVariableUnescape Number
|
||||
HtmlHiLink mustachePartial Number
|
||||
HtmlHiLink mustacheSection Number
|
||||
HtmlHiLink mustacheMarkerSet Number
|
||||
HtmlHiLink mustacheParam htmlArg
|
||||
|
||||
HtmlHiLink mustacheComment Comment
|
||||
HtmlHiLink mustacheBlockComment Comment
|
||||
|
@ -40,14 +40,14 @@ syn keyword nimKeyword bind block break
|
||||
syn keyword nimKeyword case cast concept const continue converter
|
||||
syn keyword nimKeyword defer discard distinct div do
|
||||
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 if import in include interface is isnot iterator
|
||||
syn keyword nimKeyword let
|
||||
syn keyword nimKeyword mixin using mod
|
||||
syn keyword nimKeyword nil not notin
|
||||
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 raise ref return
|
||||
syn keyword nimKeyword shared shl shr static
|
||||
|
@ -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)
|
||||
" 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')"
|
||||
" 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_heredoc = 1 for HTML syntax highlighting inside heredocs (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
|
||||
|
||||
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.
|
||||
if !exists("php_folding")
|
||||
let php_folding = 0
|
||||
@ -667,6 +684,9 @@ if version >= 704
|
||||
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
|
||||
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
|
||||
else
|
||||
" @copy phpHereDoc strip_maximum_size
|
||||
@ -680,6 +700,9 @@ else
|
||||
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
|
||||
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
|
||||
endif
|
||||
|
||||
@ -695,6 +718,9 @@ if version >= 704
|
||||
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
|
||||
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
|
||||
else
|
||||
" @copy phpHereDoc strip_maximum_size
|
||||
@ -708,6 +734,9 @@ else
|
||||
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
|
||||
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
|
||||
endif
|
||||
|
||||
|
@ -110,7 +110,7 @@ syn match purescriptForall "∀"
|
||||
|
||||
" Keywords
|
||||
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 purescriptWhere where
|
||||
syn match purescriptStructure "\<\(data\|newtype\|type\|kind\)\>"
|
||||
|
@ -3,7 +3,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'raml') == -1
|
||||
" Vim syntax file
|
||||
" Language: RAML (RESTful API Modeling Language)
|
||||
" 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")
|
||||
finish
|
||||
|
@ -23,9 +23,12 @@ syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipe
|
||||
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 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 rustPanic "\<panic\(\w\)*!" contained
|
||||
syn match rustKeyword "\<async\%(\s\|\n\)\@="
|
||||
syn keyword rustKeyword break
|
||||
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
|
||||
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 rustStructure Keyword " More precise is Structure
|
||||
hi def link rustUnion rustStructure
|
||||
hi def link rustExistential rustKeyword
|
||||
hi def link rustPubScopeDelim Delimiter
|
||||
hi def link rustPubScopeCrate rustKeyword
|
||||
hi def link rustSuper rustKeyword
|
||||
|
1226
syntax/terraform.vim
1226
syntax/terraform.vim
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
hi def link tomlTableArray Identifier
|
||||
hi def link tomlTableArray Title
|
||||
|
||||
syn keyword tomlTodo TODO FIXME XXX BUG contained
|
||||
hi def link tomlTodo Todo
|
||||
|
@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1
|
||||
|
||||
" vifm syntax file
|
||||
" 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.
|
||||
|
||||
if exists('b:current_syntax')
|
||||
@ -15,16 +15,16 @@ let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
" 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
|
||||
\ 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
|
||||
\ lstrash marks media mes[sages] mkdir m[ove] noh[lsearch] on[ly] popd pushd
|
||||
\ pu[t] pw[d] qa[ll] q[uit] redr[aw] reg[isters] regular rename restart
|
||||
\ restore rlink screen sh[ell] siblnext siblprev sor[t] sp[lit] s[ubstitute]
|
||||
\ tabc[lose] tabm[ove] tabname tabnew touch tr trashes tree sync undol[ist]
|
||||
\ ve[rsion] vie[w] vifm vs[plit] winc[md] w[rite] wq wqa[ll] xa[ll] x[it]
|
||||
\ y[ank]
|
||||
\ fini[sh] go[to] gr[ep] h[elp] hideui histnext his[tory] histprev jobs
|
||||
\ locate ls lstrash marks media mes[sages] mkdir m[ove] noh[lsearch] on[ly]
|
||||
\ popd pushd pu[t] pw[d] qa[ll] q[uit] redr[aw] reg[isters] regular rename
|
||||
\ restart restore rlink screen sh[ell] siblnext siblprev sor[t] sp[lit]
|
||||
\ s[ubstitute] tabc[lose] tabm[ove] tabname tabnew tabn[ext] tabp[revious]
|
||||
\ touch tr trashes tree sync undol[ist] ve[rsion] vie[w] vifm vs[plit]
|
||||
\ winc[md] w[rite] wq wqa[ll] xa[ll] x[it] y[ank]
|
||||
\ nextgroup=vifmArgs
|
||||
|
||||
" commands that might be prepended to a command without changing everything else
|
||||
|
Loading…
x
Reference in New Issue
Block a user