Compare commits

...

10 Commits

Author SHA1 Message Date
Adam Stankiewicz
c161994e96 Add pony support 2018-12-26 20:33:28 +01:00
Adam Stankiewicz
f238378221 Switch dockerfile provider 2018-12-26 20:22:36 +01:00
Adam Stankiewicz
0d5f661cfd Add moonscript support 2018-12-26 20:15:18 +01:00
Adam Stankiewicz
e99f88ff00 Add orgmode support 2018-12-26 11:36:38 +01:00
Adam Stankiewicz
cad135aa01 Add rst support 2018-12-26 11:22:36 +01:00
Adam Stankiewicz
678fc65514 Change i3 provider 2018-12-26 11:19:25 +01:00
Adam Stankiewicz
aad3df96e7 Update 2018-12-26 10:56:23 +01:00
Adam Stankiewicz
629a1e1c93 Update 2018-12-26 10:47:46 +01:00
Adam Stankiewicz
d43b70d939 Update 2018-12-26 10:41:57 +01:00
Derek Sifford
ec1c943069 explicitly set locale to C for sorting so README sorts same on all systems (#348) 2018-10-10 11:18:01 +02:00
75 changed files with 8007 additions and 631 deletions

View File

@@ -8,7 +8,7 @@ A collection of language packs for Vim.
> One to rule them all, one to find them, one to bring them all and in the darkness bind them. > One to rule them all, one to find them, one to bring them all and in the darkness bind them.
- It **won't affect your startup time**, as scripts are loaded only on demand\*. - It **won't affect your startup time**, as scripts are loaded only on demand\*.
- It **installs and updates 100+ times faster** than the <!--Package Count-->114<!--/Package Count--> packages it consists of. - It **installs and updates 100+ times faster** than the <!--Package Count-->118<!--/Package Count--> packages it consists of.
- Solid syntax and indentation support (other features skipped). Only the best language packs. - Solid syntax and indentation support (other features skipped). Only the best language packs.
- All unnecessary files are ignored (like enormous documentation from php support). - All unnecessary files are ignored (like enormous documentation from php support).
- No support for esoteric languages, only most popular ones (modern too, like `slim`). - No support for esoteric languages, only most popular ones (modern too, like `slim`).
@@ -63,7 +63,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin) - [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin)
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin) - [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin)
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin) - [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin)
- [dockerfile](https://github.com/docker/docker) (syntax) - [dockerfile](https://github.com/ekalinin/Dockerfile.vim) (syntax, indent, ftplugin)
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin) - [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin)
- [elm](https://github.com/ElmCast/elm-vim) (syntax, indent, autoload, ftplugin) - [elm](https://github.com/ElmCast/elm-vim) (syntax, indent, autoload, ftplugin)
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin) - [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin)
@@ -85,7 +85,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin) - [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax) - [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin) - [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
- [i3](https://github.com/PotatoesMaster/i3-vim-syntax) (syntax, ftplugin) - [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax) - [jasmine](https://github.com/glanotte/vim-jasmine) (syntax)
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras) - [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent) - [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
@@ -103,6 +103,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin) - [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin)
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent) - [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent)
- [mathematica](https://github.com/rsmenon/vim-mathematica) (syntax, ftplugin) - [mathematica](https://github.com/rsmenon/vim-mathematica) (syntax, ftplugin)
- [moonscript](https://github.com/leafo/moonscript-vim) (syntax, indent, ftplugin)
- [nginx](https://github.com/chr4/nginx.vim) (syntax, indent, ftplugin) - [nginx](https://github.com/chr4/nginx.vim) (syntax, indent, ftplugin)
- [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent) - [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent)
- [nix](https://github.com/LnL7/vim-nix) (syntax, indent, compiler, ftplugin) - [nix](https://github.com/LnL7/vim-nix) (syntax, indent, compiler, ftplugin)
@@ -110,10 +111,12 @@ If you need full functionality of any plugin, please use it directly with your p
- [ocaml](https://github.com/jrk/vim-ocaml) (syntax, indent, ftplugin) - [ocaml](https://github.com/jrk/vim-ocaml) (syntax, indent, ftplugin)
- [octave](https://github.com/vim-scripts/octave.vim--) (syntax) - [octave](https://github.com/vim-scripts/octave.vim--) (syntax)
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin) - [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin)
- [org](https://github.com/jceb/vim-orgmode) (syntax, indent, ftplugin)
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin) - [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin)
- [pgsql](https://github.com/exu/pgsql.vim) (syntax) - [pgsql](https://github.com/exu/pgsql.vim) (syntax)
- [php](https://github.com/StanAngeloff/php.vim) (syntax) - [php](https://github.com/StanAngeloff/php.vim) (syntax)
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin) - [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin)
- [pony](https://github.com/jakwings/vim-pony) (syntax, indent, autoload, ftplugin)
- [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, ftplugin) - [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, ftplugin)
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent) - [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent)
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin) - [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin)
@@ -128,6 +131,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [ragel](https://github.com/jneen/ragel.vim) (syntax) - [ragel](https://github.com/jneen/ragel.vim) (syntax)
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin) - [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin)
- [rspec](https://github.com/sheerun/rspec.vim) (syntax) - [rspec](https://github.com/sheerun/rspec.vim) (syntax)
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, autoload, ftplugin)
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin) - [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin)
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin) - [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin)
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax) - [sbt](https://github.com/derekwyatt/vim-sbt) (syntax)

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()

54
autoload/RstFold.vim Normal file
View File

@@ -0,0 +1,54 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rst') == -1
" Author: Antony Lee <anntzer.lee@gmail.com>
" Description: Helper functions for reStructuredText syntax folding
" Last Modified: 2018-01-07
function s:CacheRstFold()
let closure = {'header_types': {}, 'max_level': 0, 'levels': {}}
function closure.Process(match) dict
let curline = getcurpos()[1]
if has_key(self.levels, curline - 1)
" For over+under-lined headers, the regex will match both at the
" overline and at the title itself; in that case, skip the second match.
return
endif
let lines = split(a:match, '\n')
let key = repeat(lines[-1][0], len(lines))
if !has_key(self.header_types, key)
let self.max_level += 1
let self.header_types[key] = self.max_level
endif
let self.levels[curline] = self.header_types[key]
endfunction
let save_cursor = getcurpos()
let save_mark = getpos("'[")
silent keeppatterns %s/\v^%(%(([=`:.'"~^_*+#-])\1+\n)?.{1,2}\n([=`:.'"~^_*+#-])\2+)|%(%(([=`:.''"~^_*+#-])\3{2,}\n)?.{3,}\n([=`:.''"~^_*+#-])\4{2,})$/\=closure.Process(submatch(0))/gn
call setpos('.', save_cursor)
call setpos("'[", save_mark)
let b:RstFoldCache = closure.levels
endfunction
function RstFold#GetRstFold()
if !has_key(b:, 'RstFoldCache')
call s:CacheRstFold()
endif
if has_key(b:RstFoldCache, v:lnum)
return '>' . b:RstFoldCache[v:lnum]
else
return '='
endif
endfunction
function RstFold#GetRstFoldText()
if !has_key(b:, 'RstFoldCache')
call s:CacheRstFold()
endif
let indent = repeat(' ', b:RstFoldCache[v:foldstart] - 1)
let thisline = getline(v:foldstart)
" For over+under-lined headers, skip the overline.
let text = thisline =~ '^\([=`:.''"~^_*+#-]\)\1\+$' ? getline(v:foldstart + 1) : thisline
return indent . text
endfunction
endif

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

536
autoload/pony.vim Normal file
View File

@@ -0,0 +1,536 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pony') == -1
" Vim plugin file
" Language: Pony
" Maintainer: Jak Wings
" TODO: Make sure echomsg is off for release.
let s:cpo_save = &cpo
set cpo&vim
"let s:skip = '<SID>InCommentOrLiteral(line("."), col("."))'
let s:skip2 = '<SID>InLiteral(line("."), col(".")) || <SID>InComment(line("."), col(".")) == 1'
let s:skip3 = '!<SID>InKeyword(line("."), col("."))'
let s:skip4 = '!<SID>InBracket(line("."), col("."))'
let s:cfstart = '\v<%(ifdef|if|match|while|for|repeat|try|with|recover|object|lambda|iftype)>'
let s:cfmiddle = '\v<%(then|elseif|else|until|do|in|elseiftype)>|\|'
let s:cfend = '\v<end>'
let s:bstartp = '\v<%(ifdef|if|then|elseif|else|(match)|while|for|in|do|try|with|recover|repeat|until|(object)|lambda|iftype|elseiftype)>'
function! pony#Indent()
if v:lnum <= 1
return 0
endif
call cursor(v:lnum, 1)
let l:pnzpos = searchpos('.', 'cbnW')
if l:pnzpos == [0, 0]
return 0
endif
if s:InComment2(l:pnzpos) > 1
"echomsg 'Comment' (l:pnzpos[0] . '-' . v:lnum) -1
return cindent(v:lnum)
endif
if s:InLiteral2(l:pnzpos)
"echomsg 'String' (l:pnzpos[0] . '-' . v:lnum) -1
return -1
endif
unlet! l:pnzpos
" NOTE: Lines started in comments and strings are checked already.
let l:pnblnum = s:PrevNonblank(v:lnum - 1)
if l:pnblnum < 1
return 0
endif
let l:pnbline = getline(l:pnblnum)
let l:pnbindent = indent(l:pnblnum)
let l:line = getline(v:lnum)
let l:indent = l:pnbindent
let l:shiftwidth = shiftwidth()
" FIXME?
let l:continuing = 0
" If the previous line ends with a unary or binary operator,
if s:IsContinued(l:pnblnum)
let l:contlnum = l:pnblnum
let l:ppcontinued = 0
let l:ppnblnum = s:PrevNonblank(l:pnblnum - 1)
while s:IsContinued(l:ppnblnum)
let l:ppcontinued += 1
let l:contlnum = l:ppnblnum
let l:ppnblnum = s:PrevNonblank(l:ppnblnum - 1)
endwhile
"echomsg 'Continued1' l:pnblnum l:contlnum
" If the previous line is also continuing another line,
if l:ppcontinued
let l:continuing = 1
if getline(l:contlnum) =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
" reset the indent level.
"echomsg 'Continuing0' (l:contlnum . '-' . v:lnum) (l:shiftwidth * 2)
let l:indent = l:shiftwidth * 2
else
" keep using the previous indent.
"echomsg 'Continuing1' (l:pnblnum . '-' . v:lnum) l:pnbindent
let l:indent = l:pnbindent
endif
" if the previous line is part of the definition of a class,
elseif l:pnbline =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
" reset the indent level.
"echomsg 'Continuing2' (l:pnblnum . '-' . v:lnum) (l:shiftwidth * 2)
let l:continuing = 1
let l:indent = l:shiftwidth * 2
" if the previous line is part of the definition of a method,
elseif l:pnbline =~# '\v^\s*%(fun|new|be)>'
" reset the indent level.
"echomsg 'Continuing3' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth)
let l:continuing = 1
let l:indent = l:pnbindent + l:shiftwidth
" if the previous line is the start of a definition body,
elseif l:pnbline =~# '=>\s*$'
" indent this line.
"echomsg 'Continuing4' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth)
let l:continuing = 1
let l:indent = l:pnbindent + l:shiftwidth
else
" indent this line twice as far.
"echomsg 'Continuing5' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth * 2)
let l:continuing = 1
let l:indent = l:pnbindent + l:shiftwidth * 2
endif
unlet! l:contlnum l:ppnblnum l:ppcontinued
endif
" If this line starts a document string,
if !l:continuing && l:line =~# '^\s*"""'
let l:ppnblnum = s:PrevNonblank(l:pnblnum - 1)
if s:IsContinued(l:ppnblnum)
let l:contlnum = l:ppnblnum
while s:IsContinued(l:ppnblnum)
let l:contlnum = l:ppnblnum
let l:ppnblnum = s:PrevNonblank(l:ppnblnum - 1)
endwhile
if getline(l:contlnum) =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
" reset the indent level.
"echomsg 'DocString' (l:contlnum . '-' . v:lnum) l:shiftwidth
return l:shiftwidth
endif
endif
unlet! l:contlnum l:ppnblnum
endif
" If the previous line contains an unmatched opening bracket
if !l:continuing && l:pnbline =~# '[{[(]'
" if the line ends with an opening bracket,
if l:pnbline =~# '[{[(]\s*$' && !s:InCommentOrLiteral(l:pnblnum, col([l:pnblnum, '$']) - 1)
" indent this line.
let l:indent += l:shiftwidth
else
" find the unmatched opening bracket,
let l:start = [0, 0]
let l:end = col([l:pnblnum, '$']) - 1
call cursor(l:pnblnum, l:end)
while l:end > 0
let l:start = s:OuterPos(l:start, searchpairpos('(', '', ')', 'bnW', s:skip4, l:pnblnum))
let l:start = s:OuterPos(l:start, searchpairpos('\[', '', '\]', 'bnW', s:skip4, l:pnblnum))
let l:start = s:OuterPos(l:start, searchpairpos('{', '', '}', 'bnW', s:skip4, l:pnblnum))
if l:start == [0, 0]
break
endif
" find the matched closing bracket on the same line,
call cursor(l:start[0], l:start[1])
let l:c = s:CharAtCursor(l:start[0], l:start[1])
if searchpair(escape(l:c, '['), '', escape(tr(l:c, '([{', ')]}'), ']'),
\ 'znW', s:skip4, l:pnblnum) < 1
" the unmatched opening bracket is found,
break
endif
let l:end = l:start[1]
let l:start = [0, 0]
endwhile
if l:start != [0, 0]
" indent this line.
"echomsg 'Open bracket' (l:pnblnum . '-' . v:lnum) (l:indent + l:shiftwidth)
let l:indent += l:shiftwidth
endif
endif
unlet! l:start l:end l:c
endif
" If there is a matched closing bracket on the previous line,
" NOTE:
" >|[
" | (1 -
" | 1) * 2]
" | command
" ^
if !l:continuing
call cursor(l:pnblnum, 1)
" find the last closing bracket,
let l:end = [0, 0]
let l:end = s:OuterPos(l:end, searchpairpos('(', '', ')', 'zncr', s:skip4, l:pnblnum))
let l:end = s:OuterPos(l:end, searchpairpos('\[', '', '\]', 'zncr', s:skip4, l:pnblnum))
let l:end = s:OuterPos(l:end, searchpairpos('{', '', '}', 'zncr', s:skip4, l:pnblnum))
if l:end != [0, 0]
" find the matched opening bracket on another line,
let l:c = s:CharAtCursor(l:end[0], l:end[1])
let l:start = searchpairpos(escape(tr(l:c, ')]}', '([{'), '['), '', escape(l:c, ']'), 'nbW', s:skip4)
if l:start[0] != l:end[0]
" and then this line has the same indent as the line the matched bracket stays.
"echomsg 'Matched bracket' (l:start[0] . '-' . v:lnum) indent(l:start[0])
let l:indent = indent(l:start[0])
endif
endif
unlet! l:start l:end l:c
endif
" If there is a matched closing bracket on this line,
" NOTE:
" |[
" >| (1 -
" | 1) * 2
" |]
" ^ ^
if l:line =~# '^\s*[)\]}]'
" find the first closing bracket,
call cursor(v:lnum, 1)
let l:end = [0, 0]
let l:end = s:InnerPos(l:end, searchpairpos('(', '', ')', 'zncW', s:skip4, v:lnum))
let l:end = s:InnerPos(l:end, searchpairpos('\[', '', '\]', 'zncW', s:skip4, v:lnum))
let l:end = s:InnerPos(l:end, searchpairpos('{', '', '}', 'zncW', s:skip4, v:lnum))
if l:end != [0, 0]
" find the matched opening bracket on another line,
let l:c = s:CharAtCursor(l:end[0], l:end[1])
let l:start = searchpairpos(escape(tr(l:c, ')]}', '([{'), '['), '', escape(l:c, ']'), 'nbW', s:skip4)
if l:start[0] != l:end[0]
" and then this line has the same indent as the line the matched bracket stays.
"echomsg 'Closing Bracket' (l:start[0] . '-' . v:lnum) indent(l:start[0])
let l:indent = indent(l:start[0])
endif
endif
unlet! l:start l:end l:c
endif
" If this line starts the definition of a method, closure or match case,
if l:line =~# '^\s*=>'
" find the start of the definition,
call cursor(v:lnum, 1)
let l:start = searchpairpos('\v<%(new|be|fun|lambda)>|\|', '', '=>\zs', 'bnW', s:skip3)
if l:start != [0, 0]
" then this line has the same indent as the start.
"echomsg 'Method body' (l:start[0] . '-' . v:lnum) indent(l:start[0])
return indent(l:start[0])
endif
unlet! l:start
endif
" If this line starts a class definition or starts an alias,
if l:line =~# '\v^\s*%(actor|class|struct|primitive|trait|interface|use|type)>'
" reset the indent level.
return 0
endif
" If this line starts a method definition,
if l:line =~# '\v^\s*%(new|be|fun)>'
call cursor(v:lnum, 1)
let l:start = searchpairpos(s:cfstart, s:cfmiddle, s:cfend, 'bW', s:skip3)
if l:start != [0, 0]
let l:start = searchpos(s:bstartp, 'zcnpW', l:start[0])
" see if it is in an object block,
if l:start[2] == 3
"echomsg 'Method in object' (l:start[0] . '-' . v:lnum) (l:shiftwidth + indent(l:start[0]))
return l:shiftwidth + indent(l:start[0])
endif
endif
return l:shiftwidth
endif
" If this line starts a match case,
call cursor(v:lnum, 1)
if l:line =~# '^\s*|' && s:InKeyword(searchpos('|', 'znW', v:lnum))
" find the start or the previous case of the match block,
let l:start = searchpairpos(s:cfstart, s:cfmiddle, s:cfend, 'bnW', s:skip3)
if l:start != [0, 0]
" then this line has the same indent as the start.
"echomsg 'Match case' (l:start[0] . '-' . v:lnum) indent(l:start[0])
return indent(l:start[0])
endif
unlet! l:start
endif
" If this line ends (part of) a control flow,
if l:line =~# '\v^\s*%(end|elseif|else|then|in|do|until|elseiftype)>'
" find the start or middle of the control block,
call cursor(v:lnum, 1)
let l:start = searchpairpos(s:cfstart, s:cfmiddle, s:cfend, 'bnW', s:skip3)
if l:start != [0, 0]
" then this line has the same indent as the start.
"echomsg 'Block end' (l:start[0] . '-' . v:lnum) indent(l:start[0])
return indent(l:start[0])
endif
unlet! l:start
endif
" If the previous line starts a class definition,
if l:pnbline =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
" reset the indent level.
if s:IsContinued(l:pnblnum)
return l:shiftwidth * 2
else
return l:shiftwidth
endif
endif
" If the previous line starts a method definition,
if l:pnbline =~# '\v^\s*%(new|be|fun)>'
return l:pnbindent + l:shiftwidth
endif
" If the previous line starts (part of) a control flow,
call cursor(l:pnblnum, 1)
while 1
" find the start of the control block,
let l:start = searchpos(s:bstartp, 'zcepW', l:pnblnum)
if l:start[2] == 0
break
endif
if !s:InKeyword(l:start[0:1])
call cursor(l:pnblnum, l:start[1] + 3)
continue
endif
let l:index = l:start[2]
" find the end of the control block on the same line,
let l:end = searchpair(s:cfstart, '', s:cfend, 'znW', s:skip3, l:pnblnum)
" if the control block is not ended,
if l:end < 1
" if this line is a case for a match,
if l:index == 2 && l:line =~# '^\s*|'
" then this line has the same indent as the start of the match block.
return l:pnbindent
else
" then indent this line.
"echomsg 'Block start' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth)
return l:pnbindent + l:shiftwidth
endif
endif
endwhile
unlet! l:start l:end l:index
return l:indent
endfunction
function! s:PrevNonblank(lnum)
let l:lnum = prevnonblank(a:lnum)
while l:lnum > 0 && (s:InComment2(l:lnum, 1) || s:InLiteral2(l:lnum, 1))
let l:lnum = prevnonblank(l:lnum - 1)
endwhile
return l:lnum
endfunction
" NOTE:
" v
" |1 /* comment */
" |2
function! s:IsContinued(lnum)
let l:lnum = s:PrevNonblank(a:lnum)
if l:lnum < 1
return 0
endif
let l:line = getline(l:lnum)
let l:width = strwidth(substitute(l:line, '\s*$', '', ''))
" FIXME?
" | 1 + //
" | //
" | 2
return !s:InCommentOrLiteral(a:lnum, l:width)
\ && (l:line =~# '\v<%(and|or|xor|is|isnt|as|not|consume|addressof|digestof)\s*$'
\ || l:line =~# '\v%([=\-.]\>|[<!=>]\=\~?|\<\<\~?|\>\>\~?|\<:|[+\-*/%<>]\~?|[.,|:@~])\s*$'
\ )
endfunction
function! s:InCommentOrLiteral(...)
return call('s:InComment', a:000) || call('s:InLiteral', a:000)
endfunction
function! s:InKeyword(...)
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
for id in s:Or(synstack(l:lnum, l:col), [])
if synIDattr(id, 'name') =~# '^ponyKw'
return 1
endif
endfor
return 0
endfunction
function! s:InBracket(...)
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
for id in s:Or(synstack(l:lnum, l:col), [])
if synIDattr(id, 'name') ==# 'ponyBracket'
return 1
endif
endfor
return 0
endfunction
function! s:InComment(...)
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
let l:stack = synstack(l:lnum, l:col)
let l:i = len(l:stack)
while l:i > 0
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
if l:sname =~# '^ponyNestedCommentX\?$'
return 1 + l:i - (l:sname =~# 'X$')
elseif l:sname =~# '^ponyCommentX\?$'
return 1
endif
let l:i -= 1
endwhile
return 0
endfunction
function! s:InLiteral(...)
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
let l:stack = synstack(l:lnum, l:col)
let l:i = len(l:stack)
while l:i > 0
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
if l:sname =~# '^ponyDocumentStringX\?$'
return 3
elseif l:sname =~# '^ponyStringX\?$'
return 2
elseif l:sname =~# '^ponyCharacterX\?$'
return 1
endif
let l:i -= 1
endwhile
return 0
endfunction
" NOTE:
" |// //inside
" ^^^^^^^^^^
" |/* /*inside*/ */
" ^^^^^^^^^^^^^^
function! s:InComment2(...)
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
let l:stack = synstack(l:lnum, l:col)
let l:i = len(l:stack)
while l:i > 0
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
if l:sname ==# 'ponyNestedComment'
return 1 + l:i
elseif l:sname ==# 'ponyComment'
return 1
elseif l:sname =~# '\v^pony%(Nested)?CommentX$'
return 0
endif
let l:i -= 1
endwhile
return 0
endfunction
" NOTE:
" |"inside"
" ^^^^^^
" |"""inside"""""
" ^^^^^^^^^^^^
function! s:InLiteral2(...)
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
let l:stack = synstack(l:lnum, l:col)
let l:i = len(l:stack)
while l:i > 0
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
if l:sname ==# 'ponyDocumentString'
return 3
elseif l:sname ==# 'ponyString'
return 2
elseif l:sname ==# 'ponyCharacter'
return 1
elseif l:sname =~# '\v^pony%(DocumentString|String|Character)X$'
return 0
endif
let l:i -= 1
endwhile
return 0
endfunction
function! s:CharAtCursor(...)
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
return matchstr(getline(l:lnum), '\%' . l:col . 'c.')
endfunction
function! s:Or(x, y)
return !empty(a:x) ? a:x : a:y
endfunction
function! s:InnerPos(x, y)
if a:x == [0, 0]
return a:y
elseif a:y == [0, 0]
return a:x
else
return a:x[1] < a:y[1] ? a:x : a:y
end
endfunction
function! s:OuterPos(x, y)
if a:x == [0, 0]
return a:y
elseif a:y == [0, 0]
return a:x
else
return a:x[1] > a:y[1] ? a:x : a:y
end
endfunction
function! pony#ClearTrailingSpace(all, alt, ...)
let l:force = (a:0 > 0 ? a:1 : 0)
if !l:force && (&readonly || !&modifiable || !&modified)
return
endif
if a:all
for lnum in range(1, line('$'))
let l:line = getline(lnum)
let l:end = col([lnum, '$']) - 1
if l:end > 0 && l:line =~# '\s$' && !s:InLiteral(lnum, l:end)
if a:alt
call setline(lnum, substitute(l:line, '\S\@<=\s\s*$', '', ''))
else
call setline(lnum, substitute(l:line, '\s\+$', '', ''))
endif
endif
endfor
else
let l:lnum = line('.')
let l:end = col('$') - 1
let l:line = getline(l:lnum)
if l:line =~# '\s$' && !s:InLiteral(l:lnum, l:end)
if a:alt
call setline(l:lnum, substitute(l:line, '\s\+$', '', ''))
else
call setline(l:lnum, substitute(l:line, '\S\@<=\s\s*$', '', ''))
endif
endif
endif
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
endif

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

10
build
View File

@@ -130,7 +130,7 @@ update_readme() {
local tf of local tf of
tf="$(mktemp)" tf="$(mktemp)"
of="$(mktemp)" of="$(mktemp)"
sort <<<"$OUTPUT" | grep -vxE '[[:space:]]*' > "$of" LC_ALL=C sort <<<"$OUTPUT" | grep -vxE '[[:space:]]*' > "$of"
awk 'suppress == 0 { awk 'suppress == 0 {
gsub(/<!--Package Count-->[^<]*<!--\/Package Count-->/, gsub(/<!--Package Count-->[^<]*<!--\/Package Count-->/,
@@ -172,7 +172,7 @@ PACKS="
cql:elubow/cql-vim cql:elubow/cql-vim
cucumber:tpope/vim-cucumber cucumber:tpope/vim-cucumber
dart:dart-lang/dart-vim-plugin dart:dart-lang/dart-vim-plugin
dockerfile:docker/docker::/contrib/syntax/vim/ dockerfile:ekalinin/Dockerfile.vim
elixir:elixir-lang/vim-elixir elixir:elixir-lang/vim-elixir
elm:ElmCast/elm-vim elm:ElmCast/elm-vim
emberscript:yalesov/vim-ember-script emberscript:yalesov/vim-ember-script
@@ -194,7 +194,7 @@ PACKS="
haskell:neovimhaskell/haskell-vim haskell:neovimhaskell/haskell-vim
haxe:yaymukund/vim-haxe haxe:yaymukund/vim-haxe
html5:othree/html5.vim html5:othree/html5.vim
i3:PotatoesMaster/i3-vim-syntax i3:mboughaba/i3config.vim
jasmine:glanotte/vim-jasmine jasmine:glanotte/vim-jasmine
javascript:pangloss/vim-javascript:_JAVASCRIPT javascript:pangloss/vim-javascript:_JAVASCRIPT
jenkins:martinda/Jenkinsfile-vim-syntax jenkins:martinda/Jenkinsfile-vim-syntax
@@ -212,6 +212,7 @@ PACKS="
mako:sophacles/vim-bundle-mako mako:sophacles/vim-bundle-mako
markdown:plasticboy/vim-markdown:_SYNTAX markdown:plasticboy/vim-markdown:_SYNTAX
mathematica:rsmenon/vim-mathematica mathematica:rsmenon/vim-mathematica
moonscript:leafo/moonscript-vim
nginx:chr4/nginx.vim nginx:chr4/nginx.vim
nim:zah/nim.vim:_BASIC nim:zah/nim.vim:_BASIC
nix:LnL7/vim-nix nix:LnL7/vim-nix
@@ -219,10 +220,12 @@ PACKS="
ocaml:jrk/vim-ocaml ocaml:jrk/vim-ocaml
octave:vim-scripts/octave.vim-- octave:vim-scripts/octave.vim--
opencl:petRUShka/vim-opencl opencl:petRUShka/vim-opencl
org:jceb/vim-orgmode
perl:vim-perl/vim-perl perl:vim-perl/vim-perl
pgsql:exu/pgsql.vim pgsql:exu/pgsql.vim
php:StanAngeloff/php.vim php:StanAngeloff/php.vim
plantuml:aklt/plantuml-syntax plantuml:aklt/plantuml-syntax
pony:jakwings/vim-pony
powershell:PProvost/vim-ps1 powershell:PProvost/vim-ps1
protobuf:uarun/vim-protobuf protobuf:uarun/vim-protobuf
pug:digitaltoad/vim-pug pug:digitaltoad/vim-pug
@@ -239,6 +242,7 @@ PACKS="
rspec:sheerun/rspec.vim rspec:sheerun/rspec.vim
ruby:vim-ruby/vim-ruby ruby:vim-ruby/vim-ruby
rust:rust-lang/rust.vim rust:rust-lang/rust.vim
rst:marshallward/vim-restructuredtext
sbt:derekwyatt/vim-sbt sbt:derekwyatt/vim-sbt
scala:derekwyatt/vim-scala scala:derekwyatt/vim-scala
scss:cakebaker/scss-syntax.vim scss:cakebaker/scss-syntax.vim

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

@@ -59,7 +59,7 @@ augroup filetypedetect
autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail
" plantuml " plantuml
autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml setfiletype plantuml | set filetype=plantuml autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml,*.puml setfiletype plantuml | set filetype=plantuml
" scala " scala
au BufRead,BufNewFile *.scala,*.sc set filetype=scala au BufRead,BufNewFile *.scala,*.sc set filetype=scala

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

@@ -59,7 +59,7 @@ augroup filetypedetect
autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail
" plantuml " plantuml
autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml setfiletype plantuml | set filetype=plantuml autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml,*.puml setfiletype plantuml | set filetype=plantuml
" scala " scala
au BufRead,BufNewFile *.scala,*.sc set filetype=scala au BufRead,BufNewFile *.scala,*.sc set filetype=scala
@@ -240,6 +240,25 @@ autocmd BufRead,BufNewFile *.dart set filetype=dart
augroup end augroup end
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
augroup filetypedetect
" dockerfile, from Dockerfile.vim in ekalinin/Dockerfile.vim
" Dockerfile
autocmd BufRead,BufNewFile Dockerfile set ft=Dockerfile
autocmd BufRead,BufNewFile Dockerfile* set ft=Dockerfile
autocmd BufRead,BufNewFile *.dock set ft=Dockerfile
autocmd BufRead,BufNewFile *.[Dd]ockerfile set ft=Dockerfile
augroup end
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
augroup filetypedetect
" dockerfile, from docker-compose.vim in ekalinin/Dockerfile.vim
" docker-compose.yml
autocmd BufRead,BufNewFile docker-compose*.{yaml,yml}* set ft=yaml.docker-compose
augroup end
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
augroup filetypedetect augroup filetypedetect
" elm, from elm.vim in ElmCast/elm-vim " elm, from elm.vim in ElmCast/elm-vim
@@ -340,6 +359,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 +384,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 +418,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 +429,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
@@ -444,11 +477,11 @@ endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1
augroup filetypedetect augroup filetypedetect
" i3, from i3.vim in PotatoesMaster/i3-vim-syntax " i3, from i3config.vim in mboughaba/i3config.vim
augroup i3_ftdetect aug i3config#ft_detect
au! au!
au BufRead,BufNewFile *i3/config,*sway/config set ft=i3 au BufNewFile,BufRead .i3.config,i3.config,*.i3config,*.i3.config set filetype=i3config
augroup END aug end
augroup end augroup end
endif endif
@@ -484,6 +517,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
@@ -635,6 +669,27 @@ au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,i
augroup end augroup end
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'moonscript') == -1
augroup filetypedetect
" moonscript, from moon.vim in leafo/moonscript-vim
" Language: MoonScript
" Maintainer: leafo <leafot@gmail.com>
" Based On: CoffeeScript by Mick Koch <kchmck@gmail.com>
" URL: http://github.com/leafo/moonscript-vim
" License: WTFPL
autocmd BufNewFile,BufRead *.moon set filetype=moon
function! s:DetectMoon()
if getline(1) =~ '^#!.*\<moon\>'
set filetype=moon
endif
endfunction
autocmd BufNewFile,BufRead * call s:DetectMoon()
augroup end
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
augroup filetypedetect augroup filetypedetect
" nginx, from nginx.vim in chr4/nginx.vim " nginx, from nginx.vim in chr4/nginx.vim
@@ -673,6 +728,14 @@ au! BufRead,BufNewFile *.cl set filetype=opencl
augroup end augroup end
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'org') == -1
augroup filetypedetect
" org, from org.vim in jceb/vim-orgmode
autocmd BufNewFile,BufRead *.org setfiletype org
"autocmd BufNewFile,BufReadPost org:todo* setfiletype orgtodo
augroup end
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
augroup filetypedetect augroup filetypedetect
" perl, from mason-in-html.vim in vim-perl/vim-perl " perl, from mason-in-html.vim in vim-perl/vim-perl
@@ -732,6 +795,13 @@ au BufNewFile,BufRead *.pgsql setf pgsql
augroup end augroup end
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pony') == -1
augroup filetypedetect
" pony, from pony.vim in jakwings/vim-pony
autocmd BufRead,BufNewFile *.pony setf pony
augroup end
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
augroup filetypedetect augroup filetypedetect
" powershell, from ps1.vim in PProvost/vim-ps1 " powershell, from ps1.vim in PProvost/vim-ps1
@@ -912,6 +982,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 +1127,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

31
ftplugin/Dockerfile.vim Normal file
View File

@@ -0,0 +1,31 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
function! DockerfileReplaceInstruction(original, replacement)
let syn = synIDtrans(synID(line("."), col(".") - 1, 0))
if syn != hlID("Comment") && syn != hlID("Constant") && strlen(getline(".")) == 0
let word = a:replacement
else
let word = a:original
endif
let g:UnduBuffer = a:original
return word
endfunction
inoreabbr <silent> <buffer> from <C-R>=DockerfileReplaceInstruction("from", "FROM")<CR>
inoreabbr <silent> <buffer> maintainer <C-R>=DockerfileReplaceInstruction("maintainer", "MAINTAINER")<CR>
inoreabbr <silent> <buffer> run <C-R>=DockerfileReplaceInstruction("run", "RUN")<CR>
inoreabbr <silent> <buffer> cmd <C-R>=DockerfileReplaceInstruction("cmd", "CMD")<CR>
inoreabbr <silent> <buffer> label <C-R>=DockerfileReplaceInstruction("label", "LABEL")<CR>
inoreabbr <silent> <buffer> expose <C-R>=DockerfileReplaceInstruction("expose", "EXPOSE")<CR>
inoreabbr <silent> <buffer> env <C-R>=DockerfileReplaceInstruction("env", "ENV")<CR>
inoreabbr <silent> <buffer> add <C-R>=DockerfileReplaceInstruction("add", "ADD")<CR>
inoreabbr <silent> <buffer> copy <C-R>=DockerfileReplaceInstruction("copy", "COPY")<CR>
inoreabbr <silent> <buffer> entrypoint <C-R>=DockerfileReplaceInstruction("entrypoint", "ENTRYPOINT")<CR>
inoreabbr <silent> <buffer> volume <C-R>=DockerfileReplaceInstruction("volume", "VOLUME")<CR>
inoreabbr <silent> <buffer> user <C-R>=DockerfileReplaceInstruction("user", "USER")<CR>
inoreabbr <silent> <buffer> workdir <C-R>=DockerfileReplaceInstruction("workdir", "WORKDIR")<CR>
inoreabbr <silent> <buffer> arg <C-R>=DockerfileReplaceInstruction("arg", "ARG")<CR>
inoreabbr <silent> <buffer> onbuild <C-R>=DockerfileReplaceInstruction("onbuild", "ONBUILD")<CR>
inoreabbr <silent> <buffer> stopsignal <C-R>=DockerfileReplaceInstruction("stopsignal", "STOPSIGNAL")<CR>
endif

View File

@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
" Vim filetype plugin " Vim filetype plugin
" Language: Haml " Language: Haml
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 May 21 " Last Change: 2016 Aug 29
" Only do this when not done yet for this buffer " Only do this when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@@ -39,6 +39,8 @@ endif
runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
let b:did_ftplugin = 1 let b:did_ftplugin = 1
let &l:define .= empty(&l:define ? '' : '\|') . '^\s*\%(%\w*\)\=\%(\.[[:alnum:]_-]\+\)*#'
" Combine the new set of values with those previously included. " Combine the new set of values with those previously included.
if exists("b:undo_ftplugin") if exists("b:undo_ftplugin")
let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
@@ -62,10 +64,11 @@ endif
setlocal comments= commentstring=-#\ %s setlocal comments= commentstring=-#\ %s
let b:undo_ftplugin = "setl cms< com< " let b:undo_ftplugin = "setl def< cms< com< "
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo
" vim:set sw=2: " vim:set sw=2:

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)

20
ftplugin/moon.vim Normal file
View File

@@ -0,0 +1,20 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'moonscript') == -1
" Language: MoonScript
" Maintainer: leafo <leafot@gmail.com>
" Based On: CoffeeScript by Mick Koch <kchmck@gmail.com>
" URL: http://github.com/leafo/moonscript-vim
" License: WTFPL
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal formatoptions-=t
setlocal comments=:--
setlocal commentstring=--\ %s
let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions<"
endif

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

173
ftplugin/org.vim Normal file
View File

@@ -0,0 +1,173 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'org') == -1
" org.vim -- Text outlining and task management for Vim based on Emacs' Org-Mode
" @Author : Jan Christoph Ebersbach (jceb@e-jc.de)
" @License : AGPL3 (see http://www.gnu.org/licenses/agpl.txt)
" @Created : 2010-10-03
" @Last Modified: Tue 13. Sep 2011 20:52:57 +0200 CEST
" @Revision : 0.4
" vi: ft=vim:tw=80:sw=4:ts=4:fdm=marker
if v:version > 702
if has('python3')
let s:py_version = 'python3 '
let s:py_env = 'python3 << EOF'
elseif has('python')
let s:py_version = 'python '
let s:py_env = 'python << EOF'
else
echoerr "Unable to start orgmode. Orgmode depends on Vim >= 7.3 with Python support complied in."
finish
endif
else
echoerr "Unable to start orgmode. Orgmode depends on Vim >= 7.3 with Python support complied in."
finish
endif
" Init buffer for file {{{1
if ! exists('b:did_ftplugin')
" default emacs settings
setlocal comments=fb:*,b:#,fb:-
setlocal commentstring=#\ %s
setlocal conceallevel=2 concealcursor=nc
" original emacs settings are: setlocal tabstop=6 shiftwidth=6, but because
" of checkbox indentation the following settings are used:
setlocal tabstop=6 shiftwidth=6
if exists('g:org_tag_column')
exe 'setlocal textwidth='.g:org_tag_column
else
setlocal textwidth=77
endif
" expand tab for counting level of checkbox
setlocal expandtab
" enable % for angle brackets < >
setlocal matchpairs+=<:>
" register keybindings if they don't have been registered before
if exists("g:loaded_org")
exe s:py_version . 'ORGMODE.register_keybindings()'
endif
endif
" Load orgmode just once {{{1
if &cp || exists("g:loaded_org")
finish
endif
let g:loaded_org = 1
" Default org plugins that will be loaded (in the given order) {{{2
if ! exists('g:org_plugins') && ! exists('b:org_plugins')
let g:org_plugins = ['ShowHide', '|', 'Navigator', 'EditStructure', 'EditCheckbox', '|', 'Hyperlinks', '|', 'Todo', 'TagsProperties', 'Date', 'Agenda', 'Misc', '|', 'Export']
endif
" Default org plugin settings {{{2
" What does this do?
if ! exists('g:org_syntax_highlight_leading_stars') && ! exists('b:org_syntax_highlight_leading_stars')
let g:org_syntax_highlight_leading_stars = 1
endif
" setting to conceal aggresively
if ! exists('g:org_aggressive_conceal') && ! exists('b:org_aggressive_conceal')
let g:org_aggressive_conceal = 0
endif
" Defined in separate plugins
" Adding Behavior preference:
" 1: go into insert-mode when new heading/checkbox/plainlist added
" 0: retain original mode when new heading/checkbox/plainlist added
if ! exists('g:org_prefer_insert_mode') && ! exists('b:org_prefer_insert_mode')
let g:org_prefer_insert_mode = 1
endif
" Menu and document handling {{{1
function! <SID>OrgRegisterMenu()
exe s:py_version . 'ORGMODE.register_menu()'
endfunction
function! <SID>OrgUnregisterMenu()
exe s:py_version . 'ORGMODE.unregister_menu()'
endfunction
function! <SID>OrgDeleteUnusedDocument(bufnr)
exe s:py_env
b = int(vim.eval('a:bufnr'))
if b in ORGMODE._documents:
del ORGMODE._documents[b]
EOF
endfunction
" show and hide Org menu depending on the filetype
augroup orgmode
au BufEnter * :if &filetype == "org" | call <SID>OrgRegisterMenu() | endif
au BufLeave * :if &filetype == "org" | call <SID>OrgUnregisterMenu() | endif
au BufDelete * :call <SID>OrgDeleteUnusedDocument(expand('<abuf>'))
augroup END
" Start orgmode {{{1
" Expand our path
exec s:py_env
import vim, os, sys
for p in vim.eval("&runtimepath").split(','):
dname = os.path.join(p, "ftplugin")
if os.path.exists(os.path.join(dname, "orgmode")):
if dname not in sys.path:
sys.path.append(dname)
break
from orgmode._vim import ORGMODE, insert_at_cursor, get_user_input, date_to_str
ORGMODE.start()
from Date import Date
import datetime
EOF
" 3rd Party Plugin Integration {{{1
" * Repeat {{{2
try
call repeat#set()
catch
endtry
" * Tagbar {{{2
let g:tagbar_type_org = {
\ 'ctagstype' : 'org',
\ 'kinds' : [
\ 's:sections',
\ 'h:hyperlinks',
\ ],
\ 'sort' : 0,
\ 'deffile' : expand('<sfile>:p:h') . '/org.cnf'
\ }
" * Taglist {{{2
if exists('g:Tlist_Ctags_Cmd')
" Pass parameters to taglist
let g:tlist_org_settings = 'org;s:section;h:hyperlinks'
let g:Tlist_Ctags_Cmd .= ' --options=' . expand('<sfile>:p:h') . '/org.cnf '
endif
" * Calendar.vim {{{2
fun CalendarAction(day, month, year, week, dir)
let g:org_timestamp = printf("%04d-%02d-%02d Fri", a:year, a:month, a:day)
let datetime_date = printf("datetime.date(%d, %d, %d)", a:year, a:month, a:day)
exe s:py_version . "selected_date = " . datetime_date
" get_user_input
let msg = printf("Inserting %s | Modify date", g:org_timestamp)
exe s:py_version . "modifier = get_user_input('" . msg . "')"
" change date according to user input
exe s:py_version . "newdate = Date._modify_time(selected_date, modifier)"
exe s:py_version . "newdate = date_to_str(newdate)"
" close Calendar
exe "q"
" goto previous window
exe "wincmd p"
exe s:py_version . "timestamp = '" . g:org_timestamp_template . "' % newdate"
exe s:py_version . "insert_at_cursor(timestamp)"
" restore calendar_action
let g:calendar_action = g:org_calendar_action_backup
endf
endif

44
ftplugin/pony.vim Normal file
View File

@@ -0,0 +1,44 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pony') == -1
" Vim filetype plugin file
" Language: Pony
" Maintainer: Jak Wings
if exists('b:did_ftplugin')
finish
endif
let s:cpo_save = &cpo
set cpo&vim
setlocal comments=://,nsr:/*,mb:*,ex:*/
setlocal commentstring=/*%s*/
setlocal formatoptions-=t fo+=c fo+=r fo+=o fo+=q fo+=l fo+=j
"setlocal path=
"setlocal includeexpr=
setlocal include=\\v^\\s*use\\_s+%(\\i+\\_s*\\=\\_s*)?"\\zs[^"]*\\ze"
setlocal define=\\v^\\s*%(actor\|class\|struct\|primitive\|trait\|interface\|type\|new\|be\|fun\|let\|var\|embed\|use\|for\\_s+%(\\i+\\_s*,\\_s*)*\|with\\_s+%(\\i+\\_s*,\\_s*)*)\|(<\\i+\\_s*:\\_s*\\i+)@=
setlocal isident=@,48-57,_,39
setlocal iskeyword=@,48-57,_,39
setlocal suffixesadd=.pony
setlocal matchpairs=(:),{:},[:]
let b:match_ignorecase = 0
let b:match_skip = 's:Comment\|String\|Character\|CaseGuard'
let b:match_words = '\v<%(ifdef|if|match|while|for|repeat|try|with|recover|object|lambda|iftype)>\m:\v<%(then|elseif|else|until|do|in|elseiftype)>|\|\m:\<end\>,(:),\[:\],{:}'
" TODO: for more concise behavior
"let b:match_words = 'pony#GetMatchWords()'
source $VIMRUNTIME/macros/matchit.vim
let b:undo_ftplugin = 'set comments< commentstring< formatoptions< path< include< includeexpr< define< isident< iskeyword< suffixesadd< matchpairs<'
\ . ' | unlet! b:match_ignorecase b:match_skip b:match_words'
let &cpo = s:cpo_save
unlet s:cpo_save
let b:did_ftplugin = 1
endif

46
ftplugin/rst.vim Normal file
View File

@@ -0,0 +1,46 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rst') == -1
" reStructuredText filetype plugin file
" Language: reStructuredText documentation format
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Original Maintainer: Nikolai Weibull <now@bitwi.se>
" Website: https://github.com/marshallward/vim-restructuredtext
" Latest Revision: 2018-01-07
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< et< fo<"
setlocal comments=fb:.. commentstring=..\ %s expandtab
setlocal formatoptions+=tcroql
" reStructuredText standard recommends that tabs be expanded to 8 spaces
" The choice of 3-space indentation is to provide slightly better support for
" directives (..) and ordered lists (1.), although it can cause problems for
" many other cases.
"
" More sophisticated indentation rules should be revisted in the future.
if !exists("g:rst_style") || g:rst_style != 0
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
endif
if has('patch-7.3.867') " Introduced the TextChanged event.
setlocal foldmethod=expr
setlocal foldexpr=RstFold#GetRstFold()
setlocal foldtext=RstFold#GetRstFoldText()
augroup RstFold
autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
augroup END
endif
let &cpo = s:cpo_save
unlet s:cpo_save
endif

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

27
indent/Dockerfile.vim Normal file
View File

@@ -0,0 +1,27 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
if exists('b:did_indent') | finish | endif
let b:did_indent = 1
function! DockerfileIndent(line)
let prev_line = getline(a:line - 1)
if a:line > 1 && prev_line =~ '\\\s*$'
let i = indent(a:line - 1)
if i == 0
let i += &l:shiftwidth
if &l:expandtab && prev_line =~# '^RUN\s'
" Overindent past RUN
let i = 4 + &l:shiftwidth
endif
endif
return i
endif
return -1
endfunction
set indentexpr=DockerfileIndent(v:lnum)
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

@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
" Vim indent file " Vim indent file
" Language: Haml " Language: Haml
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 May 21 " Last Change: 2016 Aug 29
if exists("b:did_indent") if exists("b:did_indent")
finish finish
@@ -12,7 +12,7 @@ runtime! indent/ruby.vim
unlet! b:did_indent unlet! b:did_indent
let b:did_indent = 1 let b:did_indent = 1
setlocal autoindent sw=2 et setlocal autoindent
setlocal indentexpr=GetHamlIndent() setlocal indentexpr=GetHamlIndent()
setlocal indentkeys=o,O,*<Return>,},],0),!^F,=end,=else,=elsif,=rescue,=ensure,=when setlocal indentkeys=o,O,*<Return>,},],0),!^F,=end,=else,=elsif,=rescue,=ensure,=when

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

327
indent/moon.vim Normal file
View File

@@ -0,0 +1,327 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'moonscript') == -1
" Language: MoonScript
" Maintainer: leafo <leafot@gmail.com>
" Based On: CoffeeScript by Mick Koch <kchmck@gmail.com>
" URL: http://github.com/leafo/moonscript-vim
" License: WTFPL
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal autoindent
setlocal indentexpr=GetMoonIndent(v:lnum)
" Make sure GetMoonIndent is run when these are typed so they can be
" indented or outdented.
setlocal indentkeys+=0],0),0.,=else,=elseif
" Only define the function once.
if exists("*GetMoonIndent")
finish
endif
" Keywords to indent after
let s:INDENT_AFTER_KEYWORD = '^\%(if\|unless\|else\|for\|while\|with\|elseif\|'
\ . 'class\|switch\|when\)\>'
" Operators to indent after
let s:INDENT_AFTER_OPERATOR = '\%([([{:=]\|[-=]>\)$'
" Keywords and operators that continue a line
let s:CONTINUATION = '\<\%(is\|isnt\|and\|or\)\>$'
\ . '\|'
\ . '\%(-\@<!-\|+\@<!+\|<\|[-=]\@<!>\|\%(export \)\@<!\*\|/\@<!/\|%\||\|'
\ . '&\|,\|\.\@<!\.\)$'
" Operators that block continuation indenting
let s:CONTINUATION_BLOCK = '[([{:=]$'
" A continuation dot access
let s:DOT_ACCESS = '^\.'
" Keywords to outdent after
let s:OUTDENT_AFTER = '^\%(return\|break\)\>'
" A compound assignment like `... = if ...`
let s:COMPOUND_ASSIGNMENT = '[:=]\s*\%(if\|unless\|for\|while\|'
\ . 'with\|class\)\>'
" A postfix condition like `return ... if ...`.
let s:POSTFIX_CONDITION = '\S\s\+\zs\<\%(if\|unless\)\>'
" A single-line else statement like `else ...` but not `else if ...
let s:SINGLE_LINE_ELSE = '^else\s\+\%(\<\%(if\)\>\)\@!'
" Max lines to look back for a match
let s:MAX_LOOKBACK = 50
" Syntax names for strings
let s:SYNTAX_STRING = 'moon\%(String\|AssignString\|Embed\|Regex\|Heregex\|'
\ . 'Heredoc\)'
" Syntax names for comments
let s:SYNTAX_COMMENT = 'moon\%(Comment\|BlockComment\|HeregexComment\)'
" Syntax names for strings and comments
let s:SYNTAX_STRING_COMMENT = s:SYNTAX_STRING . '\|' . s:SYNTAX_COMMENT
" Get the linked syntax name of a character.
function! s:SyntaxName(linenum, col)
return synIDattr(synID(a:linenum, a:col, 1), 'name')
endfunction
" Check if a character is in a comment.
function! s:IsComment(linenum, col)
return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_COMMENT
endfunction
" Check if a character is in a string.
function! s:IsString(linenum, col)
return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING
endfunction
" Check if a character is in a comment or string.
function! s:IsCommentOrString(linenum, col)
return s:SyntaxName(a:linenum, a:col) =~ s:SYNTAX_STRING_COMMENT
endfunction
" Check if a whole line is a comment.
function! s:IsCommentLine(linenum)
" Check the first non-whitespace character.
return s:IsComment(a:linenum, indent(a:linenum) + 1)
endfunction
" Repeatedly search a line for a regex until one is found outside a string or
" comment.
function! s:SmartSearch(linenum, regex)
" Start at the first column.
let col = 0
" Search until there are no more matches, unless a good match is found.
while 1
call cursor(a:linenum, col + 1)
let [_, col] = searchpos(a:regex, 'cn', a:linenum)
" No more matches.
if !col
break
endif
if !s:IsCommentOrString(a:linenum, col)
return 1
endif
endwhile
" No good match found.
return 0
endfunction
" Skip a match if it's in a comment or string, is a single-line statement that
" isn't adjacent, or is a postfix condition.
function! s:ShouldSkip(startlinenum, linenum, col)
if s:IsCommentOrString(a:linenum, a:col)
return 1
endif
" Check for a single-line statement that isn't adjacent.
if s:SmartSearch(a:linenum, '\<then\>') && a:startlinenum - a:linenum > 1
return 1
endif
if s:SmartSearch(a:linenum, s:POSTFIX_CONDITION) &&
\ !s:SmartSearch(a:linenum, s:COMPOUND_ASSIGNMENT)
return 1
endif
return 0
endfunction
" Find the farthest line to look back to, capped to line 1 (zero and negative
" numbers cause bad things).
function! s:MaxLookback(startlinenum)
return max([1, a:startlinenum - s:MAX_LOOKBACK])
endfunction
" Get the skip expression for searchpair().
function! s:SkipExpr(startlinenum)
return "s:ShouldSkip(" . a:startlinenum . ", line('.'), col('.'))"
endfunction
" Search for pairs of text.
function! s:SearchPair(start, end)
" The cursor must be in the first column for regexes to match.
call cursor(0, 1)
let startlinenum = line('.')
" Don't need the W flag since MaxLookback caps the search to line 1.
return searchpair(a:start, '', a:end, 'bcn',
\ s:SkipExpr(startlinenum),
\ s:MaxLookback(startlinenum))
endfunction
" Try to find a previous matching line.
function! s:GetMatch(curline)
let firstchar = a:curline[0]
if firstchar == '}'
return s:SearchPair('{', '}')
elseif firstchar == ')'
return s:SearchPair('(', ')')
elseif firstchar == ']'
return s:SearchPair('\[', '\]')
elseif a:curline =~ '^else\>'
return s:SearchPair('\<\%(if\|unless\|when\)\>', '\<else\>')
" elseif a:curline =~ '^catch\>'
" return s:SearchPair('\<try\>', '\<catch\>')
" elseif a:curline =~ '^finally\>'
" return s:SearchPair('\<try\>', '\<finally\>')
endif
return 0
endfunction
" Get the nearest previous line that isn't a comment.
function! s:GetPrevNormalLine(startlinenum)
let curlinenum = a:startlinenum
while curlinenum > 0
let curlinenum = prevnonblank(curlinenum - 1)
if !s:IsCommentLine(curlinenum)
return curlinenum
endif
endwhile
return 0
endfunction
" Try to find a comment in a line.
function! s:FindComment(linenum)
let col = 0
while 1
call cursor(a:linenum, col + 1)
let [_, col] = searchpos('#', 'cn', a:linenum)
if !col
break
endif
if s:IsComment(a:linenum, col)
return col
endif
endwhile
return 0
endfunction
" Get a line without comments or surrounding whitespace.
function! s:GetTrimmedLine(linenum)
let comment = 0
" let comment = s:FindComment(a:linenum)
let line = getline(a:linenum)
if comment
" Subtract 1 to get to the column before the comment and another 1 for
" zero-based indexing.
let line = line[:comment - 2]
endif
return substitute(substitute(line, '^\s\+', '', ''),
\ '\s\+$', '', '')
endfunction
function! s:GetMoonIndent(curlinenum)
let prevlinenum = s:GetPrevNormalLine(a:curlinenum)
" Don't do anything if there's no previous line.
if !prevlinenum
return -1
endif
let curline = s:GetTrimmedLine(a:curlinenum)
" Try to find a previous matching statement. This handles outdenting.
let matchlinenum = s:GetMatch(curline)
if matchlinenum
return indent(matchlinenum)
endif
" " Try to find a matching `when`.
" if curline =~ '^when\>' && !s:SmartSearch(prevlinenum, '\<switch\>')
" let linenum = a:curlinenum
"
" while linenum > 0
" let linenum = s:GetPrevNormalLine(linenum)
"
" if getline(linenum) =~ '^\s*when\>'
" return indent(linenum)
" endif
" endwhile
"
" return -1
" endif
let prevline = s:GetTrimmedLine(prevlinenum)
let previndent = indent(prevlinenum)
" Always indent after these operators.
if prevline =~ s:INDENT_AFTER_OPERATOR
return previndent + &shiftwidth
endif
" Indent after a continuation if it's the first.
if prevline =~ s:CONTINUATION
let prevprevlinenum = s:GetPrevNormalLine(prevlinenum)
let prevprevline = s:GetTrimmedLine(prevprevlinenum)
if prevprevline !~ s:CONTINUATION && prevprevline !~ s:CONTINUATION_BLOCK
return previndent + &shiftwidth
endif
return -1
endif
" Indent after these keywords and compound assignments if they aren't a
" single-line statement.
if prevline =~ s:INDENT_AFTER_KEYWORD || prevline =~ s:COMPOUND_ASSIGNMENT
if !s:SmartSearch(prevlinenum, '\<then\>') && prevline !~ s:SINGLE_LINE_ELSE
return previndent + &shiftwidth
endif
return -1
endif
" Indent a dot access if it's the first.
if curline =~ s:DOT_ACCESS && prevline !~ s:DOT_ACCESS
return previndent + &shiftwidth
endif
" Outdent after these keywords if they don't have a postfix condition or are
" a single-line statement.
if prevline =~ s:OUTDENT_AFTER
if !s:SmartSearch(prevlinenum, s:POSTFIX_CONDITION) ||
\ s:SmartSearch(prevlinenum, '\<then\>')
return previndent - &shiftwidth
endif
endif
" No indenting or outdenting is needed.
return -1
endfunction
" Wrap s:GetMoonIndent to keep the cursor position.
function! GetMoonIndent(curlinenum)
let oldcursor = getpos('.')
let indent = s:GetMoonIndent(a:curlinenum)
call setpos('.', oldcursor)
return indent
endfunction
endif

137
indent/org.vim Normal file
View File

@@ -0,0 +1,137 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'org') == -1
" Delete the next line to avoid the special indention of items
if !exists("g:org_indent")
let g:org_indent = 0
endif
setlocal foldtext=GetOrgFoldtext()
setlocal fillchars-=fold:-
setlocal fillchars+=fold:\
setlocal foldexpr=GetOrgFolding()
setlocal foldmethod=expr
setlocal indentexpr=GetOrgIndent()
setlocal nolisp
setlocal nosmartindent
setlocal autoindent
if has('python3')
let s:py_env = 'python3 << EOF'
else
let s:py_env = 'python << EOF'
endif
function! GetOrgIndent()
if g:org_indent == 0
return -1
endif
exe s:py_env
from orgmode._vim import indent_orgmode
indent_orgmode()
EOF
if exists('b:indent_level')
let l:tmp = b:indent_level
unlet b:indent_level
return l:tmp
else
return -1
endif
endfunction
function! GetOrgFolding()
let l:mode = mode()
if l:mode == 'i'
" the cache size is limited to 3, because vim queries the current and
" both surrounding lines when the user is typing in insert mode. The
" cache is shared between GetOrgFolding and GetOrgFoldtext
if ! exists('b:org_folding_cache')
let b:org_folding_cache = {}
endif
if has_key(b:org_folding_cache, v:lnum)
if match(b:org_folding_cache[v:lnum], '^>') == 0 &&
\ match(getline(v:lnum), '^\*\+\s') != 0
" when the user pastes text or presses enter, it happens that
" the cache starts to confuse vim's folding abilities
" these entries can safely be removed
unlet b:org_folding_cache[v:lnum]
" the fold text cache is probably also damaged, delete it as
" well
unlet! b:org_foldtext_cache
else
return b:org_folding_cache[v:lnum]
endif
endif
exe s:py_env
from orgmode._vim import fold_orgmode
fold_orgmode(allow_dirty=True)
EOF
else
exe s:py_env
from orgmode._vim import fold_orgmode
fold_orgmode()
EOF
endif
if exists('b:fold_expr')
let l:tmp = b:fold_expr
unlet b:fold_expr
if l:mode == 'i'
if ! has_key(b:org_folding_cache, v:lnum)
if len(b:org_folding_cache) > 3
let b:org_folding_cache = {}
endif
let b:org_folding_cache[v:lnum] = l:tmp
endif
endif
return l:tmp
else
return -1
endif
endfunction
function! SetOrgFoldtext(text)
let b:foldtext = a:text
endfunction
function! GetOrgFoldtext()
let l:mode = mode()
if l:mode == 'i'
" add a separate cache for fold text
if ! exists('b:org_foldtext_cache') ||
\ ! has_key(b:org_foldtext_cache, 'timestamp') ||
\ b:org_foldtext_cache['timestamp'] > (localtime() + 10)
let b:org_foldtext_cache = {'timestamp': localtime()}
endif
if has_key(b:org_foldtext_cache, v:foldstart)
return b:org_foldtext_cache[v:foldstart]
endif
exe s:py_env
from orgmode._vim import fold_text
fold_text(allow_dirty=True)
EOF
else
unlet! b:org_foldtext_cache
exec s:py_env
from orgmode._vim import fold_text
fold_text()
EOF
endif
if exists('b:foldtext')
let l:tmp = b:foldtext
unlet b:foldtext
if l:mode == 'i'
let b:org_foldtext_cache[v:foldstart] = l:tmp
endif
return l:tmp
endif
endfunction
endif

41
indent/pony.vim Normal file
View File

@@ -0,0 +1,41 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pony') == -1
" Vim indent file
" Language: Pony
" Maintainer: Jak Wings
if exists('b:did_indent')
finish
endif
let s:cpo_save = &cpo
set cpo&vim
setlocal nolisp
setlocal nocindent
setlocal nosmartindent
setlocal autoindent
setlocal indentexpr=pony#Indent()
setlocal indentkeys=!^F,o,O,0\|,0(,0),0[,0],0{,0},0==>,0=\"\"\",0=end,0=then,0=else,0=in,0=do,0=until,0=actor,0=class,0=struct,0=primitive,0=trait,0=interface,0=new,0=be,0=fun,0=type,0=use
setlocal cinkeys=!^F,o,O,0\|,0(,0),0[,0],0{,0},0==>,0=\"\"\",0=end,0=then,0=else,0=in,0=do,0=until,0=actor,0=class,0=struct,0=primitive,0=trait,0=interface,0=new,0=be,0=fun,0=type,0=use
setlocal cinwords=ifdef,if,match,while,for,repeat,try,with,recover,object,lambda,then,elseif,else,until,do,actor,class,struct,primitive,trait,interface,new,be,fun,iftype,elseiftype
augroup pony
autocmd! * <buffer>
autocmd CursorHold <buffer> call pony#ClearTrailingSpace(1, 1)
"autocmd InsertEnter <buffer> call pony#ClearTrailingSpace(0, 0)
autocmd InsertLeave <buffer> call pony#ClearTrailingSpace(0, 1)
autocmd BufWritePre <buffer> call pony#ClearTrailingSpace(1, 0, 1)
augroup END
let b:undo_indent = 'set lisp< cindent< autoindent< smartindent< indentexpr< indentkeys< cinkeys< cinwords<'
\ . ' | execute("autocmd! pony * <buffer>")'
let &cpo = s:cpo_save
unlet s:cpo_save
let b:did_indent = 1
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

@@ -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

89
syntax/docker-compose.vim Normal file
View File

@@ -0,0 +1,89 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
" Vim syntax file
" Language: Dockerfile
" Maintainer: Eugene Kalinin
" Latest Revision: 11 September 2013
" Source: http://docs.docker.io/en/latest/use/builder/
if exists("b:current_syntax")
finish
endif
" case sensitivity (fix #17)
" syn case ignore
" Keywords
syn keyword dockercomposeKeywords build context dockerfile args cap_add cap_drop
syn keyword dockercomposeKeywords command cgroup_parent container_name devices depends_on
syn keyword dockercomposeKeywords dns dns_search tmpfs entrypoint env_file environment
syn keyword dockercomposeKeywords expose extends extends external_links extra_hosts
syn keyword dockercomposeKeywords group_add image isolation labels links
syn keyword dockercomposeKeywords log_opt net network_mode networks aliases
syn keyword dockercomposeKeywords ipv4_address ipv6_address link_local_ips pid ports
syn keyword dockercomposeKeywords security_opt stop_signal ulimits volumes volume_driver
syn keyword dockercomposeKeywords volumes_from cpu_shares cpu_quota cpuset domainname hostname
syn keyword dockercomposeKeywords ipc mac_address mem_limit memswap_limit oom_score_adj privileged
syn keyword dockercomposeKeywords read_only restart shm_size stdin_open tty user working_dir
syn keyword dockercomposeKeywords healthcheck test interval timeout retries disable sysctls
syn keyword dockercomposeKeywords userns_mode secrets
"" Volume configuration reference
syn keyword dockercomposeKeywords driver driver_opts external labels
"" Network configuration reference
syn keyword dockercomposeKeywords driver driver_opts enable_ipv6 ipam internal labels external
"" Versioning
syn keyword dockercomposeKeywords version services
"" Logging
syn keyword dockercomposeKeywords logging log_driver env options max-size max-file
syn keyword dockercomposeKeywords syslog-address syslog-facility syslog-tls-ca-cert syslog-tls-cert
syn keyword dockercomposeKeywords syslog-tls-key syslog-tls-skip tag syslog-format gelf-address
syn keyword dockercomposeKeywords gelf-compression-type gelf-compression-level fluentd-address
syn keyword dockercomposeKeywords fluentd-buffer-limit fluentd-retry-wait fluentd-max-retries
syn keyword dockercomposeKeywords fluentd-async-connect awslogs-region awslogs-group awslogs-stream
syn keyword dockercomposeKeywords splunk-token splunk-url splunk-source splunk-sourcetype splunk-index
syn keyword dockercomposeKeywords splunk-capath splunk-caname splunk-insecureskipverify gcp-project log-cmd
" Bash statements
setlocal iskeyword+=-
syn keyword bashStatement add-apt-repository adduser apk apt-get aptitude apt-key autoconf bundle
syn keyword bashStatement cd chgrp chmod chown clear complete composer cp curl du echo egrep
syn keyword bashStatement expr fgrep find gem gnufind gnugrep gpg grep groupadd head less ln
syn keyword bashStatement ls make mkdir mv node npm pacman pip pip3 php python rails rm rmdir rpm ruby
syn keyword bashStatement sed sleep sort strip tar tail tailf touch useradd virtualenv yum
syn keyword bashStatement usermod bash cat a2ensite a2dissite a2enmod a2dismod apache2ctl
syn keyword bashStatement wget gzip
" Strings
syn region dockercomposeString start=/"/ skip=/\\"/ end=/"/
syn region dockercomposeString1 start=/'/ skip=/\\'/ end=/'/
" Emails
syn region dockercomposeEmail start=/</ end=/>/ contains=@ oneline
" Urls
syn match dockercomposeUrl /\(http\|https\|ssh\|hg\|git\)\:\/\/[a-zA-Z0-9\/\-\.]\+/
" Task tags
syn keyword dockercomposeTodo contained TODO FIXME XXX
" Comments
syn region dockercomposeComment start="#" end="\n" contains=dockercomposeTodo
" Highlighting
hi link dockercomposeKeywords Keyword
hi link dockercomposeString String
hi link dockercomposeString1 String
hi link dockercomposeComment Comment
hi link dockercomposeEmail Identifier
hi link dockercomposeUrl Identifier
hi link dockercomposeTodo Todo
hi link bashStatement Function
let b:current_syntax = "dockercompose"
set commentstring=#\ %s
" Enable automatic comment insertion
setlocal fo+=cro
endif

View File

@@ -1,35 +1,68 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
" dockerfile.vim - Syntax highlighting for Dockerfiles " Vim syntax file
" Maintainer: Honza Pokorny <https://honza.ca> " Language: Dockerfile
" Version: 0.5 " Maintainer: Eugene Kalinin
" Latest Revision: 11 September 2013
" Source: http://docs.docker.io/en/latest/use/builder/
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
endif endif
" case sensitivity (fix #17)
" syn case ignore
" Keywords
syn keyword dockerfileKeywords FROM AS MAINTAINER RUN CMD COPY
syn keyword dockerfileKeywords EXPOSE ADD ENTRYPOINT
syn keyword dockerfileKeywords VOLUME USER WORKDIR ONBUILD
syn keyword dockerfileKeywords LABEL ARG HEALTHCHECK SHELL
" Bash statements
setlocal iskeyword+=-
syn keyword bashStatement add-apt-repository adduser apk apt-get aptitude apt-key autoconf bundle
syn keyword bashStatement cd chgrp chmod chown clear complete composer cp curl du echo egrep
syn keyword bashStatement expr fgrep find gem gnufind gnugrep gpg grep groupadd head less ln
syn keyword bashStatement ls make mkdir mv node npm pacman pip pip3 php python rails rm rmdir rpm ruby
syn keyword bashStatement sed sleep sort strip tar tail tailf touch useradd virtualenv yum
syn keyword bashStatement usermod bash cat a2ensite a2dissite a2enmod a2dismod apache2ctl
syn keyword bashStatement wget gzip
" Strings
syn region dockerfileString start=/"/ skip=/\\"|\\\\/ end=/"/
syn region dockerfileString1 start=/'/ skip=/\\'|\\\\/ end=/'/
" Emails
syn region dockerfileEmail start=/</ end=/>/ contains=@ oneline
" Urls
syn match dockerfileUrl /\(http\|https\|ssh\|hg\|git\)\:\/\/[a-zA-Z0-9\/\-\.]\+/
" Task tags
syn keyword dockerfileTodo contained TODO FIXME XXX
" Comments
syn region dockerfileComment start="#" end="\n" contains=dockerfileTodo
syn region dockerfileEnvWithComment start="^\s*ENV\>" end="\n" contains=dockerfileEnv
syn match dockerfileEnv contained /\<ENV\>/
" Highlighting
hi link dockerfileKeywords Keyword
hi link dockerfileEnv Keyword
hi link dockerfileString String
hi link dockerfileString1 String
hi link dockerfileComment Comment
hi link dockerfileEmail Identifier
hi link dockerfileUrl Identifier
hi link dockerfileTodo Todo
hi link bashStatement Function
let b:current_syntax = "dockerfile" let b:current_syntax = "dockerfile"
syntax case ignore
syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)\s/
highlight link dockerfileKeyword Keyword
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
highlight link dockerfileString String
syntax match dockerfileComment "\v^\s*#.*$"
highlight link dockerfileComment Comment
set commentstring=#\ %s set commentstring=#\ %s
" match "RUN", "CMD", and "ENTRYPOINT" lines, and parse them as shell " Enable automatic comment insertion
let s:current_syntax = b:current_syntax setlocal fo+=cro
unlet b:current_syntax
syntax include @SH syntax/sh.vim
let b:current_syntax = s:current_syntax
syntax region shLine matchgroup=dockerfileKeyword start=/\v^\s*(RUN|CMD|ENTRYPOINT)\s/ end=/\v$/ contains=@SH
" since @SH will handle "\" as part of the same line automatically, this "just works" for line continuation too, but with the caveat that it will highlight "RUN echo '" followed by a newline as if it were a block because the "'" is shell line continuation... not sure how to fix that just yet (TODO)
endif endif

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

@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
" Language: Haml " Language: Haml
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Filenames: *.haml " Filenames: *.haml
" Last Change: 2010 Aug 09 " Last Change: 2018 Aug 21
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@@ -40,7 +40,7 @@ syn match hamlDespacer "[<>]" contained nextgroup=hamlDespacer,hamlSelfCloser,
syn match hamlSelfCloser "/" contained syn match hamlSelfCloser "/" contained
syn match hamlClassChar "\." contained nextgroup=hamlClass syn match hamlClassChar "\." contained nextgroup=hamlClass
syn match hamlIdChar "#{\@!" contained nextgroup=hamlId syn match hamlIdChar "#{\@!" contained nextgroup=hamlId
syn match hamlClass "\%(\w\|-\)\+" contained nextgroup=@hamlComponent syn match hamlClass "\%(\w\|-\|\:\)\+" contained nextgroup=@hamlComponent
syn match hamlId "\%(\w\|-\)\+" contained nextgroup=@hamlComponent syn match hamlId "\%(\w\|-\)\+" contained nextgroup=@hamlComponent
syn region hamlDocType start="^\s*!!!" end="$" syn region hamlDocType start="^\s*!!!" end="$"

View File

@@ -1,138 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1
" Vim syntax file
" Language: i3-wm config file
" Maintainer: Emanuel Guével
" Latest Revision: 16 October 2012
if exists("b:current_syntax")
finish
endif
" Symbols
syn match i3Operators "+\|→"
syn match i3ChainDelimiter ";"
syn match i3Var "\$\w\+"
" Key modifiers
syn keyword i3KeyModifier Shift Control Ctrl Mod1 Mod2 Mod3 Mod4 Mod5 Mode_switch
" Strings
syn region i3SimpleString keepend start='[^ \t]' end='$\|;' contained contains=i3ChainDelimiter,i3Var
syn match i3QuotedString '"[^"]\+"' contained
syn cluster i3String contains=i3SimpleString,i3QuotedString
" Config commands
syn keyword i3ConfigCommand bind bindcode bindsym assign new_window popup_during_fullscreen font floating_modifier default_orientation workspace_layout for_window focus_follows_mouse bar position colors output tray_output workspace_buttons workspace_auto_back_and_forth binding_mode_indicator debuglog floating_minimum_size floating_maximum_size force_focus_wrapping force_xinerama force_display_urgency_hint hidden_state modifier new_float shmlog socket_path verbose mouse_warping strip_workspace_numbers focus_on_window_activation no_focus
syn match i3IpcSocket "ipc[-_]socket" nextgroup=@i3String skipwhite
" Command keywords
syn keyword i3Command exit reload restart kill fullscreen global layout border focus move open split append_layout mark unmark resize grow shrink show nop rename title_format sticky
syn keyword i3Param 1pixel default stacked tabbed normal none tiling stacking floating enable disable up down horizontal vertical auto up down left right parent child px or ppt leave_fullscreen toggle mode_toggle scratchpad width height top bottom client hide primary yes all active window container to absolute center on off x ms h v smart ignore pixel splith splitv output true
syn match i3DashedParam '--\(release\|border\|whole-window\|toggle\)' skipwhite
syn match i3NoStartupId '--no-startup-id' contained
syn keyword i3WsSpecialParam next prev next_on_output prev_on_output back_and_forth current number
syn keyword i3BordersSpecialParam none vertical horizontal both
syn keyword i3ModeParam dock hide invisible skipwhite
syn keyword i3GapsCommand gaps smart_gaps smart_borders
syn keyword i3GapsParam inner outer current all set plus minus no_gaps
" these are not keywords but we add them for consistency
syn keyword i3PseudoParam no false inactive
" Exec commands
syn region i3ExecCommand keepend start='[^ \t]' end='$\|;' contained contains=i3ChainDelimiter,i3Var,i3NoStartupId
syn match i3QuotedExecCommand '"[^"]\+"' contained
syn keyword i3ExecKeyword exec exec_always i3bar_command nextgroup=i3QuotedExecCommand,i3ExecCommand skipwhite
" Status command
syn match i3StatusCommand ".*$" contained
syn keyword i3StatusCommandKeyword status_command nextgroup=i3StatusCommand skipwhite
" Font statement
syn keyword i3FontStatement font nextgroup=@i3String skipwhite
" Separator symbol
syn keyword i3SeparatorSymbol separator_symbol nextgroup=@i3String skipwhite
" Set statement
syn match i3SetVar "\$\w\+" contained nextgroup=@i3String skipwhite
syn keyword i3SetKeyword set set_from_resource nextgroup=i3SetVar skipwhite
" Workspaces
syn keyword i3WsKeyword workspace nextgroup=i3WsSpecialParam,@i3String skipwhite
" Hide edge borders
syn keyword i3BordersConfigCommand hide_edge_borders nextgroup=i3BordersSpecialParam skipwhite
" Mode
syn keyword i3ModeKeyword mode nextgroup=i3ModeParam,@i3String skipwhite
" Comments
syn keyword i3Todo contained TODO FIXME XXX NOTE
syn match i3Comment "^\s*#.*$" contains=i3Todo
" Error (at end of line)
syn match i3Error ".*$" contained
" Hex color code
syn match i3ColorLast "#[0-9a-fA-F]\{6\}" contained nextgroup=i3Error skipwhite
syn match i3Color2nd "#[0-9a-fA-F]\{6\}" contained nextgroup=i3ColorLast skipwhite
syn match i3Color1st "#[0-9a-fA-F]\{6\}" contained nextgroup=i3Color2nd skipwhite
syn match i3ColorDef1 "client\.background\|statusline\|background\|separator\|statusline" nextgroup=i3ColorLast skipwhite
syn match i3ColorDef3 "client\.\(focused_inactive\|focused\|unfocused\|urgent\)\|inactive_workspace\|urgent_workspace\|focused_workspace\|active_workspace" nextgroup=i3Color1st skipwhite
highlight link i3ChainDelimiter Operator
highlight link i3Operators Operator
highlight link i3ExecCommand Special
highlight link i3QuotedExecCommand Special
highlight link i3StatusCommand Special
highlight link i3Param Constant
highlight link i3PseudoParam Constant
highlight link i3DashedParam Constant
highlight link i3NoStartupId Constant
highlight link i3Color1st Constant
highlight link i3Color2nd Constant
highlight link i3ColorLast Constant
highlight link i3WsSpecialParam Constant
highlight link i3BordersSpecialParam Constant
highlight link i3ModeParam Constant
highlight link i3GapsParam Constant
highlight link i3Var Identifier
highlight link i3SetVar Identifier
highlight link i3KeyModifier Function
highlight link i3SimpleString String
highlight link i3QuotedString String
highlight link i3WsName String
highlight link i3QuotedWsName String
highlight link i3SetValue String
highlight link i3Font String
highlight link i3ExecKeyword Keyword
highlight link i3Command Keyword
highlight link i3WsKeyword Keyword
highlight link i3GapsCommand Keyword
highlight link i3ColorDef1 Define
highlight link i3ColorDef3 Define
highlight link i3ConfigCommand Define
highlight link i3IpcSocket Define
highlight link i3SetKeyword Define
highlight link i3ModeKeyword Define
highlight link i3FontStatement Define
highlight link i3SeparatorSymbol Define
highlight link i3StatusCommandKeyword Define
highlight link i3BordersConfigCommand Define
highlight link i3Todo Todo
highlight link i3Comment Comment
highlight link i3Error Error
endif

246
syntax/i3config.vim Normal file
View File

@@ -0,0 +1,246 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'i3') == -1
" Vim syntax file
" Language: i3 config file
" Maintainer: Mohamed Boughaba <mohamed dot bgb at gmail dot com>
" Version: 0.3
" Last Change: 2017-10-27 23:59
" References:
" http://i3wm.org/docs/userguide.html#configuring
" http://vimdoc.sourceforge.net/htmldoc/syntax.html
"
"
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syn clear
elsei exists("b:current_syntax")
fini
en
scriptencoding utf-8
" Error
syn match Error /.*/
" Todo
syn keyword Todo TODO FIXME XXX contained
" Comment
" Comments are started with a # and can only be used at the beginning of a line
syn match Comment /^\s*#.*$/ contains=Todo
" Font
" A FreeType font description is composed by:
" a font family, a style, a weight, a variant, a stretch and a size.
syn match FontSeparator /,/ contained
syn match FontSeparator /:/ contained
syn keyword FontKeyword font contained
syn match FontNamespace /\w\+:/ contained contains=FontSeparator
syn match FontContent /-\?\w\+\(-\+\|\s\+\|,\)/ contained contains=FontNamespace,FontSeparator,FontKeyword
syn match FontSize /\s\=\d\+\(px\)\?\s\?$/ contained
syn match Font /^\s*font\s\+.*$/ contains=FontContent,FontSeparator,FontSize,FontNamespace
"syn match Font /^\s*font\s\+.*\(\\\_.*\)\?$/ contains=FontContent,FontSeparator,FontSize,FontNamespace
"syn match Font /^\s*font\s\+.*\(\\\_.*\)\?[^\\]\+$/ contains=FontContent,FontSeparator,FontSize,FontNamespace
"syn match Font /^\s*font\s\+\(\(.*\\\_.*\)\|\(.*[^\\]\+$\)\)/ contains=FontContent,FontSeparator,FontSize,FontNamespace
" variables
syn match String /\(['"]\)\(.\{-}\)\1/ contained
syn match Color /#\w\{6}/ contained
syn match VariableModifier /+/ contained
syn match VariableAndModifier /+\w\+/ contained contains=VariableModifier
syn match Variable /\$\w\+\(\(-\w\+\)\+\)\?\(\s\|+\)\?/ contains=VariableModifier,VariableAndModifier
syn keyword InitializeKeyword set contained
syn match Initialize /^\s*set\s\+.*$/ contains=Variable,InitializeKeyword,Color,String
" Gaps
syn keyword GapStyleKeyword inner outer current all set plus minus contained
syn match GapStyle /^\s*\(gaps\)\s\+\(inner\|outer\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\)\)\?\(\s\+\d\+\)$/ contains=GapStyleKeyword,number
" Keyboard bindings
syn keyword Action toggle fullscreen restart key import kill shrink grow contained
syn keyword Action focus move split layout resize restore reload mute unmute exit contained
syn match Modifier /\w\++\w\+\(\(+\w\+\)\+\)\?/ contained contains=VariableModifier
syn match Number /\s\d\+/ contained
syn keyword BindKeyword bindsym bindcode exec gaps contained
syn match BindArgument /--\w\+\(\(-\w\+\)\+\)\?\s/ contained
syn match Bind /^\s*\(bindsym\|bindcode\)\s\+.*$/ contains=Variable,BindKeyword,VariableAndModifier,BindArgument,Number,Modifier,Action,String,GapStyleKeyword
" Floating
syn keyword SizeSpecial x contained
syn match NegativeSize /-/ contained
syn match Size /-\?\d\+\s\?x\s\?-\?\d\+/ contained contains=SizeSpecial,Number,NegativeSize
syn match Floating /^\s*floating_modifier\s\+\$\w\+\d\?/ contains=Variable
syn match Floating /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=Size
" Orientation
syn keyword OrientationKeyword vertical horizontal auto contained
syn match Orientation /^\s*default_orientation\s\+\(vertical\|horizontal\|auto\)\s\?$/ contains=OrientationKeyword
" Layout
syn keyword LayoutKeyword default stacking tabbed contained
syn match Layout /^\s*workspace_layout\s\+\(default\|stacking\|tabbed\)\s\?$/ contains=LayoutKeyword
" Border style
syn keyword BorderStyleKeyword none normal pixel contained
syn match BorderStyle /^\s*\(new_window\|new_float\|default_border\|default_floating_border\)\s\+\(none\|\(normal\|pixel\)\(\s\+\d\+\)\?\)\s\?$/ contains=BorderStyleKeyword,number
" Hide borders and edges
syn keyword EdgeKeyword none vertical horizontal both contained
syn match Edge /^\s*hide_edge_borders\s\+\(none\|vertical\|horizontal\|both\)\s\?$/ contains=EdgeKeyword
" Arbitrary commands for specific windows (for_window)
syn keyword CommandKeyword for_window contained
syn region WindowStringSpecial start=+"+ skip=+\\"+ end=+"+ contained contains=String
syn region WindowCommandSpecial start="\[" end="\]" contained contains=WindowStringSpacial,String
syn match ArbitraryCommand /^\s*for_window\s\+.*$/ contains=WindowCommandSpecial,CommandKeyword,BorderStyleKeyword,LayoutKeyword,OrientationKeyword,Size,Number
" Disable focus open opening
syn keyword NoFocusKeyword no_focus contained
syn match DisableFocus /^\s*no_focus\s\+.*$/ contains=WindowCommandSpecial,NoFocusKeyword
" Move client to specific workspace automatically
syn keyword AssignKeyword assign contained
syn match AssignSpecial /→/ contained
syn match Assign /^\s*assign\s\+.*$/ contains=AssignKeyword,WindowCommandSpecial,AssignSpecial
" X resources
syn keyword ResourceKeyword set_from_resource contained
syn match Resource /^\s*set_from_resource\s\+.*$/ contains=ResourceKeyword,WindowCommandSpecial,Color,Variable
" Auto start applications
syn keyword ExecKeyword exec exec_always contained
syn match NoStartupId /--no-startup-id/ contained " We are not using BindArgument as only no-startup-id is supported here
syn match Exec /^\s*exec\(_always\)\?\s\+.*$/ contains=ExecKeyword,NoStartupId,String
" Automatically putting workspaces on specific screens
syn keyword WorkspaceKeyword workspace contained
syn keyword Output output contained
syn match Workspace /^\s*workspace\s\+.*$/ contains=WorkspaceKeyword,Number,String,Output
" Changing colors
syn keyword ClientColorKeyword client focused focused_inactive unfocused urgent placeholder background contained
syn match ClientColor /^\s*client.\w\+\s\+.*$/ contains=ClientColorKeyword,Color,Variable
" Interprocess communication
syn match InterprocessKeyword /ipc-socket/ contained
syn match Interprocess /^\s*ipc-socket\s\+.*$/ contains=InterprocessKeyword
" Mouse warping
syn keyword MouseWarpingKeyword mouse_warping contained
syn keyword MouseWarpingType output none contained
syn match MouseWarping /^\s*mouse_warping\s\+\(output\|none\)\s\?$/ contains=MouseWarpingKeyword,MouseWarpingType
" Focus follows mouse
syn keyword FocusFollowsMouseKeyword focus_follows_mouse contained
syn keyword FocusFollowsMouseType yes no contained
syn match FocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\)\s\?$/ contains=FocusFollowsMouseKeyword,FocusFollowsMouseType
" Popups during fullscreen mode
syn keyword PopupOnFullscreenKeyword popup_during_fullscreen contained
syn keyword PopuponFullscreenType smart ignore leave_fullscreen contained
syn match PopupOnFullscreen /^\s*popup_during_fullscreen\s\+\w\+\s\?$/ contains=PopupOnFullscreenKeyword,PopupOnFullscreenType
" Focus wrapping
syn keyword FocusWrappingKeyword force_focus_wrapping focus_wrapping contained
syn keyword FocusWrappingType yes no contained
syn match FocusWrapping /^\s*\(force_\)\?focus_wrapping\s\+\(yes\|no\)\s\?$/ contains=FocusWrappingType,FocusWrappingKeyword
" Forcing Xinerama
syn keyword ForceXineramaKeyword force_xinerama contained
syn match ForceXinerama /^\s*force_xinerama\s\+\(yes\|no\)\s\?$/ contains=FocusWrappingType,ForceXineramaKeyword
" Automatic back-and-forth when switching to the current workspace
syn keyword AutomaticSwitchKeyword workspace_auto_back_and_forth contained
syn match AutomaticSwitch /^\s*workspace_auto_back_and_forth\s\+\(yes\|no\)\s\?$/ contains=FocusWrappingType,AutomaticSwitchKeyword
" Delay urgency hint
syn keyword TimeUnit ms contained
syn keyword DelayUrgencyKeyword force_display_urgency_hint contained
syn match DelayUrgency /^\s*force_display_urgency_hint\s\+\d\+\s\+ms\s\?$/ contains=FocusWrappingType,DelayUrgencyKeyword,Number,TimeUnit
" Focus on window activation
syn keyword FocusOnActivationKeyword focus_on_window_activation contained
syn keyword FocusOnActivationType smart urgent focus none contained
syn match FocusOnActivation /^\s*focus_on_window_activation\s\+\(smart\|urgent\|focus\|none\)\s\?$/ contains=FocusOnActivationKeyword,FocusOnActivationType
" Automatic back-and-forth when switching to the current workspace
syn keyword DrawingMarksKeyword show_marks contained
syn match DrawingMarks /^\s*show_marks\s\+\(yes\|no\)\s\?$/ contains=FocusWrappingType,DrawingMarksKeyword
" Group mode/bar
syn keyword BlockKeyword mode bar colors i3bar_command status_command position exec mode hidden_state modifier id position output background statusline tray_output tray_padding separator separator_symbol workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained
syn region Block start=+.*s\?{$+ end=+^}$+ contains=BlockKeyword,String,Bind,Comment,Font,FocusWrappingType,Color,Variable transparent keepend extend
" Line continuation
syn region LineCont start=/^.*\\$/ end=/^.*$/ contains=BlockKeyword,String,Bind,Comment,Font,FocusWrappingType,Color,Variable transparent keepend extend
" Define the highlighting.
hi! def link Error Error
hi! def link Todo Todo
hi! def link Comment Comment
hi! def link FontContent Type
hi! def link FocusOnActivationType Type
hi! def link PopupOnFullscreenType Type
hi! def link OrientationKeyword Type
hi! def link MouseWarpingType Type
hi! def link FocusFollowsMouseType Type
hi! def link GapStyleKeyword Type
hi! def link LayoutKeyword Type
hi! def link BorderStyleKeyword Type
hi! def link EdgeKeyword Type
hi! def link Action Type
hi! def link Command Type
hi! def link Output Type
hi! def link WindowCommandSpecial Type
hi! def link FocusWrappingType Type
hi! def link FontSize Constant
hi! def link Color Constant
hi! def link Number Constant
hi! def link VariableAndModifier Constant
hi! def link TimeUnit Constant
hi! def link Modifier Constant
hi! def link String Constant
hi! def link NegativeSize Constant
hi! def link FontSeparator Special
hi! def link VariableModifier Special
hi! def link SizeSpecial Special
hi! def link WindowSpecial Special
hi! def link AssignSpecial Special
hi! def link FontNamespace PreProc
hi! def link BindArgument PreProc
hi! def link NoStartupId PreProc
hi! def link FontKeyword Identifier
hi! def link BindKeyword Identifier
hi! def link Orientation Identifier
hi! def link GapStyle Identifier
hi! def link Layout Identifier
hi! def link BorderStyle Identifier
hi! def link Edge Identifier
hi! def link Floating Identifier
hi! def link CommandKeyword Identifier
hi! def link NoFocusKeyword Identifier
hi! def link InitializeKeyword Identifier
hi! def link AssignKeyword Identifier
hi! def link ResourceKeyword Identifier
hi! def link ExecKeyword Identifier
hi! def link WorkspaceKeyword Identifier
hi! def link ClientColorKeyword Identifier
hi! def link InterprocessKeyword Identifier
hi! def link MouseWarpingKeyword Identifier
hi! def link FocusFollowsMouseKeyword Identifier
hi! def link PopupOnFullscreenKeyword Identifier
hi! def link FocusWrappingKeyword Identifier
hi! def link ForceXineramaKeyword Identifier
hi! def link AutomaticSwitchKeyword Identifier
hi! def link DelayUrgencyKeyword Identifier
hi! def link FocusOnActivationKeyword Identifier
hi! def link DrawingMarksKeyword Identifier
hi! def link BlockKeyword Identifier
hi! def link Variable Statement
hi! def link ArbitraryCommand Ignore
let b:current_syntax = "i3config"
endif

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

321
syntax/moon.vim Normal file
View File

@@ -0,0 +1,321 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'moonscript') == -1
" Language: MoonScript
" Maintainer: leafo <leafot@gmail.com>
" Based On: CoffeeScript by Mick Koch <kchmck@gmail.com>
" URL: http://github.com/leafo/moonscript-vim
" License: WTFPL
" Bail if our syntax is already loaded.
if exists('b:current_syntax') && b:current_syntax == 'moon'
finish
endif
if version < 600
syn clear
endif
" Highlight long strings.
syn sync minlines=100
" These are `matches` instead of `keywords` because vim's highlighting
" priority for keywords is higher than matches. This causes keywords to be
" highlighted inside matches, even if a match says it shouldn't contain them --
" like with moonAssign and moonDot.
syn match moonStatement /\<\%(return\|break\|continue\)\>/ display
hi def link moonStatement Statement
syn match moonRepeat /\<\%(for\|while\)\>/ display
hi def link moonRepeat Repeat
syn match moonConditional /\<\%(if\|else\|elseif\|then\|switch\|when\|unless\)\>/
\ display
hi def link moonConditional Conditional
" syn match moonException /\<\%(try\|catch\|finally\)\>/ display
" hi def link moonException Exception
syn match moonKeyword /\<\%(export\|local\|import\|from\|with\|in\|and\|or\|not\|class\|extends\|super\|using\|do\)\>/
\ display
hi def link moonKeyword Keyword
" all built in funcs from Lua 5.1
syn keyword moonLuaFunc assert collectgarbage dofile error next
syn keyword moonLuaFunc print rawget rawset tonumber tostring type _VERSION
syn keyword moonLuaFunc _G getfenv getmetatable ipairs loadfile
syn keyword moonLuaFunc loadstring pairs pcall rawequal
syn keyword moonLuaFunc require setfenv setmetatable unpack xpcall
syn keyword moonLuaFunc load module select
syn match moonLuaFunc /package\.cpath/
syn match moonLuaFunc /package\.loaded/
syn match moonLuaFunc /package\.loadlib/
syn match moonLuaFunc /package\.path/
syn match moonLuaFunc /package\.preload/
syn match moonLuaFunc /package\.seeall/
syn match moonLuaFunc /coroutine\.running/
syn match moonLuaFunc /coroutine\.create/
syn match moonLuaFunc /coroutine\.resume/
syn match moonLuaFunc /coroutine\.status/
syn match moonLuaFunc /coroutine\.wrap/
syn match moonLuaFunc /coroutine\.yield/
syn match moonLuaFunc /string\.byte/
syn match moonLuaFunc /string\.char/
syn match moonLuaFunc /string\.dump/
syn match moonLuaFunc /string\.find/
syn match moonLuaFunc /string\.len/
syn match moonLuaFunc /string\.lower/
syn match moonLuaFunc /string\.rep/
syn match moonLuaFunc /string\.sub/
syn match moonLuaFunc /string\.upper/
syn match moonLuaFunc /string\.format/
syn match moonLuaFunc /string\.gsub/
syn match moonLuaFunc /string\.gmatch/
syn match moonLuaFunc /string\.match/
syn match moonLuaFunc /string\.reverse/
syn match moonLuaFunc /table\.maxn/
syn match moonLuaFunc /table\.concat/
syn match moonLuaFunc /table\.sort/
syn match moonLuaFunc /table\.insert/
syn match moonLuaFunc /table\.remove/
syn match moonLuaFunc /math\.abs/
syn match moonLuaFunc /math\.acos/
syn match moonLuaFunc /math\.asin/
syn match moonLuaFunc /math\.atan/
syn match moonLuaFunc /math\.atan2/
syn match moonLuaFunc /math\.ceil/
syn match moonLuaFunc /math\.sin/
syn match moonLuaFunc /math\.cos/
syn match moonLuaFunc /math\.tan/
syn match moonLuaFunc /math\.deg/
syn match moonLuaFunc /math\.exp/
syn match moonLuaFunc /math\.floor/
syn match moonLuaFunc /math\.log/
syn match moonLuaFunc /math\.log10/
syn match moonLuaFunc /math\.max/
syn match moonLuaFunc /math\.min/
syn match moonLuaFunc /math\.fmod/
syn match moonLuaFunc /math\.modf/
syn match moonLuaFunc /math\.cosh/
syn match moonLuaFunc /math\.sinh/
syn match moonLuaFunc /math\.tanh/
syn match moonLuaFunc /math\.pow/
syn match moonLuaFunc /math\.rad/
syn match moonLuaFunc /math\.sqrt/
syn match moonLuaFunc /math\.frexp/
syn match moonLuaFunc /math\.ldexp/
syn match moonLuaFunc /math\.random/
syn match moonLuaFunc /math\.randomseed/
syn match moonLuaFunc /math\.pi/
syn match moonLuaFunc /io\.stdin/
syn match moonLuaFunc /io\.stdout/
syn match moonLuaFunc /io\.stderr/
syn match moonLuaFunc /io\.close/
syn match moonLuaFunc /io\.flush/
syn match moonLuaFunc /io\.input/
syn match moonLuaFunc /io\.lines/
syn match moonLuaFunc /io\.open/
syn match moonLuaFunc /io\.output/
syn match moonLuaFunc /io\.popen/
syn match moonLuaFunc /io\.read/
syn match moonLuaFunc /io\.tmpfile/
syn match moonLuaFunc /io\.type/
syn match moonLuaFunc /io\.write/
syn match moonLuaFunc /os\.clock/
syn match moonLuaFunc /os\.date/
syn match moonLuaFunc /os\.difftime/
syn match moonLuaFunc /os\.execute/
syn match moonLuaFunc /os\.exit/
syn match moonLuaFunc /os\.getenv/
syn match moonLuaFunc /os\.remove/
syn match moonLuaFunc /os\.rename/
syn match moonLuaFunc /os\.setlocale/
syn match moonLuaFunc /os\.time/
syn match moonLuaFunc /os\.tmpname/
syn match moonLuaFunc /debug\.debug/
syn match moonLuaFunc /debug\.gethook/
syn match moonLuaFunc /debug\.getinfo/
syn match moonLuaFunc /debug\.getlocal/
syn match moonLuaFunc /debug\.getupvalue/
syn match moonLuaFunc /debug\.setlocal/
syn match moonLuaFunc /debug\.setupvalue/
syn match moonLuaFunc /debug\.sethook/
syn match moonLuaFunc /debug\.traceback/
syn match moonLuaFunc /debug\.getfenv/
syn match moonLuaFunc /debug\.getmetatable/
syn match moonLuaFunc /debug\.getregistry/
syn match moonLuaFunc /debug\.setfenv/
syn match moonLuaFunc /debug\.setmetatable/
hi def link moonLuaFunc Identifier
" The first case matches symbol operators only if they have an operand before.
syn match moonExtendedOp /\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?#]\+\|\.\|\\/
\ display
hi def link moonExtendedOp moonOperator
hi def link moonOperator Operator
syntax match moonFunction /->\|=>\|)\|(\|\[\|]\|{\|}\|!/
highlight default link moonFunction Function
" This is separate from `moonExtendedOp` to help differentiate commas from
" dots.
syn match moonSpecialOp /[,;]/ display
hi def link moonSpecialOp SpecialChar
syn match moonBoolean /\<\%(true\|false\)\>/ display
hi def link moonBoolean Boolean
syn match moonGlobal /\<\%(nil\)\>/ display
hi def link moonGlobal Type
" A special variable
syn match moonSpecialVar /\<\%(self\)\>/ display
" An @-variable
syn match moonSpecialVar /@\%(\I\i*\)\?/ display
hi def link moonSpecialVar Structure
" A class-like name that starts with a capital letter
syn match moonObject /\<\u\w*\>/ display
hi def link moonObject Structure
" A constant-like name in SCREAMING_CAPS
syn match moonConstant /\<\u[A-Z0-9_]\+\>/ display
hi def link moonConstant Constant
" A variable name
syn cluster moonIdentifier contains=moonSpecialVar,moonObject,
\ moonConstant
" A non-interpolated string
syn cluster moonBasicString contains=@Spell,moonEscape
" An interpolated string
syn cluster moonInterpString contains=@moonBasicString,moonInterp
" Regular strings
syn region moonString start=/"/ skip=/\\\\\|\\"/ end=/"/
\ contains=@moonInterpString
syn region moonString start=/'/ skip=/\\\\\|\\'/ end=/'/
\ contains=@moonBasicString
hi def link moonString String
syn region moonString2 matchgroup=moonString start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell
hi def link moonString2 String
" A integer, including a leading plus or minus
syn match moonNumber /\i\@<![-+]\?\d\+\%([eE][+-]\?\d\+\)\?/ display
" A hex number
syn match moonNumber /\<0[xX]\x\+\>/ display
hi def link moonNumber Number
" A floating-point number, including a leading plus or minus
syn match moonFloat /\i\@<![-+]\?\d*\.\@<!\.\d\+\%([eE][+-]\?\d\+\)\?/
\ display
hi def link moonFloat Float
" An error for reserved keywords
if !exists("moon_no_reserved_words_error")
syn match moonReservedError /\<\%(end\|function\|repeat\)\>/
\ display
hi def link moonReservedError Error
endif
" This is separate from `moonExtendedOp` since assignments require it.
syn match moonAssignOp /:/ contained display
hi def link moonAssignOp moonOperator
" Strings used in string assignments, which can't have interpolations
syn region moonAssignString start=/"/ skip=/\\\\\|\\"/ end=/"/ contained
\ contains=@moonBasicString
syn region moonAssignString start=/'/ skip=/\\\\\|\\'/ end=/'/ contained
\ contains=@moonBasicString
hi def link moonAssignString String
" A normal object assignment
syn match moonObjAssign /@\?\I\i*\s*:\@<!::\@!/
\ contains=@moonIdentifier,moonAssignOp
hi def link moonObjAssign Identifier
" Short hand table literal assign
syn match moonShortHandAssign /:\@<!:@\?\I\i*\s*/
\ contains=@moonIdentifier,moonAssignOp
hi def link moonShortHandAssign Identifier
" An object-string assignment
syn match moonObjStringAssign /\("\|'\)[^\1]*\1\s*;\@<!::\@!'\@!/
\ contains=moonAssignString,moonAssignOp
" An object-integer assignment
syn match moonObjNumberAssign /\d\+\%(\.\d\+\)\?\s*:\@<!::\@!/
\ contains=moonNumber,moonAssignOp
syn keyword moonTodo TODO FIXME XXX contained
hi def link moonTodo Todo
syn match moonComment "\%^#!.*"
syn match moonComment /--.*/ contains=@Spell,moonTodo
hi def link moonComment Comment
" syn region moonBlockComment start=/####\@!/ end=/###/
" \ contains=@Spell,moonTodo
" hi def link moonBlockComment moonComment
syn region moonInterp matchgroup=moonInterpDelim start=/#{/ end=/}/ contained
\ contains=@moonAll
hi def link moonInterpDelim PreProc
" A string escape sequence
syn match moonEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained display
hi def link moonEscape SpecialChar
" Heredoc strings
" syn region moonHeredoc start=/"""/ end=/"""/ contains=@moonInterpString
" \ fold
" syn region moonHeredoc start=/'''/ end=/'''/ contains=@moonBasicString
" \ fold
" hi def link moonHeredoc String
" An error for trailing whitespace, as long as the line isn't just whitespace
if !exists("moon_no_trailing_space_error")
syn match moonSpaceError /\S\@<=\s\+$/ display
hi def link moonSpaceError Error
endif
" An error for trailing semicolons, for help transitioning from JavaScript
if !exists("moon_no_trailing_semicolon_error")
syn match moonSemicolonError /;$/ display
hi def link moonSemicolonError Error
endif
" Ignore reserved words in dot accesses.
syn match moonDotAccess /\.\@<!\.\s*\I\i*/he=s+1 contains=@moonIdentifier
hi def link moonDotAccess moonExtendedOp
" This is required for interpolations to work.
syn region moonCurlies matchgroup=moonCurly start=/{/ end=/}/
\ contains=@moonAll contained
" " These are highlighted the same as commas since they tend to go together.
" hi def link moonBlock moonSpecialOp
" hi def link moonBracket moonBlock
" hi def link moonCurly moonBlock
" hi def link moonParen moonBlock
" This is used instead of TOP to keep things moon-specific for good
" embedding. `contained` groups aren't included.
syn cluster moonAll contains=moonStatement,moonRepeat,moonConditional,
\ moonKeyword,moonOperator,moonFunction,
\ moonExtendedOp,moonSpecialOp,moonBoolean,
\ moonGlobal,moonSpecialVar,moonObject,
\ moonConstant,moonString,moonNumber,
\ moonFloat,moonReservedError,moonObjAssign,
\ moonObjStringAssign,moonObjNumberAssign,
\ moonShortHandAssign,moonComment,moonLuaFunc,
\ moonSpaceError,moonSemicolonError,
\ moonDotAccess,
\ moonCurlies
if !exists('b:current_syntax')
let b:current_syntax = 'moon'
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

387
syntax/org.vim Normal file
View File

@@ -0,0 +1,387 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'org') == -1
" Support org authoring markup as closely as possible
" (we're adding two markdown-like variants for =code= and blockquotes)
" -----------------------------------------------------------------------------
"
" Do we use aggresive conceal?
if exists("b:org_aggressive_conceal")
let s:conceal_aggressively=b:org_aggressive_conceal
elseif exists("g:org_aggressive_conceal")
let s:conceal_aggressively=g:org_aggressive_conceal
else
let s:conceal_aggressively=0
endif
" Inline markup {{{1
" *bold*, /italic/, _underline_, +strike-through+, =code=, ~verbatim~
" Note:
" - /italic/ is rendered as reverse in most terms (works fine in gVim, though)
" - +strike-through+ doesn't work on Vim / gVim
" - the non-standard `code' markup is also supported
" - =code= and ~verbatim~ are also supported as block-level markup, see below.
" Ref: http://orgmode.org/manual/Emphasis-and-monospace.html
"syntax match org_bold /\*[^ ]*\*/
" FIXME: Always make org_bold syntax define before org_heading syntax
" to make sure that org_heading syntax got higher priority(help :syn-priority) than org_bold.
" If there is any other good solution, please help fix it.
" \\\\*sinuate*
if (s:conceal_aggressively == 1)
syntax region org_bold matchgroup=org_border_bold start="[^ \\]\zs\*\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs\*\|\(^\|[^\\]\)\@<=\*\S\@=" end="[^ \\]\zs\*\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs\*\|[^\\]\zs\*\S\@=" concealends oneline
syntax region org_italic matchgroup=org_border_ital start="[^ \\]\zs\/\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs\/\|\(^\|[^\\]\)\@<=\/\S\@=" end="[^ \\]\zs\/\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs\/\|[^\\]\zs\/\S\@=" concealends oneline
syntax region org_underline matchgroup=org_border_undl start="[^ \\]\zs_\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs_\|\(^\|[^\\]\)\@<=_\S\@=" end="[^ \\]\zs_\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs_\|[^\\]\zs_\S\@=" concealends oneline
syntax region org_code matchgroup=org_border_code start="[^ \\]\zs=\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs=\|\(^\|[^\\]\)\@<==\S\@=" end="[^ \\]\zs=\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs=\|[^\\]\zs=\S\@=" concealends oneline
syntax region org_code matchgroup=org_border_code start="[^ \\]\zs`\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs`\|\(^\|[^\\]\)\@<=`\S\@=" end="[^ \\]\zs'\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs'\|[^\\]\zs'\S\@=" concealends oneline
syntax region org_verbatim matchgroup=org_border_verb start="[^ \\]\zs\~\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs\~\|\(^\|[^\\]\)\@<=\~\S\@=" end="[^ \\]\zs\~\|\(\(^\|[^\\]\)\zs\(\\\\\)\+\)\zs\~\|[^\\]\zs\~\S\@=" concealends oneline
else
syntax region org_bold start="\S\zs\*\|\*\S\@=" end="\S\zs\*\|\*\S\@=" keepend oneline
syntax region org_italic start="\S\zs\/\|\/\S\@=" end="\S\zs\/\|\/\S\@=" keepend oneline
syntax region org_underline start="\S\zs_\|_\S\@=" end="\S\zs_\|_\S\@=" keepend oneline
syntax region org_code start="\S\zs=\|=\S\@=" end="\S\zs=\|=\S\@=" keepend oneline
syntax region org_code start="\S\zs`\|`\S\@=" end="\S\zs'\|'\S\@=" keepend oneline
syntax region org_verbatim start="\S\zs\~\|\~\S\@=" end="\S\zs\~\|\~\S\@=" keepend oneline
endif
hi def org_bold term=bold cterm=bold gui=bold
hi def org_italic term=italic cterm=italic gui=italic
hi def org_underline term=underline cterm=underline gui=underline
if (s:conceal_aggressively == 1)
hi link org_border_bold org_bold
hi link org_border_ital org_italic
hi link org_border_undl org_underline
endif
" Headings: {{{1
" Load Settings: {{{2
if !exists('g:org_heading_highlight_colors')
let g:org_heading_highlight_colors = ['Title', 'Constant', 'Identifier', 'Statement', 'PreProc', 'Type', 'Special']
endif
if !exists('g:org_heading_highlight_levels')
let g:org_heading_highlight_levels = len(g:org_heading_highlight_colors)
endif
if !exists('g:org_heading_shade_leading_stars')
let g:org_heading_shade_leading_stars = 1
endif
" Enable Syntax HL: {{{2
unlet! s:i s:j s:contains
let s:i = 1
let s:j = len(g:org_heading_highlight_colors)
let s:contains = ' contains=org_timestamp,org_timestamp_inactive,org_subtask_percent,org_subtask_number,org_subtask_percent_100,org_subtask_number_all,org_list_checkbox,org_bold,org_italic,org_underline,org_code,org_verbatim'
if g:org_heading_shade_leading_stars == 1
let s:contains = s:contains . ',org_shade_stars'
syntax match org_shade_stars /^\*\{2,\}/me=e-1 contained
hi def link org_shade_stars Ignore
else
hi clear org_shade_stars
endif
while s:i <= g:org_heading_highlight_levels
exec 'syntax match org_heading' . s:i . ' /^\*\{' . s:i . '\}\s.*/' . s:contains
exec 'hi def link org_heading' . s:i . ' ' . g:org_heading_highlight_colors[(s:i - 1) % s:j]
let s:i += 1
endwhile
unlet! s:i s:j s:contains
" Todo Keywords: {{{1
" Load Settings: {{{2
if !exists('g:org_todo_keywords')
let g:org_todo_keywords = ['TODO', '|', 'DONE']
endif
if !exists('g:org_todo_keyword_faces')
let g:org_todo_keyword_faces = []
endif
" Enable Syntax HL: {{{2
let s:todo_headings = ''
let s:i = 1
while s:i <= g:org_heading_highlight_levels
if s:todo_headings == ''
let s:todo_headings = 'containedin=org_heading' . s:i
else
let s:todo_headings = s:todo_headings . ',org_heading' . s:i
endif
let s:i += 1
endwhile
unlet! s:i
if !exists('g:loaded_org_syntax')
let g:loaded_org_syntax = 1
function! OrgExtendHighlightingGroup(base_group, new_group, settings)
let l:base_hi = ''
redir => l:base_hi
silent execute 'highlight ' . a:base_group
redir END
let l:group_hi = substitute(split(l:base_hi, '\n')[0], '^' . a:base_group . '\s\+xxx', '', '')
execute 'highlight ' . a:new_group . l:group_hi . ' ' . a:settings
endfunction
function! OrgInterpretFaces(faces)
let l:res_faces = ''
if type(a:faces) == 3
let l:style = []
for l:f in a:faces
let l:_f = [l:f]
if type(l:f) == 3
let l:_f = l:f
endif
for l:g in l:_f
if type(l:g) == 1 && l:g =~ '^:'
if l:g !~ '[\t ]'
continue
endif
let l:k_v = split(l:g)
if l:k_v[0] == ':foreground'
let l:gui_color = ''
let l:found_gui_color = 0
for l:color in split(l:k_v[1], ',')
if l:color =~ '^#'
let l:found_gui_color = 1
let l:res_faces = l:res_faces . ' guifg=' . l:color
elseif l:color != ''
let l:gui_color = l:color
let l:res_faces = l:res_faces . ' ctermfg=' . l:color
endif
endfor
if ! l:found_gui_color && l:gui_color != ''
let l:res_faces = l:res_faces . ' guifg=' . l:gui_color
endif
elseif l:k_v[0] == ':background'
let l:gui_color = ''
let l:found_gui_color = 0
for l:color in split(l:k_v[1], ',')
if l:color =~ '^#'
let l:found_gui_color = 1
let l:res_faces = l:res_faces . ' guibg=' . l:color
elseif l:color != ''
let l:gui_color = l:color
let l:res_faces = l:res_faces . ' ctermbg=' . l:color
endif
endfor
if ! l:found_gui_color && l:gui_color != ''
let l:res_faces = l:res_faces . ' guibg=' . l:gui_color
endif
elseif l:k_v[0] == ':weight' || l:k_v[0] == ':slant' || l:k_v[0] == ':decoration'
if index(l:style, l:k_v[1]) == -1
call add(l:style, l:k_v[1])
endif
endif
elseif type(l:g) == 1
" TODO emacs interprets the color and automatically determines
" whether it should be set as foreground or background color
let l:res_faces = l:res_faces . ' ctermfg=' . l:k_v[1] . ' guifg=' . l:k_v[1]
endif
endfor
endfor
let l:s = ''
for l:i in l:style
if l:s == ''
let l:s = l:i
else
let l:s = l:s . ','. l:i
endif
endfor
if l:s != ''
let l:res_faces = l:res_faces . ' term=' . l:s . ' cterm=' . l:s . ' gui=' . l:s
endif
elseif type(a:faces) == 1
" TODO emacs interprets the color and automatically determines
" whether it should be set as foreground or background color
let l:res_faces = l:res_faces . ' ctermfg=' . a:faces . ' guifg=' . a:faces
endif
return l:res_faces
endfunction
function! s:ReadTodoKeywords(keywords, todo_headings)
let l:default_group = 'Todo'
for l:i in a:keywords
if type(l:i) == 3
call s:ReadTodoKeywords(l:i, a:todo_headings)
continue
endif
if l:i == '|'
let l:default_group = 'Question'
continue
endif
" strip access key
let l:_i = substitute(l:i, "\(.*$", "", "")
let l:group = l:default_group
for l:j in g:org_todo_keyword_faces
if l:j[0] == l:_i
let l:group = 'org_todo_keyword_face_' . l:_i
call OrgExtendHighlightingGroup(l:default_group, l:group, OrgInterpretFaces(l:j[1]))
break
endif
endfor
silent! exec 'syntax match org_todo_keyword_' . l:_i . ' /\*\{1,\}\s\{1,\}\zs' . l:_i .'\(\s\|$\)/ ' . a:todo_headings
silent! exec 'hi def link org_todo_keyword_' . l:_i . ' ' . l:group
endfor
endfunction
endif
call s:ReadTodoKeywords(g:org_todo_keywords, s:todo_headings)
unlet! s:todo_headings
" Timestamps: {{{1
"<2003-09-16 Tue>
"<2003-09-16 Sáb>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k>\)/
"<2003-09-16 Tue 12:00>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d>\)/
"<2003-09-16 Tue 12:00-12:30>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d-\d\d:\d\d>\)/
"<2003-09-16 Tue>--<2003-09-16 Tue>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k>--<\d\d\d\d-\d\d-\d\d \k\k\k>\)/
"<2003-09-16 Tue 12:00>--<2003-09-16 Tue 12:00>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d>--<\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d>\)/
syn match org_timestamp /\(<%%(diary-float.\+>\)/
"[2003-09-16 Tue]
syn match org_timestamp_inactive /\(\[\d\d\d\d-\d\d-\d\d \k\k\k\]\)/
"[2003-09-16 Tue 12:00]
syn match org_timestamp_inactive /\(\[\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d\]\)/
"[2003-09-16 Tue]--[2003-09-16 Tue]
syn match org_timestamp_inactive /\(\[\d\d\d\d-\d\d-\d\d \k\k\k\]--\[\d\d\d\d-\d\d-\d\d \k\k\k\]\)/
"[2003-09-16 Tue 12:00]--[2003-09-16 Tue 12:00]
syn match org_timestamp_inactive /\(\[\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d\]--\[\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d\]\)/
syn match org_timestamp_inactive /\(\[%%(diary-float.\+\]\)/
hi def link org_timestamp PreProc
hi def link org_timestamp_inactive Comment
" Deadline And Schedule: {{{1
syn match org_deadline_scheduled /^\s*\(DEADLINE\|SCHEDULED\):/
hi def link org_deadline_scheduled PreProc
" Tables: {{{1
syn match org_table /^\s*|.*/ contains=org_timestamp,org_timestamp_inactive,hyperlink,org_table_separator,org_table_horizontal_line
syn match org_table_separator /\(^\s*|[-+]\+|\?\||\)/ contained
hi def link org_table_separator Type
" Hyperlinks: {{{1
syntax match hyperlink "\[\{2}[^][]*\(\]\[[^][]*\)\?\]\{2}" contains=hyperlinkBracketsLeft,hyperlinkURL,hyperlinkBracketsRight containedin=ALL
if (s:conceal_aggressively == 1)
syntax match hyperlinkBracketsLeft contained "\[\{2}#\?" conceal
else
syntax match hyperlinkBracketsLeft contained "\[\{2}" conceal
endif
syntax match hyperlinkURL contained "[^][]*\]\[" conceal
syntax match hyperlinkBracketsRight contained "\]\{2}" conceal
hi def link hyperlink Underlined
" Comments: {{{1
syntax match org_comment /^#.*/
hi def link org_comment Comment
" Bullet Lists: {{{1
" Ordered Lists:
" 1. list item
" 1) list item
" a. list item
" a) list item
syn match org_list_ordered "^\s*\(\a\|\d\+\)[.)]\(\s\|$\)" nextgroup=org_list_item
hi def link org_list_ordered Identifier
" Unordered Lists:
" - list item
" * list item
" + list item
" + and - don't need a whitespace prefix
syn match org_list_unordered "^\(\s*[-+]\|\s\+\*\)\(\s\|$\)" nextgroup=org_list_item
hi def link org_list_unordered Identifier
" Definition Lists:
" - Term :: expl.
" 1) Term :: expl.
syntax match org_list_def /.*\s\+::/ contained
hi def link org_list_def PreProc
syntax match org_list_item /.*$/ contained contains=org_subtask_percent,org_subtask_number,org_subtask_percent_100,org_subtask_number_all,org_list_checkbox,org_bold,org_italic,org_underline,org_code,org_verbatim,org_timestamp,org_timestamp_inactive,org_list_def
syntax match org_list_checkbox /\[[ X-]]/ contained
hi def link org_list_bullet Identifier
hi def link org_list_checkbox PreProc
" Block Delimiters: {{{1
syntax case ignore
syntax match org_block_delimiter /^#+BEGIN_.*/
syntax match org_block_delimiter /^#+END_.*/
syntax match org_key_identifier /^#+[^ ]*:/
syntax match org_title /^#+TITLE:.*/ contains=org_key_identifier
hi def link org_block_delimiter Comment
hi def link org_key_identifier Comment
hi def link org_title Title
" Block Markup: {{{1
" we consider all BEGIN/END sections as 'verbatim' blocks (inc. 'quote', 'verse', 'center')
" except 'example' and 'src' which are treated as 'code' blocks.
" Note: the non-standard '>' prefix is supported for quotation lines.
" Note: the '^:.*" rule must be defined before the ':PROPERTIES:' one below.
" TODO: http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file
syntax match org_verbatim /^\s*>.*/
syntax match org_code /^\s*:.*/
syntax region org_verbatim start="^\s*#+BEGIN_.*" end="^\s*#+END_.*" keepend contains=org_block_delimiter
syntax region org_code start="^\s*#+BEGIN_SRC" end="^\s*#+END_SRC" keepend contains=org_block_delimiter
syntax region org_code start="^\s*#+BEGIN_EXAMPLE" end="^\s*#+END_EXAMPLE" keepend contains=org_block_delimiter
hi def link org_code String
hi def link org_verbatim String
if (s:conceal_aggressively==1)
hi link org_border_code org_code
hi link org_border_verb org_verbatim
endif
" Properties: {{{1
syn region Error matchgroup=org_properties_delimiter start=/^\s*:PROPERTIES:\s*$/ end=/^\s*:END:\s*$/ contains=org_property keepend
syn match org_property /^\s*:[^\t :]\+:\s\+[^\t ]/ contained contains=org_property_value
syn match org_property_value /:\s\zs.*/ contained
hi def link org_properties_delimiter PreProc
hi def link org_property Statement
hi def link org_property_value Constant
" Break down subtasks
syntax match org_subtask_number /\[\d*\/\d*]/ contained
syntax match org_subtask_percent /\[\d*%\]/ contained
syntax match org_subtask_number_all /\[\(\d\+\)\/\1\]/ contained
syntax match org_subtask_percent_100 /\[100%\]/ contained
hi def link org_subtask_number String
hi def link org_subtask_percent String
hi def link org_subtask_percent_100 Identifier
hi def link org_subtask_number_all Identifier
" Plugin SyntaxRange: {{{1
" This only works if you have SyntaxRange installed:
" https://github.com/vim-scripts/SyntaxRange
" BEGIN_SRC
if exists('g:loaded_SyntaxRange')
call SyntaxRange#Include('#+BEGIN_SRC vim', '#+END_SRC', 'vim', 'comment')
call SyntaxRange#Include('#+BEGIN_SRC python', '#+END_SRC', 'python', 'comment')
call SyntaxRange#Include('#+BEGIN_SRC c', '#+END_SRC', 'c', 'comment')
" cpp must be below c, otherwise you get c syntax hl for cpp files
call SyntaxRange#Include('#+BEGIN_SRC cpp', '#+END_SRC', 'cpp', 'comment')
call SyntaxRange#Include('#+BEGIN_SRC ruby', '#+END_SRC', 'ruby', 'comment')
" call SyntaxRange#Include('#+BEGIN_SRC lua', '#+END_SRC', 'lua', 'comment')
" call SyntaxRange#Include('#+BEGIN_SRC lisp', '#+END_SRC', 'lisp', 'comment')
" LaTeX
call SyntaxRange#Include('\\begin[.*]{.*}', '\\end{.*}', 'tex')
call SyntaxRange#Include('\\begin{.*}', '\\end{.*}', 'tex')
call SyntaxRange#Include('\\\[', '\\\]', 'tex')
endif
" vi: ft=vim:tw=80:sw=4:ts=4:fdm=marker
endif

83
syntax/orgagenda.vim Normal file
View File

@@ -0,0 +1,83 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'org') == -1
" TODO do we really need a separate syntax file for the agenda?
" - Most of the stuff here is also in syntax.org
" - DRY!
syn match org_todo_key /\[\zs[^]]*\ze\]/
hi def link org_todo_key Identifier
let s:todo_headings = ''
let s:i = 1
while s:i <= g:org_heading_highlight_levels
if s:todo_headings == ''
let s:todo_headings = 'containedin=org_heading' . s:i
else
let s:todo_headings = s:todo_headings . ',org_heading' . s:i
endif
let s:i += 1
endwhile
unlet! s:i
if !exists('g:loaded_orgagenda_syntax')
let g:loaded_orgagenda_syntax = 1
function! s:ReadTodoKeywords(keywords, todo_headings)
let l:default_group = 'Todo'
for l:i in a:keywords
if type(l:i) == 3
call s:ReadTodoKeywords(l:i, a:todo_headings)
continue
endif
if l:i == '|'
let l:default_group = 'Question'
continue
endif
" strip access key
let l:_i = substitute(l:i, "\(.*$", "", "")
let l:group = l:default_group
for l:j in g:org_todo_keyword_faces
if l:j[0] == l:_i
let l:group = 'orgtodo_todo_keyword_face_' . l:_i
call OrgExtendHighlightingGroup(l:default_group, l:group, OrgInterpretFaces(l:j[1]))
break
endif
endfor
silent! exec 'syntax match orgtodo_todo_keyword_' . l:_i . ' /' . l:_i .'/ ' . a:todo_headings
silent! exec 'hi def link orgtodo_todo_keyword_' . l:_i . ' ' . l:group
endfor
endfunction
endif
call s:ReadTodoKeywords(g:org_todo_keywords, s:todo_headings)
unlet! s:todo_headings
" Timestamps
"<2003-09-16 Tue>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k>\)/
"<2003-09-16 Tue 12:00>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d>\)/
"<2003-09-16 Tue 12:00-12:30>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d-\d\d:\d\d>\)/
"<2003-09-16 Tue>--<2003-09-16 Tue>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k>--<\d\d\d\d-\d\d-\d\d \k\k\k>\)/
"<2003-09-16 Tue 12:00>--<2003-09-16 Tue 12:00>
syn match org_timestamp /\(<\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d>--<\d\d\d\d-\d\d-\d\d \k\k\k \d\d:\d\d>\)/
syn match org_timestamp /\(<%%(diary-float.\+>\)/
hi def link org_timestamp PreProc
" special words
syn match today /TODAY$/
hi def link today PreProc
syn match week_agenda /^Week Agenda:$/
hi def link week_agenda PreProc
" Hyperlinks
syntax match hyperlink "\[\{2}[^][]*\(\]\[[^][]*\)\?\]\{2}" contains=hyperlinkBracketsLeft,hyperlinkURL,hyperlinkBracketsRight containedin=ALL
syntax match hyperlinkBracketsLeft contained "\[\{2}" conceal
syntax match hyperlinkURL contained "[^][]*\]\[" conceal
syntax match hyperlinkBracketsRight contained "\]\{2}" conceal
hi def link hyperlink Underlined
endif

51
syntax/orgtodo.vim Normal file
View File

@@ -0,0 +1,51 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'org') == -1
syn match org_todo_key /\[\zs[^]]*\ze\]/
hi def link org_todo_key Identifier
let s:todo_headings = ''
let s:i = 1
while s:i <= g:org_heading_highlight_levels
if s:todo_headings == ''
let s:todo_headings = 'containedin=org_heading' . s:i
else
let s:todo_headings = s:todo_headings . ',org_heading' . s:i
endif
let s:i += 1
endwhile
unlet! s:i
if !exists('g:loaded_orgtodo_syntax')
let g:loaded_orgtodo_syntax = 1
function! s:ReadTodoKeywords(keywords, todo_headings)
let l:default_group = 'Todo'
for l:i in a:keywords
if type(l:i) == 3
call s:ReadTodoKeywords(l:i, a:todo_headings)
continue
endif
if l:i == '|'
let l:default_group = 'Question'
continue
endif
" strip access key
let l:_i = substitute(l:i, "\(.*$", "", "")
let l:group = l:default_group
for l:j in g:org_todo_keyword_faces
if l:j[0] == l:_i
let l:group = 'orgtodo_todo_keyword_face_' . l:_i
call OrgExtendHighlightingGroup(l:default_group, l:group, OrgInterpretFaces(l:j[1]))
break
endif
endfor
silent! exec 'syntax match orgtodo_todo_keyword_' . l:_i . ' /' . l:_i .'/ ' . a:todo_headings
silent! exec 'hi def link orgtodo_todo_keyword_' . l:_i . ' ' . l:group
endfor
endfunction
endif
call s:ReadTodoKeywords(g:org_todo_keywords, s:todo_headings)
unlet! s:todo_headings
endif

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

231
syntax/pony.vim Normal file
View File

@@ -0,0 +1,231 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pony') == -1
" Vim syntax file
" Language: Pony
" Maintainer: Jak Wings
if exists('b:current_syntax')
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn case match
syn sync match ponySync grouphere NONE /\v^\s*%(actor|class|struct|primitive|trait|interface|new|be|fun|let|var|embed|use)>/
syn match ponyErrSymbol /['^!$&\`]/
hi def link ponyErrSymbol Error
syn match ponyErrNumGroup /__\+/ contained
hi def link ponyErrNumGroup Error
syn match ponyPeriodComma /,/ nextgroup=ponyEllipsis,ponyErrOperator skipwhite
syn match ponyPeriodComma /\./ nextgroup=ponyTupleIndex,ponyErrOperator skipwhite
syn match ponyPeriodComma /;/ nextgroup=ponyErrOperator skipwhite
hi def link ponyPeriodComma Operator
syn match ponyBracket /[{[()\]}]/
syn match ponyErrNormal /\v_>|<%([^_a-z]|_[^a-z])|__+/ contained
hi def link ponyErrNormal Error
syn match ponyNormal /\v_?[_a-z]\w*'*/ contains=ponyErrNormal nextgroup=ponyGeneric skipwhite
syn match ponyInteger /\v%(\d+_*)+/ contains=ponyErrNumGroup
syn match ponyErrIntDec /\v(0[xX])@<=[_.g-zG-Z]/
syn match ponyErrIntHex /[.g-zG-Z]/ contained
syn match ponyInteger /\v0[xX]%(\x+_*)+/ contains=ponyErrNumGroup nextgroup=ponyErrIntHex
syn match ponyErrIntDec /\v(0[bB])@<=[_2-9a-zA-Z]/
syn match ponyErrIntBin /[2-9.a-zA-Z]/ contained
syn match ponyInteger /\v0[bB]%([01]+_*)+/ contains=ponyErrNumGroup nextgroup=ponyErrIntBin
hi def link ponyErrIntDec Error
hi def link ponyErrIntHex Error
hi def link ponyErrIntBin Error
hi def link ponyInteger Number
syn match ponyFloat /\v%(\d+_*)+[eE][-+]?%(\d+_*)+/ contains=ponyErrNumGroup
syn match ponyFloat /\v%(\d+_*)+\.%(\d+_*)+%([eE][-+]?%(\d+_*)+)?/ contains=ponyErrNumGroup
hi def link ponyFloat Float
syn match ponyErrUserVariable /\v_>|<%([^_a-z]|_[^a-z])|__+/ contained
hi def link ponyErrUserVariable Error
syn match ponyUserVariable /\v[_a-zA-Z]\w*'*/ contained contains=ponyErrUserVariable
hi def link ponyUserVariable Identifier
syn match ponyErrUserPackage /\<[^a-z]/ contained
hi def link ponyErrUserPackage Error
syn match ponyUserPackage /\v[_a-zA-Z]\w*/ contained contains=ponyErrUserPackage
hi def link ponyUserPackage Identifier
syn match ponyErrUserType /\v_>|\a@<=_|<%([^_A-Z]|_[^A-Z])/ contained
hi def link ponyErrUserType Error
syn match ponyUserType2 /\v[_a-zA-Z]\w*/ contained contains=ponyErrUserType nextgroup=ponyTypeSuffix,ponyTypeOperator2,ponyKwOperatorT,ponyGeneric,ponyArgument skipwhite
syn match ponyUserType /\v_?[A-Z]\w*/ contains=ponyErrUserType nextgroup=ponyTypeSuffix,ponyTypeOperator2,ponyKwOperatorT,ponyGeneric,ponyArgument skipwhite
syn match ponyErrUserMethod /\v_>|<%([^_a-z]|_[^a-z])|__+/ contained
hi def link ponyErrUserMethod Error
syn match ponyUserMethod /\v[_a-zA-Z]\w*/ contained contains=ponyErrUserMethod nextgroup=ponyGeneric,ponyArgument,ponyBracketT2 skipwhite
hi def link ponyUserMethod Function
syn match ponyForeignFunction /\v[_a-zA-Z]\w*/ contained nextgroup=ponyGeneric skipwhite
hi def link ponyForeignFunction Macro
syn match ponyErrTupleIndex /\v_0+>/ contained
hi def link ponyErrTupleIndex Error
syn match ponyTupleIndex /\v_\d+\w@!/ contained contains=ponyErrTupleIndex
hi def link ponyTupleIndex Normal
syn keyword ponyBoolean true false
hi def link ponyBoolean Boolean
syn region ponyBracketT1 matchgroup=ponyBracket start=/(/ end=/)/ contained contains=@ponyComments,@ponyKeyword,@ponyType,@ponyBracketT,@ponyTypeOperator,ponySymbol,ponyPeriodComma nextgroup=ponyTypeSuffix,ponyTypeOperator2,ponyKwOperatorT,ponyArgument skipwhite
syn region ponyBracketT2 matchgroup=ponyBracket start=/\[/ end=/\]/ contained contains=@ponyComments,@ponyKeyword,@ponyType,@ponyBracketT,@ponyTypeOperator,ponySymbol,ponyPeriodComma nextgroup=ponyTypeSuffix,ponyTypeOperator2,ponyKwOperatorT,ponyArgument skipwhite
syn region ponyBracketT3 matchgroup=ponyBracket start=/{/ end=/}/ contained contains=@ponyComments,@ponyKeyword,@ponyType,@ponyBracketT,@ponyTypeOperator,ponySymbol,ponyPeriodComma nextgroup=ponyTypeSuffix,ponyTypeOperator2,ponyKwOperatorT,ponyArgument skipwhite
syn cluster ponyBracketT contains=ponyBracketT\d
syn region ponyGeneric matchgroup=ponyBracketT2 start=/\[/ end=/\]/ contained contains=@ponyComments,@ponyKeyword,@ponyType,@ponyBracketT,@ponyTypeOperator,ponySymbol,ponyPeriodComma nextgroup=ponyTypeSuffix,ponyTypeOperator2,ponyKwOperatorT,ponyArgument skipwhite
syn region ponyArgument matchgroup=ponyBracket start=/(/ end=/)/ contained contains=TOP nextgroup=ponyArgument skipwhite
syn match ponyTypeSuffix /[!^]/ contained nextgroup=ponyArgument,ponyKwOperatorT skipwhite
hi def link ponyTypeSuffix StorageClass
syn match ponyTypeOperator1 /[&|]/ contained nextgroup=@ponyBracketT,@ponyKeyword,@ponyType skipwhite skipempty
hi def link ponyTypeOperator1 Operator
syn match ponyTypeOperator2 /->\|<:/ contained nextgroup=@ponyBracketT,@ponyKeyword,@ponyType skipwhite skipempty
hi def link ponyTypeOperator2 Operator
syn cluster ponyTypeOperator contains=ponyTypeOperator\d
syn match ponyErrOperator /[-.]>\|<:\|\%(==\|!=\|<<\|>>\|<=\|>=\|[+*/%<>]\)\~\?\|[~.,]/ contained nextgroup=ponyErrOperator skipwhite
hi def link ponyErrOperator Error
syn match ponyObjectOperator /\%(==\|!=\|<<\|>>\|<=\|>=\|[+\-*/%<>]\)\~\?\|\~\|\.>/ nextgroup=ponyErrOperator skipwhite
hi def link ponyObjectOperator Operator
syn keyword ponyKwOperatorT is contained nextgroup=@ponyBracketT,@ponyKeyword,@ponyType skipwhite skipempty
hi def link ponyKwOperatorT Operator
syn keyword ponyKwOperator as nextgroup=@ponyBracketT,@ponyKeyword,@ponyType skipwhite skipempty
syn keyword ponyKwOperator and or xor not is isnt consume addressof digestof
hi def link ponyKwOperator Operator
syn match ponySymbol /=>\|[?#]/
syn match ponySymbol /@/ nextgroup=ponyForeignFunction skipwhite skipempty
syn match ponySymbol /:/ nextgroup=@ponyKeyword,@ponyType,@ponyBracketT skipwhite skipempty
hi def link ponySymbol Special
syn match ponyEllipsis /\.\{3}/ contained containedin=ponyArgument
hi def link ponyEllipsis Special
syn region ponyLambda matchgroup=ponyBracketLambda start=/{/ end=/}/ contains=ponyArgument,@ponyComments,@ponyKeyword,@ponyType,@ponyTypeOperator,ponySymbol,ponyPeriodComma,ponyLambdaBody nextgroup=ponyArgument skipwhite
syn match ponyLambdaBody /=>\_.*}/me=e-1 contained contains=TOP
hi def link ponyBracketLambda Special
" $scripts/gen_id.sh $packages/builtin
syn keyword ponyBuiltinType AmbientAuth Any Array ArrayKeys ArrayPairs
\ ArrayValues AsioEvent AsioEventID
\ AsioEventNotify Bool ByteSeq ByteSeqIter
\ Comparable Compare DisposableActor
\ DoNotOptimise Env Equal Equatable F32 F64
\ Float FloatingPoint Greater HasEq I128 I16 I32
\ I64 I8 ILong ISize Int Integer Iterator Less
\ MaybePointer None Number OutStream Platform
\ Pointer ReadElement ReadSeq Real Seq Signed
\ SourceLoc StdStream Stdin StdinNotify String
\ StringBytes StringRunes Stringable U128 U16
\ U32 U64 U8 ULong USize Unsigned
\ nextgroup=ponyTypeSuffix,ponyTypeOperator2,ponyKwOperatorT,ponyGeneric,ponyArgument skipwhite
hi def link ponyBuiltinType Type
syn keyword ponyKwControl end if else do then elseif match while for in
\ repeat until ifdef try with recover return
\ break continue error compile_intrinsic
\ compile_error iftype elseiftype
hi def link ponyKwControl Keyword
syn keyword ponyCaseGuard if contained containedin=ponyMatchCase
hi def link ponyCaseGuard Keyword
syn region ponyMatchCase matchgroup=ponyKwBranchHead start=/|/ matchgroup=ponySymbol end=/=>/ contains=TOP
hi def link ponyKwBranchHead Keyword
syn keyword ponyKwAtom this nextgroup=ponyTypeOperator2 skipwhite skipempty
syn keyword ponyKwAtom object __loc
syn keyword ponyKwAtom lambda nextgroup=ponyArgument skipwhite
hi def link ponyKwAtom Keyword
syn keyword ponyKwField let var embed nextgroup=@ponyKeyword,ponyUserVariable skipwhite skipempty
hi def link ponyKwField Keyword
syn keyword ponyKwUse use nextgroup=ponyString,@ponyKeyword,ponyUserPackage skipwhite skipempty
hi def link ponyKwUse Include
syn keyword ponyKwWhere where
hi def link ponyKwWhere Keyword
syn keyword ponyKwTypedef type nextgroup=@ponyKeyword,@ponyType2 skipwhite skipempty
hi def link ponyKwTypedef Typedef
syn match ponyKwCapability /\v#%(read|send|share|alias|any)>/ nextgroup=ponyTypeSuffix,ponyTypeOperator2,ponyKwOperatorT skipwhite
syn keyword ponyKwCapability ref val tag iso box trn nextgroup=ponyTypeSuffix,ponyTypeOperator2,ponyKwOperatorT,ponyArgument skipwhite
hi def link ponyKwCapability StorageClass
syn keyword ponyKwClass actor class struct primitive trait interface nextgroup=@ponyKeyword,@ponyType2 skipwhite skipempty
hi def link ponyKwClass Structure
syn keyword ponyKwFnCapability ref val tag iso box trn contained nextgroup=@ponyKeyword,ponyUserMethod skipwhite skipempty
hi def link ponyKwFnCapability StorageClass
syn keyword ponyKwFunction new be fun nextgroup=ponyKwFnCapability,@ponyKeyword,ponyUserMethod skipwhite skipempty
hi def link ponyKwFunction Keyword
syn cluster ponyKeyword contains=ponyKw.*,ponyBoolean,ponyBuiltinType remove=ponyKwOperatorT,ponyKwFnCapability,ponyKwBranchHead
syn cluster ponyType contains=ponyBuiltinType,ponyUserType,ponyNormal
syn cluster ponyType2 contains=ponyBuiltinType,ponyUserType2
syn cluster ponyComments contains=ponyNestedComment,ponyComment
syn match ponyErrEscape /\\\_.\?\_s*/ contained
hi def link ponyErrEscape Error
syn match ponyEscapeSQuote /\\'/ contained
hi def link ponyEscapeSQuote SpecialChar
syn match ponyEscapeDQuote /\\"/ contained
hi def link ponyEscapeDQuote SpecialChar
syn match ponyEscape /\\[abefnrtv\\0]/ contained
syn match ponyEscape /\v\\x\x{2}/ contained
syn match ponyEscape /\v\\u\x{4}/ contained
syn match ponyEscape /\v\\U\x{6}/ contained
hi def link ponyEscape SpecialChar
syn region ponyCharacter matchgroup=ponyCharacterX start=/\w\@<!'/ skip=/\\./ end=/'/ contains=ponyEscapeSQuote,ponyEscape,ponyErrEscape
hi def link ponyCharacter Character
syn region ponyString matchgroup=ponyStringX start=/"/ skip=/\\./ end=/"/ contains=ponyEscapeDQuote,ponyEscape,ponyErrEscape
hi def link ponyString String
syn region ponyDocumentString matchgroup=ponyDocumentStringX start=/"\ze""/ end=/"""*\zs"/
hi def link ponyDocumentString String
syn keyword ponyCommentShit XXX contained
hi def link ponyCommentShit Underlined
syn keyword ponyCommentDamn FIXME contained
hi def link ponyCommentDamn Error
syn keyword ponyCommentTodo TODO contained
hi def link ponyCommentTodo Todo
syn cluster ponyCommentNote contains=ponyCommentTodo,ponyCommentDamn,ponyCommentShit
syn match ponyComment @//.*$@ contains=@ponyCommentNote,ponyCommentX
hi def link ponyComment Comment
syn region ponyNestedComment matchgroup=ponyNestedCommentX start=@/\ze\*@ end=@\/\@<!\*\zs/@ contains=ponyNestedComment,@ponyCommentNote keepend extend fold
hi def link ponyNestedComment Comment
" for indent check
syn match ponyCommentX @/\ze/.*$@ contained transparent
hi def link ponyNestedCommentX Comment
hi def link ponyCharacterX Character
hi def link ponyStringX String
hi def link ponyDocumentStringX String
let &cpo = s:cpo_save
unlet s:cpo_save
let b:current_syntax = 'pony'
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

282
syntax/rst.vim Normal file
View File

@@ -0,0 +1,282 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rst') == -1
" Vim syntax file
" Language: reStructuredText documentation format
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Website: https://github.com/marshallward/vim-restructuredtext
" Latest Revision: 2018-07-23
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn case ignore
syn match rstTransition /^[=`:.'"~^_*+#-]\{4,}\s*$/
syn cluster rstCruft contains=rstEmphasis,rstStrongEmphasis,
\ rstInterpretedText,rstInlineLiteral,rstSubstitutionReference,
\ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference
syn region rstLiteralBlock matchgroup=rstDelimiter
\ start='::\_s*\n\ze\z(\s\+\)' skip='^$' end='^\z1\@!'
\ contains=@NoSpell
syn region rstQuotedLiteralBlock matchgroup=rstDelimiter
\ start="::\_s*\n\ze\z([!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]\)"
\ end='^\z1\@!' contains=@NoSpell
syn region rstDoctestBlock oneline display matchgroup=rstDelimiter
\ start='^>>>\s' end='^$'
syn region rstTable transparent start='^\n\s*+[-=+]\+' end='^$'
\ contains=rstTableLines,@rstCruft
syn match rstTableLines contained display '|\|+\%(=\+\|-\+\)\='
syn region rstSimpleTable transparent
\ start='^\n\%(\s*\)\@>\%(\%(=\+\)\@>\%(\s\+\)\@>\)\%(\%(\%(=\+\)\@>\%(\s*\)\@>\)\+\)\@>$'
\ end='^$'
\ contains=rstSimpleTableLines,@rstCruft
syn match rstSimpleTableLines contained display
\ '^\%(\s*\)\@>\%(\%(=\+\)\@>\%(\s\+\)\@>\)\%(\%(\%(=\+\)\@>\%(\s*\)\@>\)\+\)\@>$'
syn match rstSimpleTableLines contained display
\ '^\%(\s*\)\@>\%(\%(-\+\)\@>\%(\s\+\)\@>\)\%(\%(\%(-\+\)\@>\%(\s*\)\@>\)\+\)\@>$'
syn cluster rstDirectives contains=rstFootnote,rstCitation,
\ rstHyperlinkTarget,rstExDirective
syn match rstExplicitMarkup '^\s*\.\.\_s'
\ nextgroup=@rstDirectives,rstComment,rstSubstitutionDefinition
" "Simple reference names are single words consisting of alphanumerics plus
" isolated (no two adjacent) internal hyphens, underscores, periods, colons
" and plus signs."
let s:ReferenceName = '[[:alnum:]]\%([-_.:+]\?[[:alnum:]]\+\)*'
syn keyword rstTodo contained FIXME TODO XXX NOTE
execute 'syn region rstComment contained' .
\ ' start=/.*/'
\ ' skip=+^$+' .
\ ' end=/^\s\@!/ contains=rstTodo'
execute 'syn region rstFootnote contained matchgroup=rstDirective' .
\ ' start=+\[\%(\d\+\|#\%(' . s:ReferenceName . '\)\=\|\*\)\]\_s+' .
\ ' skip=+^$+' .
\ ' end=+^\s\@!+ contains=@rstCruft,@NoSpell'
execute 'syn region rstCitation contained matchgroup=rstDirective' .
\ ' start=+\[' . s:ReferenceName . '\]\_s+' .
\ ' skip=+^$+' .
\ ' end=+^\s\@!+ contains=@rstCruft,@NoSpell'
syn region rstHyperlinkTarget contained matchgroup=rstDirective
\ start='_\%(_\|[^:\\]*\%(\\.[^:\\]*\)*\):\_s' skip=+^$+ end=+^\s\@!+
syn region rstHyperlinkTarget contained matchgroup=rstDirective
\ start='_`[^`\\]*\%(\\.[^`\\]*\)*`:\_s' skip=+^$+ end=+^\s\@!+
syn region rstHyperlinkTarget matchgroup=rstDirective
\ start=+^__\_s+ skip=+^$+ end=+^\s\@!+
execute 'syn region rstExDirective contained matchgroup=rstDirective' .
\ ' start=+' . s:ReferenceName . '::\_s+' .
\ ' skip=+^$+' .
\ ' end=+^\s\@!+ contains=@rstCruft,rstLiteralBlock'
execute 'syn match rstSubstitutionDefinition contained' .
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right)
execute 'syn region rst' . a:name .
\ ' start=+' . a:char_left . '\zs' . a:start .
\ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' .
\ a:middle .
\ ' end=+\S' . a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+'
endfunction
function! s:DefineInlineMarkup(name, start, middle, end)
let middle = a:middle != "" ?
\ (' skip=+\\\\\|\\' . a:middle . '+') :
\ ""
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'")
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '"', '"')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '(', ')')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '', '')
" TODO: Additional Unicode Pd, Po, Pi, Pf, Ps characters
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|\%ua0\|[/:]\)', '')
execute 'syn match rst' . a:name .
\ ' +\%(^\|\s\|\%ua0\|[''"([{</:]\)\zs' . a:start .
\ '[^[:space:]' . a:start[strlen(a:start) - 1] . ']'
\ a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+'
execute 'hi def link rst' . a:name . 'Delimiter' . ' rst' . a:name
endfunction
call s:DefineInlineMarkup('Emphasis', '\*', '\*', '\*')
call s:DefineInlineMarkup('StrongEmphasis', '\*\*', '\*', '\*\*')
call s:DefineInlineMarkup('InterpretedTextOrHyperlinkReference', '`', '`', '`_\{0,2}')
call s:DefineInlineMarkup('InlineLiteral', '``', "", '``')
call s:DefineInlineMarkup('SubstitutionReference', '|', '|', '|_\{0,2}')
call s:DefineInlineMarkup('InlineInternalTargets', '_`', '`', '`')
" Sections are identified through their titles, which are marked up with
" adornment: "underlines" below the title text, or underlines and matching
" "overlines" above the title. An underline/overline is a single repeated
" punctuation character that begins in column 1 and forms a line extending at
" least as far as the right edge of the title text.
"
" It is difficult to count characters in a regex, but we at least special-case
" the case where the title has at least three characters to require the
" adornment to have at least three characters as well, in order to handle
" properly the case of a literal block:
"
" this is the end of a paragraph
" ::
" this is a literal block
syn match rstSections "\v^%(([=`:.'"~^_*+#-])\1+\n)?.{1,2}\n([=`:.'"~^_*+#-])\2+$"
\ contains=@Spell
syn match rstSections "\v^%(([=`:.'"~^_*+#-])\1{2,}\n)?.{3,}\n([=`:.'"~^_*+#-])\2{2,}$"
\ contains=@Spell
" TODO: Cant remember why these two cant be defined like the ones above.
execute 'syn match rstFootnoteReference contains=@NoSpell' .
\ ' +\%(\s\|^\)\[\%(\d\+\|#\%(' . s:ReferenceName . '\)\=\|\*\)\]_+'
execute 'syn match rstCitationReference contains=@NoSpell' .
\ ' +\%(\s\|^\)\[' . s:ReferenceName . '\]_\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+'
execute 'syn match rstHyperlinkReference' .
\ ' /\<' . s:ReferenceName . '__\=\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)/'
syn match rstStandaloneHyperlink contains=@NoSpell
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
syn region rstCodeBlock contained matchgroup=rstDirective
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\s\+.*\_s*\n\ze\z(\s\+\)+
\ skip=+^$+
\ end=+^\z1\@!+
\ contains=@NoSpell
syn cluster rstDirectives add=rstCodeBlock
if !exists('g:rst_syntax_code_list')
" A mapping from a Vim filetype to a list of alias patterns (pattern
" branches to be specific, see ':help /pattern'). E.g. given:
"
" let g:rst_syntax_code_list = {
" \ 'cpp': ['cpp', 'c++'],
" \ }
"
" then the respective contents of the following two rST directives:
"
" .. code:: cpp
"
" auto i = 42;
"
" .. code:: C++
"
" auto i = 42;
"
" will both be highlighted as C++ code. As shown by the latter block
" pattern matching will be case-insensitive.
let g:rst_syntax_code_list = {
\ 'vim': ['vim'],
\ 'java': ['java'],
\ 'cpp': ['cpp', 'c++'],
\ 'lisp': ['lisp'],
\ 'php': ['php'],
\ 'python': ['python'],
\ 'perl': ['perl'],
\ 'sh': ['sh'],
\ }
elseif type(g:rst_syntax_code_list) == type([])
" backward compatibility with former list format
let s:old_spec = g:rst_syntax_code_list
let g:rst_syntax_code_list = {}
for s:elem in s:old_spec
let g:rst_syntax_code_list[s:elem] = [s:elem]
endfor
endif
for s:filetype in keys(g:rst_syntax_code_list)
unlet! b:current_syntax
" guard against setting 'isk' option which might cause problems (issue #108)
let prior_isk = &l:iskeyword
let s:alias_pattern = ''
\.'\%('
\.join(g:rst_syntax_code_list[s:filetype], '\|')
\.'\)'
exe 'syn include @rst'.s:filetype.' syntax/'.s:filetype.'.vim'
exe 'syn region rstDirective'.s:filetype
\.' matchgroup=rstDirective fold'
\.' start="\c\%(sourcecode\|code\%(-block\)\=\)::\s\+'.s:alias_pattern.'\_s*\n\ze\z(\s\+\)"'
\.' skip=#^$#'
\.' end=#^\z1\@!#'
\.' contains=@NoSpell,@rst'.s:filetype
exe 'syn cluster rstDirectives add=rstDirective'.s:filetype
" reset 'isk' setting, if it has been changed
if &l:iskeyword !=# prior_isk
let &l:iskeyword = prior_isk
endif
unlet! prior_isk
endfor
" Enable top level spell checking
syntax spell toplevel
" TODO: Use better syncing.
syn sync minlines=50 linebreaks=2
hi def link rstTodo Todo
hi def link rstComment Comment
hi def link rstSections Title
hi def link rstTransition rstSections
hi def link rstLiteralBlock String
hi def link rstQuotedLiteralBlock String
hi def link rstDoctestBlock PreProc
hi def link rstTableLines rstDelimiter
hi def link rstSimpleTableLines rstTableLines
hi def link rstExplicitMarkup rstDirective
hi def link rstDirective Keyword
hi def link rstFootnote String
hi def link rstCitation String
hi def link rstHyperlinkTarget String
hi def link rstExDirective String
hi def link rstSubstitutionDefinition rstDirective
hi def link rstDelimiter Delimiter
hi def link rstInterpretedTextOrHyperlinkReference Identifier
hi def link rstInlineLiteral String
hi def link rstSubstitutionReference PreProc
hi def link rstInlineInternalTargets Identifier
hi def link rstFootnoteReference Identifier
hi def link rstCitationReference Identifier
hi def link rstHyperLinkReference Identifier
hi def link rstStandaloneHyperlink Identifier
hi def link rstCodeBlock String
if exists('g:rst_use_emphasis_colors')
" TODO: Less arbitrary color selection
hi def rstEmphasis ctermfg=13 term=italic cterm=italic gui=italic
hi def rstStrongEmphasis ctermfg=1 term=bold cterm=bold gui=bold
else
hi def rstEmphasis term=italic cterm=italic gui=italic
hi def rstStrongEmphasis term=bold cterm=bold gui=bold
endif
let b:current_syntax = "rst"
let &cpo = s:cpo_save
unlet s:cpo_save
endif

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