mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Update
This commit is contained in:
@@ -126,7 +126,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [log](https://github.com/MTDL9/vim-log-highlighting) (Syntax highlighting for log and LOG files)
|
||||
- [lua](https://github.com/tbastos/vim-lua) (Lua syntax highlighting for lua, fcgi, nse, p8, rbxs, rockspec and wlua files)
|
||||
- [mako](https://github.com/sophacles/vim-bundle-mako) (Mako syntax highlighting for mako and mao files)
|
||||
- [markdown](https://github.com/plasticboy/vim-markdown) (Markdown syntax highlighting for md, markdown, mdown, mdwn, mkd, mkdn, mkdown, ronn and workbook files)
|
||||
- [markdown](https://github.com/plasticboy/vim-markdown) (Markdown syntax highlighting for md, markdown, mdown, mdwn, mkd, mkdn, mkdown, ronn, scd and workbook files)
|
||||
- [mathematica](https://github.com/voldikss/vim-mma) (Mathematica syntax highlighting for mathematica, cdf, m, ma, mt and 6 more files)
|
||||
- [mdx](https://github.com/jxnblk/vim-mdx-js) (Syntax highlighting for mdx files)
|
||||
- [meson](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim) (Meson syntax highlighting for wrap files)
|
||||
@@ -198,7 +198,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [velocity](https://github.com/lepture/vim-velocity) (Syntax highlighting for vm files)
|
||||
- [vue](https://github.com/posva/vim-vue) (Vue syntax highlighting for vue and wpy files)
|
||||
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (Syntax highlighting for xdc files)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axml and 94 more files)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axml and 95 more files)
|
||||
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting for xslt and xsl files)
|
||||
- [yard](https://github.com/noprompt/vim-yardoc)
|
||||
- [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files)
|
||||
|
||||
@@ -120,7 +120,7 @@ if !exists('cpp_no_cpp17')
|
||||
syntax keyword cppSTLnamespace filesystem execution string_view_literals
|
||||
|
||||
syntax keyword cppSTLtype
|
||||
\ any is_execution_policy parallel_policy parallel_unsequenced_policy sequenced_policy directory_entry directory_iterator file_status file_time_type path recursive_directory_iterator space_info default_order default_searcher boyer_moore_searcher boyer_moore_horspool_searcher memory_resource monotonic_buffer_resource polymorphic_allocator pool_options synchronized_pool_resource unsynchronized_pool_resource scoped_lock optional shared_mutex basic_string_view string_view u16string_view u32string_view wstring_view bool_constant conjunction disjunction has_unique_object_representations invoke_result is_aggregate is_callable is_invocable is_invocable_r is_nothrow_invocable is_nothrow_invocable_r is_nothrow_swappable is_nothrow_swappable_with is_nowthrow_callable is_swappable is_swappable_with negation node_type insert_return_type in_place_tag monostate variant variant_size variant_alternative
|
||||
\ any byte is_execution_policy parallel_policy parallel_unsequenced_policy sequenced_policy directory_entry directory_iterator file_status file_time_type path recursive_directory_iterator space_info default_order default_searcher boyer_moore_searcher boyer_moore_horspool_searcher memory_resource monotonic_buffer_resource polymorphic_allocator pool_options synchronized_pool_resource unsynchronized_pool_resource scoped_lock optional shared_mutex basic_string_view string_view u16string_view u32string_view wstring_view bool_constant conjunction disjunction has_unique_object_representations invoke_result is_aggregate is_callable is_invocable is_invocable_r is_nothrow_invocable is_nothrow_invocable_r is_nothrow_swappable is_nothrow_swappable_with is_nowthrow_callable is_swappable is_swappable_with negation node_type insert_return_type in_place_tag monostate variant variant_size variant_alternative
|
||||
|
||||
syntax keyword cppSTLtypedef
|
||||
\ invoke_result_t default_order_t nullopt_t void_t in_place_t in_place_type_t in_place_index_t variant_alternative_t
|
||||
|
||||
@@ -215,6 +215,10 @@ function! go#config#DebugWindows() abort
|
||||
|
||||
endfunction
|
||||
|
||||
function! go#config#DebugPreserveLayout() abort
|
||||
return get(g:, 'go_debug_preserve_layout', 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#DebugAddress() abort
|
||||
return get(g:, 'go_debug_address', '127.0.0.1:8181')
|
||||
endfunction
|
||||
|
||||
@@ -2257,7 +2257,7 @@ if !has_key(g:polyglot_is_disabled, 'jq')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'htmldjango')
|
||||
au BufNewFile,BufRead *.j2,*.jinja,*.jinja2,*.njk setf htmldjango
|
||||
au BufNewFile,BufRead *.j2,*.jinja,*.jinja2 setf htmldjango
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'jenkins')
|
||||
@@ -2473,7 +2473,7 @@ if !has_key(g:polyglot_is_disabled, 'coffee-script')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'markdown')
|
||||
au BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.workbook,contents.lr setf markdown
|
||||
au BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr setf markdown
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'cmake')
|
||||
@@ -2592,7 +2592,7 @@ if !has_key(g:polyglot_is_disabled, 'ant')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'xml')
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mm,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mm,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rs,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'csv')
|
||||
|
||||
@@ -233,7 +233,7 @@ let s:globs = {
|
||||
\ 'html.handlebars': '*.handlebars,*.hbs,*.hdbs,*.hb',
|
||||
\ 'html.mustache': '*.mustache,*.hogan,*.hulk,*.hjs',
|
||||
\ 'html.twig': '*.twig',
|
||||
\ 'htmldjango': '*.jinja,*.j2,*.jinja2,*.njk',
|
||||
\ 'htmldjango': '*.jinja,*.j2,*.jinja2',
|
||||
\ 'htmlm4': '*.html.m4',
|
||||
\ 'httest': '*.htt,*.htb',
|
||||
\ 'i3config': '*.i3.config,*.i3config,i3.config,i3config,.i3.config,.i3config',
|
||||
@@ -263,7 +263,7 @@ let s:globs = {
|
||||
\ 'jovial': '*.jov,*.j73,*.jovial',
|
||||
\ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*',
|
||||
\ 'jq': '*.jq,.jqrc,.jqrc*',
|
||||
\ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.htmlhintrc,.tern-config,.tern-project,.watchmanconfig,composer.lock,mcmod.info,Pipfile.lock',
|
||||
\ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.htmlhintrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info',
|
||||
\ 'json5': '*.json5',
|
||||
\ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json',
|
||||
\ 'jsonnet': '*.jsonnet,*.libsonnet',
|
||||
@@ -321,7 +321,7 @@ let s:globs = {
|
||||
\ 'manconf': 'man.config',
|
||||
\ 'map': '*.map',
|
||||
\ 'maple': '*.mv,*.mpl,*.mws',
|
||||
\ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.workbook,contents.lr',
|
||||
\ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr',
|
||||
\ 'markdown.mdx': '*.mdx',
|
||||
\ 'mason': '*.mason,*.mhtml,*.comp',
|
||||
\ 'master': '*.mas,*.master',
|
||||
@@ -436,7 +436,7 @@ let s:globs = {
|
||||
\ 'racket': '*.rkt,*.rktd,*.rktl,*.scrbl',
|
||||
\ 'radiance': '*.rad,*.mat',
|
||||
\ 'ragel': '*.rl',
|
||||
\ 'raku': '*.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl,*.pl6,*.pm,*.pm6,*.t,*.rakudoc,*.rakutest,*.raku,*.rakumod,*.pod6,*.t6',
|
||||
\ 'raku': '*.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl,*.pl6,*.pm,*.pm6,*.raku,*.rakumod,*.t,*.rakudoc,*.rakutest,*.pod6,*.t6',
|
||||
\ 'raml': '*.raml',
|
||||
\ 'ratpoison': '.ratpoisonrc,ratpoisonrc',
|
||||
\ 'razor': '*.cshtml,*.razor',
|
||||
@@ -553,7 +553,7 @@ let s:globs = {
|
||||
\ 'tilde': '*.t.html',
|
||||
\ 'tli': '*.tli',
|
||||
\ 'tmux': '.tmux*.conf',
|
||||
\ 'toml': '*.toml,Cargo.lock,Gopkg.lock,poetry.lock,Pipfile',
|
||||
\ 'toml': '*.toml,Cargo.lock,Gopkg.lock,Pipfile,poetry.lock',
|
||||
\ 'tpp': '*.tpp',
|
||||
\ 'tptp': '*.p,*.tptp,*.ax',
|
||||
\ 'trasys': '*.inp',
|
||||
@@ -612,7 +612,7 @@ let s:globs = {
|
||||
\ 'xhtml': '*.xhtml,*.xht',
|
||||
\ 'xinetd': '',
|
||||
\ 'xmath': '*.msc,*.msf',
|
||||
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mm,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc',
|
||||
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mm,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rs,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc',
|
||||
\ 'xml.twig': '*.xml.twig',
|
||||
\ 'xmodmap': '*Xmodmap,*xmodmap*',
|
||||
\ 'xpm': '*.xpm,*.pm',
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'zig', 'autoload/zig/config.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! zig#config#ListTypeCommands() abort
|
||||
return get(g:, 'zig_list_type_commands', {})
|
||||
endfunction
|
||||
|
||||
function! zig#config#ListType() abort
|
||||
return get(g:, 'zig_list_type', '')
|
||||
endfunction
|
||||
|
||||
function! zig#config#ListAutoclose() abort
|
||||
return get(g:, 'zig_list_autoclose', 1)
|
||||
endfunction
|
||||
|
||||
function! zig#config#ListHeight() abort
|
||||
return get(g:, "zig_list_height", 0)
|
||||
endfunction
|
||||
|
||||
function! zig#config#FmtAutosave() abort
|
||||
return get(g:, "zig_fmt_autosave", 0)
|
||||
endfunction
|
||||
|
||||
function! zig#config#SetFmtAutosave(value) abort
|
||||
let g:zig_fmt_autosave = a:value
|
||||
endfunction
|
||||
|
||||
function! zig#config#FmtCommand() abort
|
||||
return get(g:, "zig_fmt_command", ['zig', 'fmt', '--color', 'off'])
|
||||
endfunction
|
||||
|
||||
function! zig#config#FmtFailSilently() abort
|
||||
return get(g:, "zig_fmt_fail_silently", 0)
|
||||
endfunction
|
||||
|
||||
function! zig#config#FmtExperimental() abort
|
||||
return get(g:, "zig_fmt_experimental", 0)
|
||||
endfunction
|
||||
|
||||
function! zig#config#Debug() abort
|
||||
return get(g:, 'zig_debug', [])
|
||||
endfunction
|
||||
@@ -7,127 +7,70 @@ endif
|
||||
" Copyright 2011 The Go Authors. All rights reserved.
|
||||
" Use of this source code is governed by a BSD-style
|
||||
" license that can be found in the LICENSE file.
|
||||
"
|
||||
|
||||
function! zig#fmt#Format() abort
|
||||
if zig#config#FmtExperimental()
|
||||
" Using winsaveview to save/restore cursor state has the problem of
|
||||
" closing folds on save:
|
||||
" https://github.com/fatih/vim-go/issues/502
|
||||
" One fix is to use mkview instead. Unfortunately, this sometimes causes
|
||||
" other bad side effects:
|
||||
" https://github.com/fatih/vim-go/issues/728
|
||||
" and still closes all folds if foldlevel>0:
|
||||
" https://github.com/fatih/vim-go/issues/732
|
||||
let l:curw = {}
|
||||
try
|
||||
mkview!
|
||||
catch
|
||||
let l:curw = winsaveview()
|
||||
endtry
|
||||
|
||||
" save our undo file to be restored after we are done. This is needed to
|
||||
" prevent an additional undo jump due to BufWritePre auto command and also
|
||||
" restore 'redo' history because it's getting being destroyed every
|
||||
" BufWritePre
|
||||
let tmpundofile = tempname()
|
||||
exe 'wundo! ' . tmpundofile
|
||||
else
|
||||
" Save cursor position and many other things.
|
||||
let l:curw = winsaveview()
|
||||
endif
|
||||
let view = winsaveview()
|
||||
|
||||
" Save cursor position and many other things.
|
||||
let l:curw = winsaveview()
|
||||
let current_buf = bufnr('')
|
||||
|
||||
let bin_name = zig#config#FmtCommand()
|
||||
let bin_path = get(g:, 'zig_bin_path', 'zig')
|
||||
let stderr_file = tempname()
|
||||
let cmdline = printf('%s fmt --stdin 2> %s', bin_path, stderr_file)
|
||||
|
||||
" Get current position in file
|
||||
let current_col = col('.')
|
||||
let orig_line_count = line('$')
|
||||
|
||||
" Save current buffer first, else fmt will run on the original file and we
|
||||
" will lose our changes.
|
||||
silent! execute 'write' expand('%')
|
||||
|
||||
let [l:out, l:err] = zig#fmt#run(bin_name, expand('%'))
|
||||
|
||||
if l:err == 0
|
||||
call zig#fmt#update_file(expand('%'))
|
||||
elseif !zig#config#FmtFailSilently()
|
||||
let errors = s:parse_errors(expand('%'), out)
|
||||
call s:show_errors(errors)
|
||||
endif
|
||||
|
||||
let diff_offset = line('$') - orig_line_count
|
||||
|
||||
if zig#config#FmtExperimental()
|
||||
" restore our undo history
|
||||
silent! exe 'rundo ' . tmpundofile
|
||||
call delete(tmpundofile)
|
||||
|
||||
" Restore our cursor/windows positions, folds, etc.
|
||||
if empty(l:curw)
|
||||
silent! loadview
|
||||
" The formatted code is output on stdout, the errors go on stderr.
|
||||
if exists('*systemlist')
|
||||
silent let out = systemlist(cmdline, current_buf)
|
||||
else
|
||||
call winrestview(l:curw)
|
||||
silent let out = split(system(cmdline, current_buf))
|
||||
endif
|
||||
else
|
||||
" Restore our cursor/windows positions.
|
||||
call winrestview(l:curw)
|
||||
let err = v:shell_error
|
||||
|
||||
if err == 0
|
||||
" remove undo point caused via BufWritePre.
|
||||
try | silent undojoin | catch | endtry
|
||||
|
||||
" Replace the file content with the formatted version.
|
||||
call deletebufline(current_buf, len(out), line('$'))
|
||||
call setline(1, out)
|
||||
|
||||
" No errors detected, close the loclist.
|
||||
call setloclist(0, [], 'r')
|
||||
lclose
|
||||
elseif get(g:, 'zig_fmt_parse_errors', 1)
|
||||
let errors = s:parse_errors(expand('%'), readfile(stderr_file))
|
||||
|
||||
call setloclist(0, [], 'r', {
|
||||
\ 'title': 'Errors',
|
||||
\ 'items': errors,
|
||||
\ })
|
||||
|
||||
let max_win_height = get(g:, 'zig_fmt_max_window_height', 5)
|
||||
" Prevent the loclist from becoming too long.
|
||||
let win_height = min([max_win_height, len(errors)])
|
||||
" Open the loclist, but only if there's at least one error to show.
|
||||
execute 'lwindow ' . win_height
|
||||
endif
|
||||
|
||||
" be smart and jump to the line the new statement was added/removed
|
||||
call cursor(line('.') + diff_offset, current_col)
|
||||
call delete(stderr_file)
|
||||
|
||||
" Syntax highlighting breaks less often.
|
||||
call winrestview(view)
|
||||
|
||||
if err != 0
|
||||
echohl Error | echomsg "zig fmt returned error" | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
" Run the syntax highlighter on the updated content and recompute the folds if
|
||||
" needed.
|
||||
syntax sync fromstart
|
||||
endfunction
|
||||
|
||||
" update_file updates the target file with the given formatted source
|
||||
function! zig#fmt#update_file(target)
|
||||
" remove undo point caused via BufWritePre
|
||||
try | silent undojoin | catch | endtry
|
||||
|
||||
" reload buffer to reflect latest changes
|
||||
silent edit!
|
||||
|
||||
let l:listtype = zig#list#Type("ZigFmt")
|
||||
|
||||
" the title information was introduced with 7.4-2200
|
||||
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
|
||||
if has('patch-7.4.2200')
|
||||
" clean up previous list
|
||||
if l:listtype == "quickfix"
|
||||
let l:list_title = getqflist({'title': 1})
|
||||
else
|
||||
let l:list_title = getloclist(0, {'title': 1})
|
||||
endif
|
||||
else
|
||||
" can't check the title, so assume that the list was for go fmt.
|
||||
let l:list_title = {'title': 'Format'}
|
||||
endif
|
||||
|
||||
if has_key(l:list_title, "title") && l:list_title['title'] == "Format"
|
||||
call zig#list#Clean(l:listtype)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" run runs the gofmt/goimport command for the given source file and returns
|
||||
" the output of the executed command. Target is the real file to be formatted.
|
||||
function! zig#fmt#run(bin_name, target)
|
||||
let l:cmd = []
|
||||
call extend(cmd, a:bin_name)
|
||||
call extend(cmd, [a:target])
|
||||
return zig#util#Exec(l:cmd)
|
||||
endfunction
|
||||
|
||||
" parse_errors parses the given errors and returns a list of parsed errors
|
||||
function! s:parse_errors(filename, content) abort
|
||||
let splitted = split(a:content, '\n')
|
||||
|
||||
function! s:parse_errors(filename, lines) abort
|
||||
" list of errors to be put into location list
|
||||
let errors = []
|
||||
for line in splitted
|
||||
for line in a:lines
|
||||
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)')
|
||||
if !empty(tokens)
|
||||
call add(errors,{
|
||||
@@ -141,30 +84,4 @@ function! s:parse_errors(filename, content) abort
|
||||
|
||||
return errors
|
||||
endfunction
|
||||
|
||||
" show_errors opens a location list and shows the given errors. If the given
|
||||
" errors is empty, it closes the the location list
|
||||
function! s:show_errors(errors) abort
|
||||
let l:listtype = zig#list#Type("ZigFmt")
|
||||
if !empty(a:errors)
|
||||
call zig#list#Populate(l:listtype, a:errors, 'Format')
|
||||
echohl Error | echomsg "zig fmt returned error" | echohl None
|
||||
endif
|
||||
|
||||
" this closes the window if there are no errors or it opens
|
||||
" it if there is any
|
||||
call zig#list#Window(l:listtype, len(a:errors))
|
||||
endfunction
|
||||
|
||||
function! zig#fmt#ToggleFmtAutoSave() abort
|
||||
if zig#config#FmtAutosave()
|
||||
call zig#config#SetFmtAutosave(0)
|
||||
call zig#util#EchoProgress("auto fmt disabled")
|
||||
return
|
||||
end
|
||||
|
||||
call zig#config#SetFmtAutosave(1)
|
||||
call zig#util#EchoProgress("auto fmt enabled")
|
||||
endfunction
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'zig', 'autoload/zig/list.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Adapted from fatih/vim-go: autoload/go/list.vim
|
||||
"
|
||||
" Copyright 2011 The Go Authors. All rights reserved.
|
||||
" Use of this source code is governed by a BSD-style
|
||||
" license that can be found in the LICENSE file.
|
||||
"
|
||||
|
||||
" Window opens the list with the given height up to 10 lines maximum.
|
||||
" Otherwise g:zig_loclist_height is used.
|
||||
"
|
||||
" If no or zero height is given it closes the window by default.
|
||||
" To prevent this, set g:zig_list_autoclose = 0
|
||||
function! zig#list#Window(listtype, ...) abort
|
||||
" we don't use lwindow to close the location list as we need also the
|
||||
" ability to resize the window. So, we are going to use lopen and lclose
|
||||
" for a better user experience. If the number of errors in a current
|
||||
" location list increases/decreases, cwindow will not resize when a new
|
||||
" updated height is passed. lopen in the other hand resizes the screen.
|
||||
if !a:0 || a:1 == 0
|
||||
call zig#list#Close(a:listtype)
|
||||
return
|
||||
endif
|
||||
|
||||
let height = zig#config#ListHeight()
|
||||
if height == 0
|
||||
" prevent creating a large location height for a large set of numbers
|
||||
if a:1 > 10
|
||||
let height = 10
|
||||
else
|
||||
let height = a:1
|
||||
endif
|
||||
endif
|
||||
|
||||
if a:listtype == "locationlist"
|
||||
exe 'lopen ' . height
|
||||
else
|
||||
exe 'copen ' . height
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
" Get returns the current items from the list
|
||||
function! zig#list#Get(listtype) abort
|
||||
if a:listtype == "locationlist"
|
||||
return getloclist(0)
|
||||
else
|
||||
return getqflist()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Populate populate the list with the given items
|
||||
function! zig#list#Populate(listtype, items, title) abort
|
||||
if a:listtype == "locationlist"
|
||||
call setloclist(0, a:items, 'r')
|
||||
|
||||
" The last argument ({what}) is introduced with 7.4.2200:
|
||||
" https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
|
||||
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
|
||||
else
|
||||
call setqflist(a:items, 'r')
|
||||
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Parse parses the given items based on the specified errorformat and
|
||||
" populates the list.
|
||||
function! zig#list#ParseFormat(listtype, errformat, items, title) abort
|
||||
" backup users errorformat, will be restored once we are finished
|
||||
let old_errorformat = &errorformat
|
||||
|
||||
" parse and populate the location list
|
||||
let &errorformat = a:errformat
|
||||
try
|
||||
call zig#list#Parse(a:listtype, a:items, a:title)
|
||||
finally
|
||||
"restore back
|
||||
let &errorformat = old_errorformat
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Parse parses the given items based on the global errorformat and
|
||||
" populates the list.
|
||||
function! zig#list#Parse(listtype, items, title) abort
|
||||
if a:listtype == "locationlist"
|
||||
lgetexpr a:items
|
||||
if has("patch-7.4.2200") | call setloclist(0, [], 'a', {'title': a:title}) | endif
|
||||
else
|
||||
cgetexpr a:items
|
||||
if has("patch-7.4.2200") | call setqflist([], 'a', {'title': a:title}) | endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" JumpToFirst jumps to the first item in the location list
|
||||
function! zig#list#JumpToFirst(listtype) abort
|
||||
if a:listtype == "locationlist"
|
||||
ll 1
|
||||
else
|
||||
cc 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Clean cleans and closes the location list
|
||||
function! zig#list#Clean(listtype) abort
|
||||
if a:listtype == "locationlist"
|
||||
lex []
|
||||
else
|
||||
cex []
|
||||
endif
|
||||
|
||||
call zig#list#Close(a:listtype)
|
||||
endfunction
|
||||
|
||||
" Close closes the location list
|
||||
function! zig#list#Close(listtype) abort
|
||||
let autoclose_window = zig#config#ListAutoclose()
|
||||
if !autoclose_window
|
||||
return
|
||||
endif
|
||||
|
||||
if a:listtype == "locationlist"
|
||||
lclose
|
||||
else
|
||||
cclose
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:listtype(listtype) abort
|
||||
let listtype = zig#config#ListType()
|
||||
if empty(listtype)
|
||||
return a:listtype
|
||||
endif
|
||||
|
||||
return listtype
|
||||
endfunction
|
||||
|
||||
" s:default_list_type_commands is the defaults that will be used for each of
|
||||
" the supported commands (see documentation for g:zig_list_type_commands). When
|
||||
" defining a default, quickfix should be used if the command operates on
|
||||
" multiple files, while locationlist should be used if the command operates on a
|
||||
" single file or buffer. Keys that begin with an underscore are not supported
|
||||
" in g:zig_list_type_commands.
|
||||
let s:default_list_type_commands = {
|
||||
\ "ZigFmt": "locationlist",
|
||||
\ }
|
||||
|
||||
function! zig#list#Type(for) abort
|
||||
let l:listtype = s:listtype(get(s:default_list_type_commands, a:for))
|
||||
if l:listtype == "0"
|
||||
call zig#util#EchoError(printf(
|
||||
\ "unknown list type command value found ('%s'). Please open a bug report in the zig.vim repo.",
|
||||
\ a:for))
|
||||
let l:listtype = "quickfix"
|
||||
endif
|
||||
|
||||
return get(zig#config#ListTypeCommands(), a:for, l:listtype)
|
||||
endfunction
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
@@ -1,394 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'zig', 'autoload/zig/util.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Adapted from vim-go: autoload/go/util.vim
|
||||
"
|
||||
" Copyright 2011 The Go Authors. All rights reserved.
|
||||
" Use of this source code is governed by a BSD-style
|
||||
" license that can be found in the LICENSE file.
|
||||
"
|
||||
|
||||
" PathSep returns the appropriate OS specific path separator.
|
||||
function! zig#util#PathSep() abort
|
||||
if zig#util#IsWin()
|
||||
return '\'
|
||||
endif
|
||||
return '/'
|
||||
endfunction
|
||||
|
||||
" PathListSep returns the appropriate OS specific path list separator.
|
||||
function! zig#util#PathListSep() abort
|
||||
if zig#util#IsWin()
|
||||
return ";"
|
||||
endif
|
||||
return ":"
|
||||
endfunction
|
||||
|
||||
" LineEnding returns the correct line ending, based on the current fileformat
|
||||
function! zig#util#LineEnding() abort
|
||||
if &fileformat == 'dos'
|
||||
return "\r\n"
|
||||
elseif &fileformat == 'mac'
|
||||
return "\r"
|
||||
endif
|
||||
|
||||
return "\n"
|
||||
endfunction
|
||||
|
||||
" Join joins any number of path elements into a single path, adding a
|
||||
" Separator if necessary and returns the result
|
||||
function! zig#util#Join(...) abort
|
||||
return join(a:000, zig#util#PathSep())
|
||||
endfunction
|
||||
|
||||
" IsWin returns 1 if current OS is Windows or 0 otherwise
|
||||
function! zig#util#IsWin() abort
|
||||
let win = ['win16', 'win32', 'win64', 'win95']
|
||||
for w in win
|
||||
if (has(w))
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" IsMac returns 1 if current OS is macOS or 0 otherwise.
|
||||
function! zig#util#IsMac() abort
|
||||
return has('mac') ||
|
||||
\ has('macunix') ||
|
||||
\ has('gui_macvim') ||
|
||||
\ zig#util#Exec(['uname'])[0] =~? '^darwin'
|
||||
endfunction
|
||||
|
||||
" Checks if using:
|
||||
" 1) Windows system,
|
||||
" 2) And has cygpath executable,
|
||||
" 3) And uses *sh* as 'shell'
|
||||
function! zig#util#IsUsingCygwinShell()
|
||||
return zig#util#IsWin() && executable('cygpath') && &shell =~ '.*sh.*'
|
||||
endfunction
|
||||
|
||||
" Check if Vim jobs API is supported.
|
||||
"
|
||||
" The (optional) first paramter can be added to indicate the 'cwd' or 'env'
|
||||
" parameters will be used, which wasn't added until a later version.
|
||||
function! zig#util#has_job(...) abort
|
||||
" cwd and env parameters to job_start was added in this version.
|
||||
if a:0 > 0 && a:1 is 1
|
||||
return has('job') && has("patch-8.0.0902")
|
||||
endif
|
||||
|
||||
" job was introduced in 7.4.xxx however there are multiple bug fixes and one
|
||||
" of the latest is 8.0.0087 which is required for a stable async API.
|
||||
return has('job') && has("patch-8.0.0087")
|
||||
endfunction
|
||||
|
||||
let s:env_cache = {}
|
||||
|
||||
" env returns the go environment variable for the given key. Where key can be
|
||||
" GOARCH, GOOS, GOROOT, etc... It caches the result and returns the cached
|
||||
" version.
|
||||
function! zig#util#env(key) abort
|
||||
let l:key = tolower(a:key)
|
||||
if has_key(s:env_cache, l:key)
|
||||
return s:env_cache[l:key]
|
||||
endif
|
||||
|
||||
if executable('go')
|
||||
let l:var = call('zig#util#'.l:key, [])
|
||||
if zig#util#ShellError() != 0
|
||||
call zig#util#EchoError(printf("'go env %s' failed", toupper(l:key)))
|
||||
return ''
|
||||
endif
|
||||
else
|
||||
let l:var = eval("$".toupper(a:key))
|
||||
endif
|
||||
|
||||
let s:env_cache[l:key] = l:var
|
||||
return l:var
|
||||
endfunction
|
||||
|
||||
" Run a shell command.
|
||||
"
|
||||
" It will temporary set the shell to /bin/sh for Unix-like systems if possible,
|
||||
" so that we always use a standard POSIX-compatible Bourne shell (and not e.g.
|
||||
" csh, fish, etc.) See #988 and #1276.
|
||||
function! s:system(cmd, ...) abort
|
||||
" Preserve original shell and shellredir values
|
||||
let l:shell = &shell
|
||||
let l:shellredir = &shellredir
|
||||
|
||||
if !zig#util#IsWin() && executable('/bin/sh')
|
||||
set shell=/bin/sh shellredir=>%s\ 2>&1
|
||||
endif
|
||||
|
||||
try
|
||||
return call('system', [a:cmd] + a:000)
|
||||
finally
|
||||
" Restore original values
|
||||
let &shell = l:shell
|
||||
let &shellredir = l:shellredir
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" System runs a shell command "str". Every arguments after "str" is passed to
|
||||
" stdin.
|
||||
function! zig#util#System(str, ...) abort
|
||||
return call('s:system', [a:str] + a:000)
|
||||
endfunction
|
||||
|
||||
" Exec runs a shell command "cmd", which must be a list, one argument per item.
|
||||
" Every list entry will be automatically shell-escaped
|
||||
" Every other argument is passed to stdin.
|
||||
function! zig#util#Exec(cmd, ...) abort
|
||||
if len(a:cmd) == 0
|
||||
call zig#util#EchoError("zig#util#Exec() called with empty a:cmd")
|
||||
return ['', 1]
|
||||
endif
|
||||
|
||||
let l:bin = a:cmd[0]
|
||||
|
||||
if !executable(l:bin)
|
||||
call zig#util#EchoError(printf("could not find binary '%s'", a:cmd[0]))
|
||||
return ['', 1]
|
||||
endif
|
||||
|
||||
return call('s:exec', [a:cmd] + a:000)
|
||||
endfunction
|
||||
|
||||
function! s:exec(cmd, ...) abort
|
||||
let l:bin = a:cmd[0]
|
||||
let l:cmd = zig#util#Shelljoin([l:bin] + a:cmd[1:])
|
||||
if zig#util#HasDebug('shell-commands')
|
||||
call zig#util#EchoInfo('shell command: ' . l:cmd)
|
||||
endif
|
||||
|
||||
let l:out = call('s:system', [l:cmd] + a:000)
|
||||
return [l:out, zig#util#ShellError()]
|
||||
endfunction
|
||||
|
||||
function! zig#util#ShellError() abort
|
||||
return v:shell_error
|
||||
endfunction
|
||||
|
||||
" StripPath strips the path's last character if it's a path separator.
|
||||
" example: '/foo/bar/' -> '/foo/bar'
|
||||
function! zig#util#StripPathSep(path) abort
|
||||
let last_char = strlen(a:path) - 1
|
||||
if a:path[last_char] == zig#util#PathSep()
|
||||
return strpart(a:path, 0, last_char)
|
||||
endif
|
||||
|
||||
return a:path
|
||||
endfunction
|
||||
|
||||
" StripTrailingSlash strips the trailing slash from the given path list.
|
||||
" example: ['/foo/bar/'] -> ['/foo/bar']
|
||||
function! zig#util#StripTrailingSlash(paths) abort
|
||||
return map(copy(a:paths), 'zig#util#StripPathSep(v:val)')
|
||||
endfunction
|
||||
|
||||
" Shelljoin returns a shell-safe string representation of arglist. The
|
||||
" {special} argument of shellescape() may optionally be passed.
|
||||
function! zig#util#Shelljoin(arglist, ...) abort
|
||||
try
|
||||
let ssl_save = &shellslash
|
||||
set noshellslash
|
||||
if a:0
|
||||
return join(map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')'), ' ')
|
||||
endif
|
||||
|
||||
return join(map(copy(a:arglist), 'shellescape(v:val)'), ' ')
|
||||
finally
|
||||
let &shellslash = ssl_save
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
fu! zig#util#Shellescape(arg)
|
||||
try
|
||||
let ssl_save = &shellslash
|
||||
set noshellslash
|
||||
return shellescape(a:arg)
|
||||
finally
|
||||
let &shellslash = ssl_save
|
||||
endtry
|
||||
endf
|
||||
|
||||
" Shelllist returns a shell-safe representation of the items in the given
|
||||
" arglist. The {special} argument of shellescape() may optionally be passed.
|
||||
function! zig#util#Shelllist(arglist, ...) abort
|
||||
try
|
||||
let ssl_save = &shellslash
|
||||
set noshellslash
|
||||
if a:0
|
||||
return map(copy(a:arglist), 'shellescape(v:val, ' . a:1 . ')')
|
||||
endif
|
||||
return map(copy(a:arglist), 'shellescape(v:val)')
|
||||
finally
|
||||
let &shellslash = ssl_save
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Returns the byte offset for line and column
|
||||
function! zig#util#Offset(line, col) abort
|
||||
if &encoding != 'utf-8'
|
||||
let sep = zig#util#LineEnding()
|
||||
let buf = a:line == 1 ? '' : (join(getline(1, a:line-1), sep) . sep)
|
||||
let buf .= a:col == 1 ? '' : getline('.')[:a:col-2]
|
||||
return len(iconv(buf, &encoding, 'utf-8'))
|
||||
endif
|
||||
return line2byte(a:line) + (a:col-2)
|
||||
endfunction
|
||||
"
|
||||
" Returns the byte offset for the cursor
|
||||
function! zig#util#OffsetCursor() abort
|
||||
return zig#util#Offset(line('.'), col('.'))
|
||||
endfunction
|
||||
|
||||
" Windo is like the built-in :windo, only it returns to the window the command
|
||||
" was issued from
|
||||
function! zig#util#Windo(command) abort
|
||||
let s:currentWindow = winnr()
|
||||
try
|
||||
execute "windo " . a:command
|
||||
finally
|
||||
execute s:currentWindow. "wincmd w"
|
||||
unlet s:currentWindow
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" snippetcase converts the given word to given preferred snippet setting type
|
||||
" case.
|
||||
function! zig#util#snippetcase(word) abort
|
||||
let l:snippet_case = zig#config#AddtagsTransform()
|
||||
if l:snippet_case == "snakecase"
|
||||
return zig#util#snakecase(a:word)
|
||||
elseif l:snippet_case == "camelcase"
|
||||
return zig#util#camelcase(a:word)
|
||||
else
|
||||
return a:word " do nothing
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" snakecase converts a string to snake case. i.e: FooBar -> foo_bar
|
||||
" Copied from tpope/vim-abolish
|
||||
function! zig#util#snakecase(word) abort
|
||||
let word = substitute(a:word, '::', '/', 'g')
|
||||
let word = substitute(word, '\(\u\+\)\(\u\l\)', '\1_\2', 'g')
|
||||
let word = substitute(word, '\(\l\|\d\)\(\u\)', '\1_\2', 'g')
|
||||
let word = substitute(word, '[.-]', '_', 'g')
|
||||
let word = tolower(word)
|
||||
return word
|
||||
endfunction
|
||||
|
||||
" camelcase converts a string to camel case. e.g. FooBar or foo_bar will become
|
||||
" fooBar.
|
||||
" Copied from tpope/vim-abolish.
|
||||
function! zig#util#camelcase(word) abort
|
||||
let word = substitute(a:word, '-', '_', 'g')
|
||||
if word !~# '_' && word =~# '\l'
|
||||
return substitute(word, '^.', '\l&', '')
|
||||
else
|
||||
return substitute(word, '\C\(_\)\=\(.\)', '\=submatch(1)==""?tolower(submatch(2)) : toupper(submatch(2))','g')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" pascalcase converts a string to 'PascalCase'. e.g. fooBar or foo_bar will
|
||||
" become FooBar.
|
||||
function! zig#util#pascalcase(word) abort
|
||||
let word = zig#util#camelcase(a:word)
|
||||
return toupper(word[0]) . word[1:]
|
||||
endfunction
|
||||
|
||||
" Echo a message to the screen and highlight it with the group in a:hi.
|
||||
"
|
||||
" The message can be a list or string; every line with be :echomsg'd separately.
|
||||
function! s:echo(msg, hi)
|
||||
let l:msg = []
|
||||
if type(a:msg) != type([])
|
||||
let l:msg = split(a:msg, "\n")
|
||||
else
|
||||
let l:msg = a:msg
|
||||
endif
|
||||
|
||||
" Tabs display as ^I or <09>, so manually expand them.
|
||||
let l:msg = map(l:msg, 'substitute(v:val, "\t", " ", "")')
|
||||
|
||||
exe 'echohl ' . a:hi
|
||||
for line in l:msg
|
||||
echom "zig.vim: " . line
|
||||
endfor
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! zig#util#EchoSuccess(msg)
|
||||
call s:echo(a:msg, 'Function')
|
||||
endfunction
|
||||
function! zig#util#EchoError(msg)
|
||||
call s:echo(a:msg, 'ErrorMsg')
|
||||
endfunction
|
||||
function! zig#util#EchoWarning(msg)
|
||||
call s:echo(a:msg, 'WarningMsg')
|
||||
endfunction
|
||||
function! zig#util#EchoProgress(msg)
|
||||
redraw
|
||||
call s:echo(a:msg, 'Identifier')
|
||||
endfunction
|
||||
function! zig#util#EchoInfo(msg)
|
||||
call s:echo(a:msg, 'Debug')
|
||||
endfunction
|
||||
|
||||
" Get all lines in the buffer as a a list.
|
||||
function! zig#util#GetLines()
|
||||
let buf = getline(1, '$')
|
||||
if &encoding != 'utf-8'
|
||||
let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")')
|
||||
endif
|
||||
if &l:fileformat == 'dos'
|
||||
" XXX: line2byte() depend on 'fileformat' option.
|
||||
" so if fileformat is 'dos', 'buf' must include '\r'.
|
||||
let buf = map(buf, 'v:val."\r"')
|
||||
endif
|
||||
return buf
|
||||
endfunction
|
||||
|
||||
" Make a named temporary directory which starts with "prefix".
|
||||
"
|
||||
" Unfortunately Vim's tempname() is not portable enough across various systems;
|
||||
" see: https://github.com/mattn/vim-go/pull/3#discussion_r138084911
|
||||
function! zig#util#tempdir(prefix) abort
|
||||
" See :help tempfile
|
||||
if zig#util#IsWin()
|
||||
let l:dirs = [$TMP, $TEMP, 'c:\tmp', 'c:\temp']
|
||||
else
|
||||
let l:dirs = [$TMPDIR, '/tmp', './', $HOME]
|
||||
endif
|
||||
|
||||
let l:dir = ''
|
||||
for l:d in dirs
|
||||
if !empty(l:d) && filewritable(l:d) == 2
|
||||
let l:dir = l:d
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
if l:dir == ''
|
||||
call zig#util#EchoError('Unable to find directory to store temporary directory in')
|
||||
return
|
||||
endif
|
||||
|
||||
" Not great randomness, but "good enough" for our purpose here.
|
||||
let l:rnd = sha256(printf('%s%s', localtime(), fnamemodify(bufname(''), ":p")))
|
||||
let l:tmp = printf("%s/%s%s", l:dir, a:prefix, l:rnd)
|
||||
call mkdir(l:tmp, 'p', 0700)
|
||||
return l:tmp
|
||||
endfunction
|
||||
|
||||
" Report if the user enabled a debug flag in g:zig_debug.
|
||||
function! zig#util#HasDebug(flag)
|
||||
return index(zig#config#Debug(), a:flag) >= 0
|
||||
endfunction
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
27
compiler/puppet-lint.vim
Normal file
27
compiler/puppet-lint.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'puppet', 'compiler/puppet-lint.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: puppet-lint
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "puppet-lint"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet makeprg=puppet-lint\ --with-filename
|
||||
CompilerSet errorformat=%f\ -\ %tRROR:\ %m\ on\ line\ %l,
|
||||
\%f\ -\ %tARNING:\ %m\ on\ line\ %l,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
32
compiler/sml.vim
Normal file
32
compiler/sml.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'sml', 'compiler/sml.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: SML/NJ Compiler
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2020 Feb 10
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "sml"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet makeprg=sml
|
||||
CompilerSet errorformat=%f:%l.%c-%\\d%\\+.%\\d%\\+\ %trror:\ %m,
|
||||
\%f:%l.%c\ %trror:\ %m,
|
||||
\%trror:\ %m
|
||||
\%f:%l.%c-%\\d%\\+.%\\d%\\+\ %tarning:\ %m,
|
||||
\%f:%l.%c\ %tarning:\ %m,
|
||||
\%tarning:\ %m,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim compiler file
|
||||
" Compiler: HTML Tidy
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2016 Apr 21
|
||||
" Last Change: 2020 Sep 4
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -16,8 +16,15 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %:S
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" foo.html:8:1: Warning: inserting missing 'foobar' element
|
||||
" foo.html:9:2: Error: <foobar> is not recognized!
|
||||
CompilerSet errorformat=%f:%l:%c:\ %trror:%m,%f:%l:%c:\ %tarning:%m,%-G%.%#
|
||||
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes
|
||||
CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m,
|
||||
\%f:%l:%c:\ %tarning:\ %m,
|
||||
\%f:%l:%c:\ %tnfo:\ %m,
|
||||
\%f:%l:%c:\ %m,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
32
compiler/zig.vim
Normal file
32
compiler/zig.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'zig', 'compiler/zig.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: Zig Compiler
|
||||
" For bugs, patches and license go to https://github.com/ziglang/zig.vim
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "zig"
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" a subcommand must be provided for the this compiler (test, build-exe, etc)
|
||||
if has('patch-7.4.191')
|
||||
CompilerSet makeprg=zig\ \$*\ \%:S
|
||||
else
|
||||
CompilerSet makeprg=zig\ \$*\ \"%\"
|
||||
endif
|
||||
|
||||
" TODO: improve errorformat as needed.
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
32
compiler/zig_build.vim
Normal file
32
compiler/zig_build.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'zig', 'compiler/zig_build.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: Zig Compiler (zig build)
|
||||
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
runtime compiler/zig.vim
|
||||
let current_compiler = 'zig_build'
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if exists('g:zig_build_makeprg_params')
|
||||
execute 'CompilerSet makeprg=zig\ build\ '.escape(g:zig_build_makeprg_params, ' \|"').'\ $*'
|
||||
else
|
||||
CompilerSet makeprg=zig\ build\ $*
|
||||
endif
|
||||
|
||||
" TODO: anything to add to errorformat for zig build specifically?
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
30
compiler/zig_build_exe.vim
Normal file
30
compiler/zig_build_exe.vim
Normal file
@@ -0,0 +1,30 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'zig', 'compiler/zig_build_exe.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: Zig Compiler (zig build-exe)
|
||||
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
runtime compiler/zig.vim
|
||||
let current_compiler = 'zig_build_exe'
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if has('patch-7.4.191')
|
||||
CompilerSet makeprg=zig\ build-exe\ \%:S\ \$*
|
||||
else
|
||||
CompilerSet makeprg=zig\ build-exe\ \"%\"\ \$*
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
30
compiler/zig_test.vim
Normal file
30
compiler/zig_test.vim
Normal file
@@ -0,0 +1,30 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'zig', 'compiler/zig_test.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: Zig Compiler (zig test)
|
||||
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
runtime compiler/zig.vim
|
||||
let current_compiler = 'zig_test'
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if has('patch-7.4.191')
|
||||
CompilerSet makeprg=zig\ test\ \%:S\ \$*
|
||||
else
|
||||
CompilerSet makeprg=zig\ test\ \"%\"\ \$*
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Dec 24
|
||||
" Last Change: 2021 Jan 21
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -216,6 +216,9 @@ au BufNewFile,BufRead *.bc setf bc
|
||||
" BDF font
|
||||
au BufNewFile,BufRead *.bdf setf bdf
|
||||
|
||||
" Beancount
|
||||
au BufNewFile,BufRead *.beancount setf beancount
|
||||
|
||||
" BibTeX bibliography database file
|
||||
au BufNewFile,BufRead *.bib setf bib
|
||||
|
||||
@@ -589,6 +592,9 @@ au BufNewFile,BufRead *.fan,*.fwt setf fan
|
||||
" Factor
|
||||
au BufNewFile,BufRead *.factor setf factor
|
||||
|
||||
" Fennel
|
||||
autocmd BufRead,BufNewFile *.fnl setf fennel
|
||||
|
||||
" Fetchmail RC file
|
||||
au BufNewFile,BufRead .fetchmailrc setf fetchmail
|
||||
|
||||
@@ -1173,9 +1179,10 @@ au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp
|
||||
" Password file
|
||||
au BufNewFile,BufRead */etc/passwd,*/etc/passwd-,*/etc/passwd.edit,*/etc/shadow,*/etc/shadow-,*/etc/shadow.edit,*/var/backups/passwd.bak,*/var/backups/shadow.bak setf passwd
|
||||
|
||||
" Pascal (also *.p)
|
||||
" Pascal (also *.p, *.pp, *.inc)
|
||||
au BufNewFile,BufRead *.pas setf pascal
|
||||
|
||||
" Pascal or Puppet manifest
|
||||
au BufNewFile,BufRead *.pp call polyglot#ft#FTpp()
|
||||
|
||||
" Delphi or Lazarus program file
|
||||
@@ -1266,7 +1273,7 @@ au BufNewFile,BufRead *.pov setf pov
|
||||
" Povray configuration
|
||||
au BufNewFile,BufRead .povrayrc setf povini
|
||||
|
||||
" Povray, PHP or assembly
|
||||
" Povray, Pascal, PHP or assembly
|
||||
au BufNewFile,BufRead *.inc call polyglot#ft#FTinc()
|
||||
|
||||
" Printcap and Termcap
|
||||
@@ -1275,13 +1282,19 @@ au BufNewFile,BufRead *printcap
|
||||
au BufNewFile,BufRead *termcap
|
||||
\ let b:ptcap_type = "term" | setf ptcap
|
||||
|
||||
" PCCTS / ANTRL
|
||||
"au BufNewFile,BufRead *.g setf antrl
|
||||
" PCCTS / ANTLR
|
||||
"au BufNewFile,BufRead *.g setf antlr
|
||||
au BufNewFile,BufRead *.g setf pccts
|
||||
|
||||
" PPWizard
|
||||
au BufNewFile,BufRead *.it,*.ih setf ppwiz
|
||||
|
||||
" Puppet
|
||||
au BufNewFile,BufRead Puppetfile setf ruby
|
||||
|
||||
" Embedded Puppet
|
||||
au BufNewFile,BufRead *.epp setf epuppet
|
||||
|
||||
" Obj 3D file format
|
||||
" TODO: is there a way to avoid MS-Windows Object files?
|
||||
au BufNewFile,BufRead *.obj setf obj
|
||||
@@ -1424,8 +1437,8 @@ au BufNewFile,BufRead *.rb,*.rbw setf ruby
|
||||
" RubyGems
|
||||
au BufNewFile,BufRead *.gemspec setf ruby
|
||||
|
||||
" Rust
|
||||
au BufNewFile,BufRead *.rs setf rust
|
||||
" RBS (Ruby Signature)
|
||||
au BufNewFile,BufRead *.rbs setf rbs
|
||||
|
||||
" Rackup
|
||||
au BufNewFile,BufRead *.ru setf ruby
|
||||
@@ -1439,6 +1452,9 @@ au BufNewFile,BufRead *.builder,*.rxml,*.rjs setf ruby
|
||||
" Rantfile and Rakefile is like Ruby
|
||||
au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby
|
||||
|
||||
" Rust
|
||||
au BufNewFile,BufRead *.rs setf rust
|
||||
|
||||
" S-lang (or shader language, or SmallLisp)
|
||||
au BufNewFile,BufRead *.sl setf slang
|
||||
|
||||
@@ -1475,6 +1491,9 @@ au BufNewFile,BufRead *.sdl,*.pr setf sdl
|
||||
" sed
|
||||
au BufNewFile,BufRead *.sed setf sed
|
||||
|
||||
" svelte
|
||||
au BufNewFile,BufRead *.svelte setf svelte
|
||||
|
||||
" Sieve (RFC 3028, 5228)
|
||||
au BufNewFile,BufRead *.siv,*.sieve setf sieve
|
||||
|
||||
@@ -1618,6 +1637,9 @@ au BufNewFile,BufRead *.mib,*.my setf mib
|
||||
au BufNewFile,BufRead *.hog,snort.conf,vision.conf setf hog
|
||||
au BufNewFile,BufRead *.rules call polyglot#ft#FTRules()
|
||||
|
||||
" SPARQL queries
|
||||
au BufNewFile,BufRead *.rq,*.sparql setf sparql
|
||||
|
||||
" Spec (Linux RPM)
|
||||
au BufNewFile,BufRead *.spec setf spec
|
||||
|
||||
@@ -1728,8 +1750,13 @@ au BufNewFile,BufRead *.tli setf tli
|
||||
" Telix Salt
|
||||
au BufNewFile,BufRead *.slt setf tsalt
|
||||
|
||||
" Tera Term Language
|
||||
au BufRead,BufNewFile *.ttl setf teraterm
|
||||
" Tera Term Language or Turtle
|
||||
au BufRead,BufNewFile *.ttl
|
||||
\ if getline(1) =~ '^@\?\(prefix\|base\)' |
|
||||
\ setf turtle |
|
||||
\ else |
|
||||
\ setf teraterm |
|
||||
\ endif
|
||||
|
||||
" Terminfo
|
||||
au BufNewFile,BufRead *.ti setf terminfo
|
||||
|
||||
@@ -163,40 +163,41 @@ if exists("g:ada_abbrev")
|
||||
endif
|
||||
|
||||
" Section: Commands, Mapping, Menus {{{1
|
||||
"
|
||||
call ada#Map_Popup (
|
||||
if !exists(':AdaTagFile')
|
||||
call ada#Map_Popup (
|
||||
\ 'Tag.List',
|
||||
\ 'l',
|
||||
\ 'call ada#List_Tag ()')
|
||||
call ada#Map_Popup (
|
||||
call ada#Map_Popup (
|
||||
\'Tag.Jump',
|
||||
\'j',
|
||||
\'call ada#Jump_Tag ()')
|
||||
call ada#Map_Menu (
|
||||
call ada#Map_Menu (
|
||||
\'Tag.Create File',
|
||||
\':AdaTagFile',
|
||||
\'call ada#Create_Tags (''file'')')
|
||||
call ada#Map_Menu (
|
||||
call ada#Map_Menu (
|
||||
\'Tag.Create Dir',
|
||||
\':AdaTagDir',
|
||||
\'call ada#Create_Tags (''dir'')')
|
||||
|
||||
call ada#Map_Menu (
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Space Errors',
|
||||
\ ':AdaSpaces',
|
||||
\'call ada#Switch_Syntax_Option (''space_errors'')')
|
||||
call ada#Map_Menu (
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Lines Errors',
|
||||
\ ':AdaLines',
|
||||
\'call ada#Switch_Syntax_Option (''line_errors'')')
|
||||
call ada#Map_Menu (
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Rainbow Color',
|
||||
\ ':AdaRainbow',
|
||||
\'call ada#Switch_Syntax_Option (''rainbow_color'')')
|
||||
call ada#Map_Menu (
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Standard Types',
|
||||
\ ':AdaTypes',
|
||||
\'call ada#Switch_Syntax_Option (''standard_types'')')
|
||||
endif
|
||||
|
||||
" 1}}}
|
||||
" Reset cpoptions
|
||||
|
||||
31
ftplugin/basic.vim
Normal file
31
ftplugin/basic.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'basic', 'ftplugin/basic.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: BASIC
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2015 Jan 10
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=:REM,:'
|
||||
setlocal commentstring='\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms< sua<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim filetype plugin file
|
||||
" Language: Bazel (http://bazel.io)
|
||||
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
|
||||
" Last Change: 2015 Aug 11
|
||||
" Last Change: 2021 Jan 19
|
||||
|
||||
""
|
||||
" @section Introduction, intro
|
||||
@@ -55,6 +55,8 @@ if get(g:, 'ft_bzl_fold', 0)
|
||||
endif
|
||||
|
||||
if exists('*BzlFoldText')
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'puppet', 'ftplugin/embeddedpuppet.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'puppet', 'ftplugin/epuppet.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -7,14 +7,14 @@ endif
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-19
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
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< fo< inc< | unlet! b:matchwords"
|
||||
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,:// commentstring=/*\ %s\ */
|
||||
|
||||
17
ftplugin/freebasic.vim
Normal file
17
ftplugin/freebasic.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'freebasic', 'ftplugin/freebasic.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: FreeBasic
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2015 Jan 10
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
runtime! ftplugin/basic.vim
|
||||
|
||||
" vim: ts=8
|
||||
@@ -6,7 +6,7 @@ endif
|
||||
" Language: Hamster Script
|
||||
" Version: 2.0.6.0
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Last Change: 2017 Mar 18
|
||||
" Last Change: 2021 Jan 19
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -61,6 +61,9 @@ if exists("loaded_matchit")
|
||||
endif
|
||||
|
||||
setlocal ignorecase
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
setlocal cpo+=M " makes \%( match \)
|
||||
|
||||
" Disabled, 'cpo' is a global option.
|
||||
" setlocal cpo+=M " makes \%( match \)
|
||||
|
||||
@@ -18,13 +18,11 @@ endif
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setl comments=:;
|
||||
setl comments=:;;;;,:;;;,:;;,:;,sr:#\|,mb:\|,ex:\|#
|
||||
setl define=^\\s*(def\\k*
|
||||
setl formatoptions-=t
|
||||
setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94
|
||||
setl lisp
|
||||
setl commentstring=;%s
|
||||
|
||||
setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|#
|
||||
|
||||
let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp< commentstring<"
|
||||
|
||||
5
ftplugin/octave.vim
Normal file
5
ftplugin/octave.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'octave', 'ftplugin/octave.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
setlocal commentstring=%\ %s
|
||||
@@ -51,7 +51,7 @@ 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 shiftwidth=4 softtabstop=4 expandtab
|
||||
setlocal textwidth=99
|
||||
endif
|
||||
|
||||
|
||||
@@ -2,4 +2,14 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'sxhkd', 'ftplugin/sxhkdrc.vim
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
setlocal cms=#%s
|
||||
|
||||
if exists('b:undo_ftplugin')
|
||||
let b:undo_ftplugin .= "|setlocal commentstring<"
|
||||
else
|
||||
let b:undo_ftplugin = "setlocal commentstring<"
|
||||
endif
|
||||
|
||||
36
ftplugin/tidy.vim
Normal file
36
ftplugin/tidy.vim
Normal file
@@ -0,0 +1,36 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tidy', 'ftplugin/tidy.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: HMTL Tidy Configuration
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2020 Sep 4
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal comments=:#,://
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "HTML Tidy Files (tidyrc, .tidyrc, tidy.conf)\ttidyrc;.tidyrc;tidy.conf\n" .
|
||||
\ "HTML Files (*.html, *.htm)\t*.html;*.htm\n" .
|
||||
\ "XHTML Files (*.xhtml, *.xhtm)\t*.xhtml;*.xhtm\n" .
|
||||
\ "XML Files (*.xml)\t*.xml\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8
|
||||
@@ -2,5 +2,36 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'v', 'ftplugin/vlang.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
setlocal commentstring=//\ %s
|
||||
setlocal makeprg=v\ %
|
||||
|
||||
if exists('b:undo_ftplugin')
|
||||
let b:undo_ftplugin .= "|setlocal commentstring< makeprg<"
|
||||
else
|
||||
let b:undo_ftplugin = "setlocal commentstring< makeprg<"
|
||||
endif
|
||||
|
||||
function! _VFormatFile()
|
||||
if exists('g:v_autofmt_bufwritepre') && g:v_autofmt_bufwritepre || exists('b:v_autofmt_bufwritepre') && b:v_autofmt_bufwritepre
|
||||
let substitution = system("v fmt -", join(getline(1, line('$')), "\n"))
|
||||
if v:shell_error != 0
|
||||
echoerr "While formatting the buffer via vfmt, the following error occurred:"
|
||||
echoerr printf("ERROR(%d): %s", v:shell_error, substitution)
|
||||
else
|
||||
let [_, lnum, colnum, _] = getpos('.')
|
||||
%delete
|
||||
call append(0, split(substitution, "\n"))
|
||||
call cursor(lnum, colnum)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
if has('autocmd')
|
||||
augroup v_fmt
|
||||
autocmd BufWritePre *.v call _VFormatFile()
|
||||
augroup END
|
||||
endif
|
||||
|
||||
@@ -12,6 +12,11 @@ let b:did_ftplugin = 1
|
||||
let s:cpo_orig = &cpo
|
||||
set cpo&vim
|
||||
|
||||
compiler zig_build
|
||||
|
||||
" Match Zig builtin fns
|
||||
setlocal iskeyword+=@-@
|
||||
|
||||
" Recomended code style, no tabs and 4-space indentation
|
||||
setlocal expandtab
|
||||
setlocal tabstop=8
|
||||
@@ -21,7 +26,6 @@ setlocal shiftwidth=4
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal suffixesadd=.zig,.zir
|
||||
setlocal makeprg=zig\ build
|
||||
|
||||
if has('comments')
|
||||
setlocal comments=:///,://!,://,:\\\\
|
||||
@@ -44,7 +48,7 @@ if exists("*json_decode") && executable('zig')
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin =
|
||||
\ 'setl et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<'
|
||||
\ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<'
|
||||
|
||||
let &cpo = s:cpo_orig
|
||||
unlet s:cpo_orig
|
||||
|
||||
@@ -78,11 +78,15 @@ endif
|
||||
if (b:fortran_fixed_source == 1)
|
||||
setlocal indentexpr=FortranGetFixedIndent()
|
||||
if exists("*FortranGetFixedIndent")
|
||||
let &cpoptions = s:cposet
|
||||
unlet s:cposet
|
||||
finish
|
||||
endif
|
||||
else
|
||||
setlocal indentexpr=FortranGetFreeIndent()
|
||||
if exists("*FortranGetFreeIndent")
|
||||
let &cpoptions = s:cposet
|
||||
unlet s:cposet
|
||||
finish
|
||||
endif
|
||||
endif
|
||||
@@ -217,7 +221,7 @@ function FortranGetFixedIndent()
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
let &cpoptions=s:cposet
|
||||
let &cpoptions = s:cposet
|
||||
unlet s:cposet
|
||||
|
||||
" vim:sw=2 tw=130
|
||||
|
||||
@@ -193,13 +193,13 @@ function! GetHaskellIndent()
|
||||
|
||||
" operator at end of previous line
|
||||
if l:prevline =~ '[!#$%&*+./<>?@\\^|~-]\s*$'
|
||||
return indent(v:lnum - 1) + &shiftwidth
|
||||
return indent(v:lnum - 1) + shiftwidth()
|
||||
endif
|
||||
|
||||
" let foo =
|
||||
" >>>>>>bar
|
||||
if l:prevline =~ '\C\<let\>\s\+[^=]\+=\s*$'
|
||||
return match(l:prevline, '\C\<let\>') + g:haskell_indent_let + &shiftwidth
|
||||
return match(l:prevline, '\C\<let\>') + g:haskell_indent_let + shiftwidth()
|
||||
endif
|
||||
|
||||
" let x = 1 in
|
||||
@@ -247,7 +247,7 @@ function! GetHaskellIndent()
|
||||
" >>foo
|
||||
"
|
||||
if l:prevline =~ '\C\<where\>\s*$'
|
||||
return indent(v:lnum - 1) + get(g:, 'haskell_indent_after_bare_where', &shiftwidth)
|
||||
return indent(v:lnum - 1) + get(g:, 'haskell_indent_after_bare_where', shiftwidth())
|
||||
endif
|
||||
|
||||
" do
|
||||
@@ -256,7 +256,7 @@ function! GetHaskellIndent()
|
||||
" foo =
|
||||
" >>bar
|
||||
if l:prevline =~ '\C\(\<do\>\|=\)\s*$'
|
||||
return indent(v:lnum - 1) + &shiftwidth
|
||||
return indent(v:lnum - 1) + shiftwidth()
|
||||
endif
|
||||
|
||||
" do foo
|
||||
@@ -272,7 +272,7 @@ function! GetHaskellIndent()
|
||||
" >>bar -> quux
|
||||
if l:prevline =~ '\C\<case\>.\+\<of\>\s*$'
|
||||
if get(g:,'haskell_indent_case_alternative', 0)
|
||||
return indent(v:lnum - 1) + &shiftwidth
|
||||
return indent(v:lnum - 1) + shiftwidth()
|
||||
else
|
||||
return match(l:prevline, '\C\<case\>') + g:haskell_indent_case
|
||||
endif
|
||||
@@ -305,7 +305,7 @@ function! GetHaskellIndent()
|
||||
" newtype Foo = Foo
|
||||
" >>deriving
|
||||
if l:prevline =~ '\C^\s*\<\(newtype\|data\)\>[^{]\+' && l:line =~ '\C^\s*\<deriving\>'
|
||||
return indent(v:lnum - 1) + &shiftwidth
|
||||
return indent(v:lnum - 1) + shiftwidth()
|
||||
endif
|
||||
|
||||
" foo :: Int
|
||||
@@ -318,7 +318,7 @@ function! GetHaskellIndent()
|
||||
if l:line =~ '^\s*[-=]>'
|
||||
return match(l:prevline, '::\s')
|
||||
elseif match(l:prevline, '^\s\+::') > -1
|
||||
return match(l:prevline, '::\s') - &shiftwidth
|
||||
return match(l:prevline, '::\s') - shiftwidth()
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -398,13 +398,13 @@ function! GetHaskellIndent()
|
||||
">>>>>=> Int
|
||||
if l:prevline =~ '^\s*)' && l:line =~ '^\s*=>'
|
||||
let l:s = match(l:prevline, ')')
|
||||
return l:s - (&shiftwidth + 1)
|
||||
return l:s - (shiftwidth() + 1)
|
||||
endif
|
||||
|
||||
" module Foo
|
||||
" >>( bar
|
||||
if l:prevline =~ '\C^\<module\>'
|
||||
return &shiftwidth
|
||||
return shiftwidth()
|
||||
endif
|
||||
|
||||
" foo
|
||||
@@ -412,7 +412,7 @@ function! GetHaskellIndent()
|
||||
if l:line =~ '^\s*{'
|
||||
let l:s = indent(v:lnum - 1)
|
||||
if l:s >= 0
|
||||
return l:s + &shiftwidth
|
||||
return l:s + shiftwidth()
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -428,7 +428,7 @@ function! GetHaskellIndent()
|
||||
return match(l:prevline, 'in') - g:haskell_indent_in
|
||||
endif
|
||||
|
||||
return indent(v:lnum - 1) + get(g:, 'haskell_indent_before_where', &shiftwidth)
|
||||
return indent(v:lnum - 1) + get(g:, 'haskell_indent_before_where', shiftwidth())
|
||||
endif
|
||||
|
||||
" let x = 1
|
||||
@@ -462,13 +462,13 @@ function! GetHaskellIndent()
|
||||
" >>=
|
||||
if l:line =~ '^\s*='
|
||||
if l:prevline =~ '\C^\<data\>\s\+[^=]\+\s*$'
|
||||
return match(l:prevline, '\C\<data\>') + &shiftwidth
|
||||
return match(l:prevline, '\C\<data\>') + shiftwidth()
|
||||
else
|
||||
let l:s = s:indentGuard(match(l:line, '='), l:prevline)
|
||||
if l:s > 0
|
||||
return l:s
|
||||
else
|
||||
return &shiftwidth
|
||||
return shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -493,7 +493,7 @@ function! GetHaskellIndent()
|
||||
" foo
|
||||
" >>:: Int
|
||||
if l:line =~ '^\s*::\s'
|
||||
return indent(v:lnum - 1) + &shiftwidth
|
||||
return indent(v:lnum - 1) + shiftwidth()
|
||||
endif
|
||||
|
||||
" indent closing brace, paren or bracket
|
||||
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim indent script for HTML
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||
" Last Change: 2020 Dec 11
|
||||
" Last Change: 2021 Jan 26
|
||||
" Version: 1.0 "{{{
|
||||
" Description: HTML indent script with cached state for faster indenting on a
|
||||
" range of lines.
|
||||
@@ -945,11 +945,11 @@ func! s:InsideTag(foundHtmlString)
|
||||
let idx = match(text, '<' . s:tagname . '\s\+\zs\w')
|
||||
endif
|
||||
if idx == -1
|
||||
" after just "<tag" indent one level more
|
||||
" after just "<tag" indent two levels more
|
||||
let idx = match(text, '<' . s:tagname . '$')
|
||||
if idx >= 0
|
||||
call cursor(lnum, idx)
|
||||
return virtcol('.') + shiftwidth()
|
||||
call cursor(lnum, idx + 1)
|
||||
return virtcol('.') - 1 + shiftwidth() * 2
|
||||
endif
|
||||
endif
|
||||
if idx > 0
|
||||
|
||||
@@ -261,7 +261,7 @@ function GetJuliaNestingBrackets(lnum, c)
|
||||
if len(brackets_stack) > 0
|
||||
let first_open_bracket = brackets_stack[0][1]
|
||||
let last_open_bracket = brackets_stack[-1][1]
|
||||
if brackets_stack[-1][0] == 'par' && IsFunctionArgPar(a:lnum, last_open_bracket)
|
||||
if brackets_stack[-1][0] == 'par' && IsFunctionArgPar(a:lnum, last_open_bracket+1)
|
||||
let infuncargs = 1
|
||||
endif
|
||||
endif
|
||||
@@ -295,8 +295,8 @@ function IsFunctionArgPar(lnum, c)
|
||||
if a:c == 0
|
||||
return 0
|
||||
endif
|
||||
let stack = map(synstack(a:lnum, a:c-1), 'synIDattr(v:val, "name")')
|
||||
return stack[-1] == 'juliaFunctionBlock'
|
||||
let stack = map(synstack(a:lnum, a:c), 'synIDattr(v:val, "name")')
|
||||
return len(stack) >= 3 && stack[-3] == 'juliaFunctionDefP'
|
||||
endfunction
|
||||
|
||||
function JumpToMatch(lnum, last_closed_bracket)
|
||||
@@ -394,13 +394,14 @@ function GetJuliaIndent()
|
||||
let ind = indent(lnum)
|
||||
endif
|
||||
|
||||
" Does the current line starts with a closing bracket? Then depending on
|
||||
" Does the current line start with a closing bracket? Then depending on
|
||||
" the situation we align it with the opening one, or we let the rest of
|
||||
" the code figure it out (the case in which we're closing a function
|
||||
" argument list is special-cased)
|
||||
if JuliaMatch(v:lnum, getline(v:lnum), '[])}]', indent(v:lnum)) == indent(v:lnum) && ind > 0
|
||||
if !align_brackets && !align_funcargs
|
||||
let ind = -1
|
||||
call JumpToMatch(v:lnum, indent(v:lnum))
|
||||
return indent(line("."))
|
||||
elseif (align_brackets && getline(v:lnum)[indent(v:lnum)] != ')') || align_funcargs
|
||||
return ind - 1
|
||||
else " must be a ')' and align_brackets==1 and align_funcargs==0
|
||||
@@ -447,7 +448,6 @@ function GetJuliaIndent()
|
||||
" if the opening line has a colon followed by non-comments, use it as
|
||||
" reference point
|
||||
let cind = JuliaMatch(lnum, prevline, ':', indent(lnum), lim)
|
||||
" echo "cind=".string(cind) | sleep 1
|
||||
if cind >= 0
|
||||
let nonwhiteind = JuliaMatch(lnum, prevline, '\S', cind+1)
|
||||
if nonwhiteind >= 0
|
||||
|
||||
@@ -105,11 +105,16 @@ function! GetPuppetIndent(...)
|
||||
let ind = indent(s:PrevNonMultilineString(pnum - 1))
|
||||
endif
|
||||
|
||||
if pline =~ '\({\|\[\|(\|:\)\s*\(#.*\)\?$'
|
||||
let l:bracketAtEndOfLinePattern = '\({\|\[\|(\|:\)\s*\(#.*\)\?$'
|
||||
if pline =~ l:bracketAtEndOfLinePattern
|
||||
let l:i = match(pline, l:bracketAtEndOfLinePattern)
|
||||
let l:syntaxType = synIDattr(synID(pnum, l:i + 1, 0), 'name')
|
||||
if l:syntaxType !~# '\(Comment\|String\)$'
|
||||
let ind += &sw
|
||||
endif
|
||||
elseif pline =~ ';$' && pline !~ '[^:]\+:.*[=+]>.*'
|
||||
let ind -= &sw
|
||||
elseif pline =~ '^\s*include\s\+.*,$' && pline !~ '[=+]>'
|
||||
elseif pline =~# '^\s*include\s\+.*,$' && pline !~ '[=+]>'
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
|
||||
@@ -646,8 +646,7 @@ function! s:PreviousNotMSL(msl_info) abort
|
||||
" TODO (2016-10-07) Wrong/unused? How could it be "1"?
|
||||
return indent(info.plnum) - 1
|
||||
" If previous line is a continuation return its indent.
|
||||
" TODO: the || s:IsInString() thing worries me a bit.
|
||||
elseif s:Match(info.plnum, s:non_bracket_continuation_regex) || s:IsInString(info.plnum, strlen(line))
|
||||
elseif s:Match(info.plnum, s:non_bracket_continuation_regex)
|
||||
return indent(info.plnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -11,6 +11,7 @@ syn keyword jenkinsfileDirective environment options parameters triggers stage t
|
||||
|
||||
syn keyword jenkinsfileOption contained buildDiscarder disableConcurrentBuilds overrideIndexTriggers skipDefaultCheckout nextgroup=jenkinsfileOptionParams
|
||||
syn keyword jenkinsfileOption contained skipStagesAfterUnstable checkoutToSubdirectory timeout retry timestamps nextgroup=jenkinsfileOptionParams
|
||||
syn keyword jenkinsfileOption contained disableResume newContainerPerStage preserveStashes quietPeriod parallelsAlwaysFailFast nextgroup=jenkinsfileOptionParams
|
||||
syn region jenkinsfileOptionParams contained start='(' end=')' transparent contains=@groovyTop
|
||||
syn match jenkinsfileOptionO /[a-zA-Z]\+([^)]*)/ contains=jenkinsfileOption,jenkinsfileOptionParams transparent containedin=groovyParenT1
|
||||
|
||||
|
||||
@@ -4,15 +4,17 @@ endif
|
||||
|
||||
" Vim syntax file
|
||||
" Language: BASIC
|
||||
" Maintainer: Allan Kelly <allan@fruitloaf.co.uk>
|
||||
" Last Change: 2011 Dec 25 by Thilo Six
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Allan Kelly <allan@fruitloaf.co.uk>
|
||||
" Contributors: Thilo Six
|
||||
" Last Change: 2015 Jan 10
|
||||
|
||||
" First version based on Micro$soft QBASIC circa 1989, as documented in
|
||||
" 'Learn BASIC Now' by Halvorson&Rygmyr. Microsoft Press 1989.
|
||||
" This syntax file not a complete implementation yet. Send suggestions to the
|
||||
" maintainer.
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
" Prelude {{{1
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
@@ -20,7 +22,7 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" A bunch of useful BASIC keywords
|
||||
" Keywords {{{1
|
||||
syn keyword basicStatement BEEP beep Beep BLOAD bload Bload BSAVE bsave Bsave
|
||||
syn keyword basicStatement CALL call Call ABSOLUTE absolute Absolute
|
||||
syn keyword basicStatement CHAIN chain Chain CHDIR chdir Chdir
|
||||
@@ -120,32 +122,39 @@ syn keyword basicFunction RIGHT$ right$ Right$ RTRIM$ rtrim$ Rtrim$
|
||||
syn keyword basicFunction SPACE$ space$ Space$ STR$ str$ Str$
|
||||
syn keyword basicFunction STRING$ string$ String$ TIME$ time$ Time$
|
||||
syn keyword basicFunction UCASE$ ucase$ Ucase$ VARPTR$ varptr$ Varptr$
|
||||
syn keyword basicTodo contained TODO
|
||||
|
||||
"integer number, or floating point number without a dot.
|
||||
" Numbers {{{1
|
||||
" Integer number, or floating point number without a dot.
|
||||
syn match basicNumber "\<\d\+\>"
|
||||
"floating point number, with dot
|
||||
" Floating point number, with dot
|
||||
syn match basicNumber "\<\d\+\.\d*\>"
|
||||
"floating point number, starting with a dot
|
||||
" Floating point number, starting with a dot
|
||||
syn match basicNumber "\.\d\+\>"
|
||||
|
||||
" String and Character contstants
|
||||
syn match basicSpecial contained "\\\d\d\d\|\\."
|
||||
" String and Character constants {{{1
|
||||
syn match basicSpecial "\\\d\d\d\|\\." contained
|
||||
syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial
|
||||
|
||||
syn region basicComment start="REM" end="$" contains=basicTodo
|
||||
syn region basicComment start="^[ \t]*'" end="$" contains=basicTodo
|
||||
" Line numbers {{{1
|
||||
syn region basicLineNumber start="^\d" end="\s"
|
||||
syn match basicTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1
|
||||
|
||||
" Data-type suffixes {{{1
|
||||
syn match basicTypeSpecifier "[a-zA-Z0-9][$%&!#]"ms=s+1
|
||||
" Used with OPEN statement
|
||||
syn match basicFilenumber "#\d\+"
|
||||
"syn sync ccomment basicComment
|
||||
|
||||
" Mathematical operators {{{1
|
||||
" syn match basicMathsOperator "[<>+\*^/\\=-]"
|
||||
syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR"
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
" Comments {{{1
|
||||
syn keyword basicTodo TODO FIXME XXX NOTE contained
|
||||
syn region basicComment start="^\s*\zsREM\>" start="\%(:\s*\)\@<=REM\>" end="$" contains=basicTodo
|
||||
syn region basicComment start="'" end="$" contains=basicTodo
|
||||
|
||||
"syn sync ccomment basicComment
|
||||
|
||||
" Default Highlighting {{{1
|
||||
hi def link basicLabel Label
|
||||
hi def link basicConditional Conditional
|
||||
hi def link basicRepeat Repeat
|
||||
@@ -162,9 +171,10 @@ hi def link basicTypeSpecifier Type
|
||||
hi def link basicFilenumber basicTypeSpecifier
|
||||
"hi basicMathsOperator term=bold cterm=bold gui=bold
|
||||
|
||||
|
||||
" Postscript {{{1
|
||||
let b:current_syntax = "basic"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
" vim: ts=8
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
|
||||
@@ -16,6 +16,8 @@ syntax region typescriptTemplateSubstitution matchgroup=typescriptTemplateSB
|
||||
syntax region typescriptString
|
||||
\ start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ end=+$+
|
||||
\ contains=typescriptSpecial,@Spell
|
||||
\ nextgroup=@typescriptSymbols
|
||||
\ skipwhite skipempty
|
||||
\ extend
|
||||
|
||||
syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{1,6}})|c\u|.)"
|
||||
@@ -42,4 +44,4 @@ syntax match typescriptNumber /\<0[bB][01][01_]*\>/ nextgroup=@typescript
|
||||
syntax match typescriptNumber /\<0[oO][0-7][0-7_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
|
||||
syntax match typescriptNumber /\<0[xX][0-9a-fA-F][0-9a-fA-F_]*\>/ nextgroup=@typescriptSymbols skipwhite skipempty
|
||||
syntax match typescriptNumber /\<\%(\d[0-9_]*\%(\.\d[0-9_]*\)\=\|\.\d[0-9_]*\)\%([eE][+-]\=\d[0-9_]*\)\=\>/
|
||||
\ nextgroup=typescriptSymbols skipwhite skipempty
|
||||
\ nextgroup=@typescriptSymbols skipwhite skipempty
|
||||
|
||||
@@ -132,7 +132,7 @@ syntax region typescriptGenericFunc matchgroup=typescriptTypeBrackets
|
||||
\ contained skipwhite skipnl
|
||||
|
||||
syntax region typescriptFuncType matchgroup=typescriptParens
|
||||
\ start=/(/ end=/)\s*=>/me=e-2
|
||||
\ start=/(\(\k\+:\|)\)\@=/ end=/)\s*=>/me=e-2
|
||||
\ contains=@typescriptParameterList
|
||||
\ nextgroup=typescriptFuncTypeArrow
|
||||
\ contained skipwhite skipnl oneline
|
||||
@@ -142,7 +142,6 @@ syntax match typescriptFuncTypeArrow /=>/
|
||||
\ containedin=typescriptFuncType
|
||||
\ contained skipwhite skipnl
|
||||
|
||||
|
||||
syntax keyword typescriptConstructorType new
|
||||
\ nextgroup=@typescriptFunctionType
|
||||
\ contained skipwhite skipnl
|
||||
|
||||
28
syntax/c.vim
28
syntax/c.vim
@@ -5,7 +5,7 @@ endif
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2019 Nov 29
|
||||
" Last Change: 2021 Jan 11
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -17,6 +17,9 @@ set cpo&vim
|
||||
|
||||
let s:ft = matchstr(&ft, '^\([^.]\)\+')
|
||||
|
||||
" check if this was included from cpp.vim
|
||||
let s:in_cpp_family = exists("b:filetype_in_cpp_family")
|
||||
|
||||
" Optional embedded Autodoc parsing
|
||||
" To enable it add: let g:c_autodoc = 1
|
||||
" to your .vimrc
|
||||
@@ -59,7 +62,7 @@ if !exists("c_no_cformat")
|
||||
endif
|
||||
|
||||
" cCppString: same as cString, but ends at end of line
|
||||
if s:ft ==# "cpp" && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
|
||||
" ISO C++11
|
||||
syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
||||
syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
||||
@@ -91,7 +94,7 @@ syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
|
||||
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
|
||||
syn match cSpecialCharacter display "L'\\x\x\+'"
|
||||
|
||||
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11"))
|
||||
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:in_cpp_family && !exists("cpp_no_cpp11"))
|
||||
" ISO C11 or ISO C++ 11
|
||||
if exists("c_no_cformat")
|
||||
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
||||
@@ -134,7 +137,7 @@ endif
|
||||
" But avoid matching <::.
|
||||
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
|
||||
if exists("c_no_curly_error")
|
||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11")
|
||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||
@@ -148,7 +151,7 @@ if exists("c_no_curly_error")
|
||||
syn match cErrInParen display contained "^[{}]\|^<%\|^%>"
|
||||
endif
|
||||
elseif exists("c_no_bracket_error")
|
||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11")
|
||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||
@@ -162,7 +165,7 @@ elseif exists("c_no_bracket_error")
|
||||
syn match cErrInParen display contained "[{}]\|<%\|%>"
|
||||
endif
|
||||
else
|
||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||
if s:in_cpp_family && !exists("cpp_no_cpp11")
|
||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
|
||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
||||
@@ -276,12 +279,13 @@ if exists("c_gnu")
|
||||
syn keyword cType __label__ __complex__ __volatile__
|
||||
endif
|
||||
|
||||
syn keyword cStructure struct union enum typedef
|
||||
syn keyword cTypedef typedef
|
||||
syn keyword cStructure struct union enum
|
||||
syn keyword cStorageClass static register auto volatile extern const
|
||||
if exists("c_gnu")
|
||||
syn keyword cStorageClass inline __attribute__
|
||||
endif
|
||||
if !exists("c_no_c99") && s:ft !=# 'cpp'
|
||||
if !exists("c_no_c99") && !s:in_cpp_family
|
||||
syn keyword cStorageClass inline restrict
|
||||
endif
|
||||
if !exists("c_no_c11")
|
||||
@@ -315,8 +319,7 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
|
||||
if exists("c_gnu")
|
||||
syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__
|
||||
endif
|
||||
syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__
|
||||
syn keyword cConstant __STDC_VERSION__
|
||||
syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ __STDC_VERSION__ __STDC_HOSTED__
|
||||
syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX
|
||||
syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
|
||||
syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN
|
||||
@@ -350,6 +353,8 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
|
||||
syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2
|
||||
syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF FOPEN_MAX FILENAME_MAX L_tmpnam
|
||||
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET TMP_MAX stderr stdin stdout EXIT_FAILURE EXIT_SUCCESS RAND_MAX
|
||||
" used in assert.h
|
||||
syn keyword cConstant NDEBUG
|
||||
" POSIX 2001
|
||||
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG SIGVTALRM SIGXCPU SIGXFSZ
|
||||
" non-POSIX signals
|
||||
@@ -422,7 +427,7 @@ endif
|
||||
syn cluster cLabelGroup contains=cUserLabel
|
||||
syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
||||
if s:ft ==# 'cpp'
|
||||
if s:in_cpp_family
|
||||
syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
else
|
||||
@@ -479,6 +484,7 @@ hi def link cSpecialError cError
|
||||
hi def link cCurlyError cError
|
||||
hi def link cOperator Operator
|
||||
hi def link cStructure Structure
|
||||
hi def link cTypedef Structure
|
||||
hi def link cStorageClass StorageClass
|
||||
hi def link cInclude Include
|
||||
hi def link cPreProc PreProc
|
||||
|
||||
@@ -25,7 +25,7 @@ syn match cabalDocBulletPoint "^\s\+\*"
|
||||
syn match cabalDocHeadline "^\s\+=.*$"
|
||||
syn match cabalDocCode "^\s\+>.*$"
|
||||
syn match cabalDocNewline "^\s\+\.\s*$"
|
||||
syn match cabalSection "^\c\(executable\|library\|flag\|source-repository\|test-suite\|benchmark\)"
|
||||
syn match cabalSection "^\c\(executable\|library\|flag\|source-repository\|test-suite\|benchmark\|common\)"
|
||||
syn match cabalEntry "^\s*[A-Za-z][a-zA-Z\-]*:" contains=cabalIdentifier,cabalColon
|
||||
|
||||
syn region cabalDescription start="^\s*[dD]escription:" end="^\<" keepend
|
||||
|
||||
@@ -33,6 +33,7 @@ syn keyword carpSyntax str* println* break doc sig hidden private
|
||||
syn keyword carpSyntax while-do const-assert save-docs defproject
|
||||
syn keyword carpSyntax relative-include not-on-windows load-and-use
|
||||
syn keyword carpSyntax deftest
|
||||
syn keyword carpSyntax quasiquote unquote unquote-splicing
|
||||
syn match carpSyntax "\vc(a|d){1,4}r"
|
||||
|
||||
syn keyword carpFunc λ
|
||||
@@ -55,7 +56,7 @@ syn keyword carpFunc string-join free sleep-seconds sleep-micros substitute
|
||||
syn keyword carpFunc neg to-float match matches? find global-match match-str
|
||||
syn keyword carpFunc from-float tan asin atan cosh sinh tanh exp frexp ldexp
|
||||
syn keyword carpFunc log log10 modf pow ceil clamp approx refstr foreach
|
||||
syn keyword carpFunc => ==> repeat nth replicate range raw aset aset!
|
||||
syn keyword carpFunc -> --> => ==> repeat nth replicate range raw aset aset!
|
||||
syn keyword carpFunc push-back pop-back sort index-of element-count
|
||||
syn keyword carpFunc apply unsafe-from from just? nothing? ptr from-ptr
|
||||
syn keyword carpFunc map and-then unwrap-or-zero or-else unwrap-or-else
|
||||
@@ -126,6 +127,13 @@ syn match carpComment /;.*$/ contains=@Spell
|
||||
syn region carpQuoted matchgroup=Delimiter start="#['`]"rs=s+2 end=![ \t()\[\]";]!re=e-1,me=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal
|
||||
syn region carpQuoted matchgroup=Delimiter start="#['`]("rs=s+3 matchgroup=Delimiter end=")"re=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal
|
||||
|
||||
syn region carpUnquote matchgroup=Delimiter start="%"rs=s+1 end=![ \t\[\]()";]!re=e-1,me=e-1 contained contains=@carpNormal
|
||||
syn region carpUnquote matchgroup=Delimiter start="%@"rs=s+2 end=![ \t\[\]()";]!re=e-1,me=e-1 contained contains=@carpNormal
|
||||
syn region carpUnquote matchgroup=Delimiter start="%@("rs=s+2 end=")"re=e-1 contained contains=@carpNormal
|
||||
syn region carpUnquote matchgroup=Delimiter start="%("rs=s+2 end=")"re=e-1 contained contains=@carpNormal
|
||||
|
||||
syn cluster carpQuotedStuff add=carpUnquote
|
||||
|
||||
syn cluster carpNormal add=carpQuoted,carpComment
|
||||
syn cluster carpQuotedOrNormal add=carpComment
|
||||
|
||||
|
||||
@@ -6,13 +6,16 @@ endif
|
||||
" Language: C++
|
||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
||||
" Last Change: 2017 Jun 05
|
||||
" Last Change: 2021 Jan 12
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" inform C syntax that the file was included from cpp.vim
|
||||
let b:filetype_in_cpp_family = 1
|
||||
|
||||
" Read the C syntax to start with
|
||||
runtime! syntax/c.vim
|
||||
unlet b:current_syntax
|
||||
@@ -59,12 +62,6 @@ if !exists("cpp_no_cpp14")
|
||||
syn case match
|
||||
endif
|
||||
|
||||
" C++ 17 extensions
|
||||
if !exists("cpp_no_cpp17")
|
||||
syn match cppCast "\<reinterpret_pointer_cast\s*<"me=e-1
|
||||
syn match cppCast "\<reinterpret_pointer_cast\s*$"
|
||||
endif
|
||||
|
||||
" C++ 20 extensions
|
||||
if !exists("cpp_no_cpp20")
|
||||
syn keyword cppStatement co_await co_return co_yield requires
|
||||
@@ -74,6 +71,12 @@ if !exists("cpp_no_cpp20")
|
||||
syn keyword cppModule import module export
|
||||
endif
|
||||
|
||||
" C++ 17 extensions
|
||||
if !exists("cpp_no_cpp17")
|
||||
syn match cppCast "\<reinterpret_pointer_cast\s*<"me=e-1
|
||||
syn match cppCast "\<reinterpret_pointer_cast\s*$"
|
||||
endif
|
||||
|
||||
" The minimum and maximum operators in GNU C++
|
||||
syn match cppMinMax "[<>]?"
|
||||
|
||||
|
||||
@@ -95,8 +95,6 @@ syn match crystalStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C
|
||||
syn region crystalInterpolation matchgroup=crystalInterpolationDelim start="#{" end="}" contained contains=TOP
|
||||
syn region crystalNoInterpolation start="\\#{" end="}" contained
|
||||
syn match crystalNoInterpolation "\\#{" display contained
|
||||
syn match crystalNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained
|
||||
syn match crystalNoInterpolation "\\#\$\W" display contained
|
||||
|
||||
syn match crystalDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE
|
||||
|
||||
@@ -261,10 +259,10 @@ syn cluster crystalDeclaration contains=crystalAliasDeclaration,crystalAliasDecl
|
||||
" Note: the following keywords have already been defined:
|
||||
" begin case class def do end for if module unless until while
|
||||
syn match crystalControl "\<\%(break\|next\|rescue\|return\)\>[?!]\@!"
|
||||
syn match crystalKeyword "\<\%(super\|previous_def\|yield\|of\|with\|uninitialized\|union\)\>[?!]\@!"
|
||||
syn match crystalKeyword "\<\%(super\|previous_def\|yield\|of\|with\|uninitialized\|union\|out\)\>[?!]\@!"
|
||||
syn match crystalBoolean "\<\%(true\|false\)\>[?!]\@!"
|
||||
syn match crystalPseudoVariable "\<\%(nil\|__DIR__\|__FILE__\|__LINE__\|__END_LINE__\)\>[?!]\@!" " TODO: reorganise
|
||||
syn match crystalPseudoVariable "\<self\>"
|
||||
syn match crystalPseudoVariable "\<self\>[?!]\@!"
|
||||
|
||||
" Expensive Mode - match 'end' with the appropriate opening keyword for syntax
|
||||
" based folding and special highlighting of module/class/method definitions
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'puppet', 'syntax/embeddedpuppet.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'puppet', 'syntax/epuppet.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -29,5 +29,5 @@ syn region ePuppetComment matchgroup=ePuppetDelimiter start="<%-\=#" end=
|
||||
hi def link ePuppetDelimiter PreProc
|
||||
hi def link ePuppetComment Comment
|
||||
|
||||
let b:current_syntax = "embeddedpuppet"
|
||||
let b:current_syntax = "epuppet"
|
||||
|
||||
@@ -6,9 +6,9 @@ endif
|
||||
" Language: Groovy
|
||||
" Original Author: Alessio Pace <billy.corgan AT tiscali.it>
|
||||
" Maintainer: Tobias Rapp <yahuxo+vim AT mailbox.org>
|
||||
" Version: 0.1.17
|
||||
" Version: 0.1.18
|
||||
" URL: http://www.vim.org/scripts/script.php?script_id=945
|
||||
" Last Change: 2020 May 26
|
||||
" Last Change: 2021 Feb 03
|
||||
|
||||
" THE ORIGINAL AUTHOR'S NOTES:
|
||||
"
|
||||
@@ -257,7 +257,8 @@ if exists("groovy_regex_strings")
|
||||
endif
|
||||
" syn region groovyELExpr start=+${+ end=+}+ keepend contained
|
||||
syn match groovyELExpr /\${.\{-}}/ contained
|
||||
syn match groovyELExpr /\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained
|
||||
" Fix: force use of the NFA regexp engine (2), see GitHub issue #7280
|
||||
syn match groovyELExpr /\%#=2\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained
|
||||
hi def link groovyELExpr Identifier
|
||||
|
||||
" TODO: better matching. I am waiting to understand how it really works in groovy
|
||||
|
||||
@@ -40,7 +40,12 @@ syn match haskellTypeSig
|
||||
\ haskellParens
|
||||
syn keyword haskellWhere where
|
||||
syn keyword haskellLet let
|
||||
syn match HaskellDerive "\<deriving\>\(\s\+\<\(anyclass\|instance\|newtype\|stock\)\>\)\?"
|
||||
syn keyword haskellDeriveKeyword deriving anyclass instance newtype stock via contained
|
||||
syn match haskellDerive "deriving\(\s\+instance\)\?\(\s\+anyclass\|\s\+newtype\|\s\+stock\|\s\+.\{-}\_s\+via\)\?"
|
||||
\ contains=
|
||||
\ haskellDeriveKeyword,
|
||||
\ haskellParens,
|
||||
\ haskellType
|
||||
syn keyword haskellDeclKeyword module class instance newtype in
|
||||
syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?"
|
||||
syn keyword haskellDefault default
|
||||
@@ -67,8 +72,8 @@ if get(g:, 'haskell_enable_static_pointers', 0)
|
||||
syn keyword haskellStatic static
|
||||
endif
|
||||
syn keyword haskellConditional if then else
|
||||
syn match haskellNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>\|\<0[bB][10]\+\>"
|
||||
syn match haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
|
||||
syn match haskellNumber "\<[0-9]\+\>\|\<[0-9_]\+\>\|\<0[xX][0-9a-fA-F_]\+\>\|\<0[oO][0-7_]\+\>\|\<0[bB][10_]\+\>"
|
||||
syn match haskellFloat "\<[0-9]\+\.[0-9_]\+\([eE][-+]\=[0-9_]\+\)\=\>"
|
||||
syn match haskellSeparator "[,;]"
|
||||
syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP,haskellTypeSig,@Spell
|
||||
syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP,haskellTypeSig,@Spell
|
||||
@@ -94,7 +99,7 @@ syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
|
||||
syn match haskellBacktick "`[A-Za-z_][A-Za-z0-9_\.']*#\?`"
|
||||
syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
\ contains=@Spell
|
||||
syn match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained
|
||||
syn match haskellIdentifier "[_a-z][a-zA-Z0-9_']*" contained
|
||||
syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>"
|
||||
syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>"
|
||||
syn region haskellBlockComment start="{-" end="-}"
|
||||
@@ -110,7 +115,7 @@ syn keyword haskellTodo TODO FIXME contained
|
||||
syn match haskellShebang "\%^#!.*$"
|
||||
if !get(g:, 'haskell_disable_TH', 0)
|
||||
syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained
|
||||
syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-zA-Z][a-zA-z0-9._']*|" end="|\]"
|
||||
syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-zA-Z][a-zA-Z0-9._']*|" end="|\]"
|
||||
syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP
|
||||
syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP
|
||||
endif
|
||||
@@ -165,13 +170,13 @@ highlight def link haskellType Type
|
||||
highlight def link haskellImportKeywords Include
|
||||
if get(g:, 'haskell_classic_highlighting', 0)
|
||||
highlight def link haskellDeclKeyword Keyword
|
||||
highlight def link HaskellDerive Keyword
|
||||
highlight def link haskellDeriveKeyword Keyword
|
||||
highlight def link haskellDecl Keyword
|
||||
highlight def link haskellWhere Keyword
|
||||
highlight def link haskellLet Keyword
|
||||
else
|
||||
highlight def link haskellDeclKeyword Structure
|
||||
highlight def link HaskellDerive Structure
|
||||
highlight def link haskellDeriveKeyword Structure
|
||||
highlight def link haskellDecl Structure
|
||||
highlight def link haskellWhere Structure
|
||||
highlight def link haskellLet Structure
|
||||
|
||||
@@ -4,11 +4,11 @@ endif
|
||||
|
||||
" Vim syntax file
|
||||
" Language: HTML
|
||||
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
||||
" Last Change: 2020 Mar 17
|
||||
" Included patch from Florian Breisch to add the summary element
|
||||
" Last Change: 2021 Feb 25
|
||||
" Included patch #7900 to fix comments
|
||||
"
|
||||
|
||||
" Please check :help html.vim for some comments and a description of the options
|
||||
@@ -145,9 +145,21 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||
if exists("html_wrong_comments")
|
||||
syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
|
||||
else
|
||||
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError,@Spell
|
||||
" The HTML 5.2 syntax 8.2.4.41-42: bogus comment is parser error; browser skips until next >
|
||||
" Note: must stand first to get lesser :syn-priority
|
||||
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentError
|
||||
" Normal comment opening <!-- ...>
|
||||
syn region htmlComment start=+<!--+ end=+>+ contains=htmlCommentPart,@Spell
|
||||
" Idem 8.2.4.43-44: <!--> and <!---> are parser errors; browser treats as comments
|
||||
syn match htmlComment "<!---\?>" contains=htmlCommentError
|
||||
" Idem 8.2.4.51: any number of consecutive dashes within comment is okay; --> closes comment
|
||||
" Idem 8.2.4.52: closing comment by dash-dash-bang (--!>) is error ignored by parser(!); closes comment
|
||||
syn region htmlCommentPart contained start=+--+ end=+--!\?>+me=e-1 contains=htmlCommentNested,@htmlPreProc,@Spell
|
||||
" Idem 8.2.4.49: opening nested comment <!-- is parser error, ignored by browser, except <!--> is all right
|
||||
syn match htmlCommentNested contained "<!--[^>]"me=e-1
|
||||
syn match htmlCommentNested contained "<!--->"me=e-3
|
||||
syn match htmlCommentNested contained "<!---\?!>"me=e-4
|
||||
syn match htmlCommentError contained "[^><!]"
|
||||
syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell
|
||||
endif
|
||||
syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
|
||||
|
||||
@@ -321,6 +333,7 @@ hi def link htmlStatement Statement
|
||||
hi def link htmlComment Comment
|
||||
hi def link htmlCommentPart Comment
|
||||
hi def link htmlValue String
|
||||
hi def link htmlCommentNested htmlCommentError
|
||||
hi def link htmlCommentError htmlError
|
||||
hi def link htmlTagError htmlError
|
||||
hi def link htmlEvent javaScript
|
||||
|
||||
@@ -143,7 +143,7 @@ exec 'syntax region juliaConditionalEBlock matchgroup=juliaConditional transpar
|
||||
exec 'syntax region juliaWhileBlock matchgroup=juliaRepeat start="'.s:nodot.'\<while\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||
exec 'syntax region juliaForBlock matchgroup=juliaRepeat start="'.s:nodot.'\<for\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions,juliaOuter fold'
|
||||
exec 'syntax region juliaBeginBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<begin\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||
exec 'syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<function\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||
exec 'syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<function\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions,juliaFunctionDef,juliaFunctionDefP fold'
|
||||
exec 'syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<macro\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||
exec 'syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<quote\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||
exec 'syntax region juliaStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
|
||||
@@ -201,6 +201,10 @@ syntax match juliaConstIO display "\<\%(std\%(out\|in\|err\)\|devnull\)\>"
|
||||
syntax match juliaConstC display "\<\%(C_NULL\)\>"
|
||||
syntax match juliaConstGeneric display "\<\%(nothing\|Main\|undef\|missing\)\>"
|
||||
|
||||
exec 'syntax match juliaFunctionDef contained transparent "\%(\<function\s\+\)\@'.s:d(20).'<=' . s:idregex . '\%(\.' . s:idregex . '\)*\ze\s\+\%(end\>\|$\)" contains=juliaFunctionName'
|
||||
exec 'syntax region juliaFunctionDefP contained transparent start="\%(\<function\s\+\)\@'.s:d(20).'<=' . s:idregex . '\%(\.' . s:idregex . '\)*\s*(" end=")\@'.s:d(1).'<=" contains=juliaFunctionName,juliaParBlock'
|
||||
exec 'syntax match juliaFunctionName contained "\%(\<function\s\+\)\@'.s:d(20).'<=' . s:idregex . '\%(\.' . s:idregex . '\)*"'
|
||||
|
||||
syntax match juliaPossibleMacro transparent "@" contains=juliaMacroCall,juliaMacroCallP,juliaPrintfMacro
|
||||
|
||||
exec 'syntax match juliaMacro contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
|
||||
@@ -369,6 +373,7 @@ hi def link juliaComma juliaNone
|
||||
|
||||
hi def link juliaColon juliaOperator
|
||||
|
||||
hi def link juliaFunctionName juliaFunction
|
||||
hi def link juliaMacroName juliaMacro
|
||||
|
||||
|
||||
@@ -423,6 +428,7 @@ hi def link juliaComprehensionIf Keyword
|
||||
|
||||
hi def link juliaDollarVar Identifier
|
||||
|
||||
hi def link juliaFunction Function
|
||||
hi def link juliaMacro Macro
|
||||
hi def link juliaSymbol Identifier
|
||||
hi def link juliaSymbolS Identifier
|
||||
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim syntax file
|
||||
" Language: Kotlin
|
||||
" Maintainer: Alexander Udalov
|
||||
" Latest Revision: 13 July 2020
|
||||
" Latest Revision: 17 February 2021
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
@@ -33,21 +33,21 @@ syn keyword ktType ExperimentalTime ExperimentalTypeInference ExperimentalUnsign
|
||||
syn keyword ktType FileWalkDirection Float FloatArray FloatIterator Function Function0 Function1 Function10 Function11 Function12 Function13 Function14 Function15 Function16
|
||||
syn keyword ktType Function17 Function18 Function19 Function2 Function20 Function21 Function22 Function3 Function4 Function5 Function6 Function7 Function8 Function9 FunctionN
|
||||
syn keyword ktType Getter Grouping HashMap HashSet IllegalArgumentException IllegalStateException IndexOutOfBoundsException IndexedValue Int IntArray IntIterator IntProgression
|
||||
syn keyword ktType IntRange InvocationKind Iterable Iterator JsExport JsName JvmDefault JvmDefaultWithoutCompatibility JvmField JvmMultifileClass JvmName JvmOverloads JvmStatic
|
||||
syn keyword ktType JvmSuppressWildcards JvmSynthetic JvmWildcard KAnnotatedElement KCallable KClass KClassifier KDeclarationContainer KFunction KMutableProperty KMutableProperty0
|
||||
syn keyword ktType KMutableProperty1 KMutableProperty2 KParameter KProperty KProperty0 KProperty1 KProperty2 KType KTypeParameter KTypeProjection KVariance KVisibility Key Kind
|
||||
syn keyword ktType KotlinNullPointerException KotlinReflectionNotSupportedError KotlinVersion Lazy LazyThreadSafetyMode Level LinkedHashMap LinkedHashSet List ListIterator Long
|
||||
syn keyword ktType LongArray LongIterator LongProgression LongRange Map MatchGroup MatchGroupCollection MatchNamedGroupCollection MatchResult Metadata Monotonic MustBeDocumented
|
||||
syn keyword ktType MutableCollection MutableEntry MutableIterable MutableIterator MutableList MutableListIterator MutableMap MutableSet NoSuchElementException NoSuchFileException
|
||||
syn keyword ktType NoWhenBranchMatchedException NotImplementedError Nothing NullPointerException Number NumberFormatException ObservableProperty OnErrorAction OptIn
|
||||
syn keyword ktType OptionalExpectation OverloadResolutionByLambdaReturnType Pair ParameterName PropertyDelegateProvider PublishedApi PurelyImplements Random RandomAccess
|
||||
syn keyword ktType IntRange InvocationKind Iterable Iterator JsExport JsName JvmDefault JvmDefaultWithoutCompatibility JvmField JvmInline JvmMultifileClass JvmName JvmOverloads
|
||||
syn keyword ktType JvmRecord JvmStatic JvmSuppressWildcards JvmSynthetic JvmWildcard KAnnotatedElement KCallable KClass KClassifier KDeclarationContainer KFunction KMutableProperty
|
||||
syn keyword ktType KMutableProperty0 KMutableProperty1 KMutableProperty2 KParameter KProperty KProperty0 KProperty1 KProperty2 KType KTypeParameter KTypeProjection KVariance
|
||||
syn keyword ktType KVisibility Key Kind KotlinNullPointerException KotlinReflectionNotSupportedError KotlinVersion Lazy LazyThreadSafetyMode Level LinkedHashMap LinkedHashSet List
|
||||
syn keyword ktType ListIterator Long LongArray LongIterator LongProgression LongRange Map MatchGroup MatchGroupCollection MatchNamedGroupCollection MatchResult Metadata Monotonic
|
||||
syn keyword ktType MustBeDocumented MutableCollection MutableEntry MutableIterable MutableIterator MutableList MutableListIterator MutableMap MutableSet NoSuchElementException
|
||||
syn keyword ktType NoSuchFileException NoWhenBranchMatchedException NotImplementedError Nothing NullPointerException Number NumberFormatException ObservableProperty OnErrorAction
|
||||
syn keyword ktType OptIn OptionalExpectation OverloadResolutionByLambdaReturnType Pair ParameterName PropertyDelegateProvider PublishedApi PurelyImplements Random RandomAccess
|
||||
syn keyword ktType ReadOnlyProperty ReadWriteProperty Regex RegexOption Repeatable ReplaceWith RequiresOptIn RestrictsSuspension Result Retention Returns ReturnsNotNull
|
||||
syn keyword ktType RuntimeException Sequence SequenceScope Set Setter SharedImmutable Short ShortArray ShortIterator SimpleEffect SinceKotlin Strictfp String StringBuilder Suppress
|
||||
syn keyword ktType Synchronized Target TestTimeSource ThreadLocal Throwable Throws TimeMark TimeSource TimedValue Transient Triple TypeCastException Typography UByte UByteArray
|
||||
syn keyword ktType UByteIterator UInt UIntArray UIntIterator UIntProgression UIntRange ULong ULongArray ULongIterator ULongProgression ULongRange UShort UShortArray UShortIterator
|
||||
syn keyword ktType UninitializedPropertyAccessException Unit UnsafeVariance UnsupportedOperationException UseExperimental Volatile
|
||||
|
||||
syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic expect actual
|
||||
syn keyword ktModifier annotation companion enum inner abstract final open override sealed vararg dynamic expect actual
|
||||
syn keyword ktStructure class object interface typealias fun val var constructor init
|
||||
|
||||
syn keyword ktReservedKeyword typeof
|
||||
@@ -55,7 +55,13 @@ syn keyword ktReservedKeyword typeof
|
||||
syn keyword ktBoolean true false
|
||||
syn keyword ktConstant null
|
||||
|
||||
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix suspend
|
||||
syn keyword ktModifier reified external inline noinline crossinline
|
||||
|
||||
syn match ktModifier "\v<(data|value)>\ze\@=.*<class>"
|
||||
syn match ktModifier "\v<(tailrec|operator|infix|suspend)>\ze\@=.*<fun>"
|
||||
syn match ktModifier "\v<(const)>\ze\@=.*<val>"
|
||||
syn match ktModifier "\v<(lateinit)>\ze\@=.*<var>"
|
||||
syn match ktModifier "\v<(internal|private|protected|public)>\ze\@=.*<(class|fun|val|var|typealias)>"
|
||||
|
||||
syn match ktOperator "\v\?:|::|\<\=? | \>\=?|[!=]\=\=?|<as>\??|[-!%&*+/|]"
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ endif
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Haskell with literate comments, Bird style,
|
||||
" TeX style and plain text surrounding
|
||||
" Markdown style, TeX style and plain text surrounding
|
||||
" \begin{code} \end{code} blocks
|
||||
" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
|
||||
" Original Author: Arthur van Leeuwen <arthurvl@cs.uu.nl>
|
||||
" Last Change: 2010 Apr 11
|
||||
" Version: 1.04
|
||||
" Last Change: 2020 Feb 25
|
||||
" Version: 1.05
|
||||
"
|
||||
" Thanks to Ian Lynagh for thoughtful comments on initial versions and
|
||||
" for the inspiration for writing this in the first place.
|
||||
@@ -48,8 +48,8 @@ endif
|
||||
" First off, see if we can inherit a user preference for lhs_markup
|
||||
if !exists("b:lhs_markup")
|
||||
if exists("lhs_markup")
|
||||
if lhs_markup =~ '\<\%(tex\|none\)\>'
|
||||
let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|none\)\>')
|
||||
if lhs_markup =~ '\<\%(tex\|md\|none\)\>'
|
||||
let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|md\|none\)\>')
|
||||
else
|
||||
echohl WarningMsg | echo "Unknown value of lhs_markup" | echohl None
|
||||
let b:lhs_markup = "unknown"
|
||||
@@ -58,7 +58,7 @@ if !exists("b:lhs_markup")
|
||||
let b:lhs_markup = "unknown"
|
||||
endif
|
||||
else
|
||||
if b:lhs_markup !~ '\<\%(tex\|none\)\>'
|
||||
if b:lhs_markup !~ '\<\%(tex\|md\|none\)\>'
|
||||
let b:lhs_markup = "unknown"
|
||||
endif
|
||||
endif
|
||||
@@ -78,6 +78,8 @@ call cursor(1,1)
|
||||
if b:lhs_markup == "unknown"
|
||||
if search('\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub\)*section\|\\chapter|\\part','W') != 0
|
||||
let b:lhs_markup = "tex"
|
||||
elseif search('```haskell','W') != 0
|
||||
let b:lhs_markup = "md"
|
||||
else
|
||||
let b:lhs_markup = "plain"
|
||||
endif
|
||||
@@ -90,6 +92,10 @@ if b:lhs_markup == "tex"
|
||||
" Tex.vim removes "_" from 'iskeyword', but we need it for Haskell.
|
||||
setlocal isk+=_
|
||||
syntax cluster lhsTeXContainer contains=tex.*Zone,texAbstract
|
||||
elseif b:lhs_markup == "md"
|
||||
runtime! syntax/markdown.vim
|
||||
unlet b:current_syntax
|
||||
syntax cluster lhsTeXContainer contains=markdown.*
|
||||
else
|
||||
syntax cluster lhsTeXContainer contains=.*
|
||||
endif
|
||||
@@ -100,9 +106,12 @@ syntax include @haskellTop syntax/haskell.vim
|
||||
|
||||
syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack containedin=@lhsTeXContainer
|
||||
syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,beginCodeBegin containedin=@lhsTeXContainer
|
||||
syntax region lhsHaskellMDBlock start="^```haskell$" matchgroup=NONE end="^```$" keepend contains=@haskellTop,lhsMarkdownCode containedin=@lhsTeXContainer
|
||||
|
||||
syntax match lhsBirdTrack "^>" contained
|
||||
|
||||
syntax match lhsMarkdownCode "^\(```haskell\|^```\)$" contained
|
||||
|
||||
syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained
|
||||
syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
|
||||
|
||||
@@ -111,6 +120,8 @@ syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
|
||||
|
||||
hi def link lhsBirdTrack Comment
|
||||
|
||||
hi def link lhsMarkdownCode Comment
|
||||
|
||||
hi def link beginCodeBegin texCmdName
|
||||
hi def link beginCodeCode texSection
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ endif
|
||||
" Latest Revision: 2008-06-29
|
||||
" Changes: 2008-06-29 support for RFC3339 tuimestamps James Vega
|
||||
" 2016 Jan 19: messagesDate changed by Bram
|
||||
" 2021 Jan 27: messagesHourRFC3339 changed from #946
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -30,7 +31,7 @@ syn match messagesDateRFC3339 contained display '\d\{4}-\d\d-\d\d'
|
||||
syn match messagesRFC3339T contained display '\cT'
|
||||
\ nextgroup=messagesHourRFC3339
|
||||
|
||||
syn match messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)'
|
||||
syn match messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)\s*'
|
||||
\ nextgroup=messagesHost
|
||||
|
||||
syn match messagesHost contained display '\S*\s*'
|
||||
|
||||
@@ -2280,7 +2280,6 @@ hi link ngxComment Comment
|
||||
hi link ngxVariable Identifier
|
||||
hi link ngxVariableBlock Identifier
|
||||
hi link ngxVariableString PreProc
|
||||
hi link ngxBlock Normal
|
||||
hi link ngxString String
|
||||
hi link ngxIPaddr Delimiter
|
||||
hi link ngxBoolean Boolean
|
||||
|
||||
@@ -88,10 +88,10 @@ syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlMo
|
||||
|
||||
|
||||
" Enclosing delimiters
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeyword start="(" matchgroup=ocamlKeyword end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeyword start="{" matchgroup=ocamlKeyword end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[" matchgroup=ocamlKeyword end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[|" matchgroup=ocamlKeyword end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="(" matchgroup=ocamlKeywordDelimiter end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="{" matchgroup=ocamlKeywordDelimiter end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="\[" matchgroup=ocamlKeywordDelimiter end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="\[|" matchgroup=ocamlKeywordDelimiter end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr
|
||||
|
||||
|
||||
" Comments
|
||||
@@ -196,10 +196,10 @@ syn keyword ocamlType array bool char exn float format format4
|
||||
syn keyword ocamlType int int32 int64 lazy_t list nativeint option
|
||||
syn keyword ocamlType bytes string unit
|
||||
|
||||
syn match ocamlConstructor "(\s*)"
|
||||
syn match ocamlConstructor "\[\s*\]"
|
||||
syn match ocamlConstructor "\[|\s*>|]"
|
||||
syn match ocamlConstructor "\[<\s*>\]"
|
||||
syn match ocamlConstructorDelimiter "(\s*)"
|
||||
syn match ocamlConstructorDelimiter "\[\s*\]"
|
||||
syn match ocamlConstructorDelimiter "\[|\s*>|]"
|
||||
syn match ocamlConstructorDelimiter "\[<\s*>\]"
|
||||
syn match ocamlConstructor "\u\(\w\|'\)*\>"
|
||||
|
||||
" Polymorphic variants
|
||||
@@ -343,11 +343,13 @@ hi def link ocamlStructEncl ocamlModule
|
||||
hi def link ocamlScript Include
|
||||
|
||||
hi def link ocamlConstructor Constant
|
||||
hi def link ocamlConstructorDelimiter ocamlConstructor
|
||||
|
||||
hi def link ocamlVal Keyword
|
||||
hi def link ocamlModPreRHS Keyword
|
||||
hi def link ocamlMPRestr2 Keyword
|
||||
hi def link ocamlKeyword Keyword
|
||||
hi def link ocamlKeywordDelimiter ocamlKeyword
|
||||
hi def link ocamlMethod Include
|
||||
hi def link ocamlArrow Keyword
|
||||
hi def link ocamlKeyChar Keyword
|
||||
|
||||
@@ -9,7 +9,7 @@ endif
|
||||
" License: Vim license (see `:help license`)
|
||||
|
||||
" Based on PostgreSQL 13.1
|
||||
" Automatically generated on 2021-01-13 at 20:54:21
|
||||
" Automatically generated on 2021-02-07 at 10:45:10
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -17,7 +17,11 @@ endif
|
||||
|
||||
syn case ignore
|
||||
syn sync minlines=100
|
||||
syn iskeyword @,48-57,192-255,_
|
||||
if has('patch-7.4.1142')
|
||||
syn iskeyword @,48-57,192-255,_
|
||||
else
|
||||
setlocal iskeyword=@,48-57,192-255,_
|
||||
endif
|
||||
|
||||
syn match sqlIsKeyword /\<\h\w*\>/ contains=sqlStatement,sqlKeyword,sqlCatalog,sqlConstant,sqlSpecial,sqlOption,sqlErrorCode,sqlType,sqlTable,sqlView
|
||||
syn match sqlIsFunction /\<\h\w*\ze(/ contains=sqlFunction,sqlKeyword,sqlType
|
||||
@@ -723,7 +727,7 @@ syn keyword sqlConstant contained ltree_plpythonu pldbgapi plpython2u plpython3u
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'refint') == -1
|
||||
syn keyword sqlFunction contained check_foreign_key check_primary_key
|
||||
endif " refint
|
||||
" Extension: postgis (v3.1.0)
|
||||
" Extension: postgis (v3.1.1)
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis') == -1
|
||||
syn keyword sqlFunction contained addauth addgeometrycolumn box
|
||||
syn keyword sqlFunction contained box2d box2d_in box2d_out box2df_in
|
||||
@@ -1018,7 +1022,7 @@ endif " dict_xsyn
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'bool_plperlu') == -1
|
||||
syn keyword sqlFunction contained bool_to_plperlu plperlu_to_bool
|
||||
endif " bool_plperlu
|
||||
" Extension: address_standardizer (v3.1.0)
|
||||
" Extension: address_standardizer (v3.1.1)
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'address_standardizer') == -1
|
||||
syn keyword sqlFunction contained parse_address standardize_address
|
||||
syn keyword sqlType contained stdaddr
|
||||
@@ -1077,7 +1081,7 @@ if index(get(g:, 'pgsql_disabled_extensions', []), 'cube') == -1
|
||||
syn keyword sqlType contained cube
|
||||
syn keyword sqlFunction contained g_cube_compress g_cube_decompress
|
||||
endif " cube
|
||||
" Extension: postgis_tiger_geocoder (v3.1.0)
|
||||
" Extension: postgis_tiger_geocoder (v3.1.1)
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_tiger_geocoder') == -1
|
||||
syn keyword sqlFunction contained count_words create_census_base_tables
|
||||
syn keyword sqlFunction contained cull_null diff_zip
|
||||
@@ -1181,11 +1185,11 @@ endif " pgstattuple
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'autoinc') == -1
|
||||
syn keyword sqlFunction contained autoinc
|
||||
endif " autoinc
|
||||
" Extension: address_standardizer_data_us (v3.1.0)
|
||||
" Extension: address_standardizer_data_us (v3.1.1)
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'address_standardizer_data_us') == -1
|
||||
syn keyword sqlTable contained us_gaz us_lex us_rules
|
||||
endif " address_standardizer_data_us
|
||||
" Extension: postgis_topology (v3.1.0)
|
||||
" Extension: postgis_topology (v3.1.1)
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_topology') == -1
|
||||
syn keyword sqlFunction contained addedge addface addnode
|
||||
syn keyword sqlFunction contained addtopogeometrycolumn addtosearchpath asgml
|
||||
@@ -1218,7 +1222,7 @@ if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_topology') == -1
|
||||
syn keyword sqlType contained topoelementarray topogeometry
|
||||
syn keyword sqlType contained validatetopology_returntype
|
||||
endif " postgis_topology
|
||||
" Extension: postgis_raster (v3.1.0)
|
||||
" Extension: postgis_raster (v3.1.1)
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_raster') == -1
|
||||
syn keyword sqlFunction contained addoverviewconstraints addrasterconstraints
|
||||
syn keyword sqlFunction contained box3d bytea dropoverviewconstraints
|
||||
@@ -1566,7 +1570,7 @@ if index(get(g:, 'pgsql_disabled_extensions', []), 'fuzzystrmatch') == -1
|
||||
syn keyword sqlFunction contained levenshtein levenshtein_less_equal
|
||||
syn keyword sqlFunction contained metaphone soundex text_soundex
|
||||
endif " fuzzystrmatch
|
||||
" Extension: pgrouting (v3.1.1)
|
||||
" Extension: pgrouting (v3.1.3)
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'pgrouting') == -1
|
||||
syn keyword sqlFunction contained pgr_alphashape pgr_analyzegraph
|
||||
syn keyword sqlFunction contained pgr_analyzeoneway pgr_articulationpoints pgr_astar
|
||||
@@ -1610,7 +1614,7 @@ if index(get(g:, 'pgsql_disabled_extensions', []), 'pgcrypto') == -1
|
||||
syn keyword sqlFunction contained pgp_sym_decrypt_bytea pgp_sym_encrypt
|
||||
syn keyword sqlFunction contained pgp_sym_encrypt_bytea
|
||||
endif " pgcrypto
|
||||
" Extension: postgis_sfcgal (v3.1.0)
|
||||
" Extension: postgis_sfcgal (v3.1.1)
|
||||
if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_sfcgal') == -1
|
||||
syn keyword sqlFunction contained postgis_sfcgal_noop
|
||||
syn keyword sqlFunction contained postgis_sfcgal_scripts_installed postgis_sfcgal_version st_3darea
|
||||
@@ -2025,9 +2029,18 @@ for pl in get(b:, 'pgsql_pl', get(g:, 'pgsql_pl', []))
|
||||
endfor
|
||||
|
||||
" Folding
|
||||
execute "syn region sqlFold start='^\s*\zs\c\(create\|update\|alter\|select\|insert\|do\)\>' end=';$' transparent fold "
|
||||
if get(g:, 'pgsql_fold_functions_only', 0)
|
||||
|
||||
execute 'syn region sqlFold start=/^\s*\zs\c\%(create\s\+[a-z ]*\%(function\|procedure\)\|do\)\>/ end=/;$/ transparent fold '
|
||||
\ .. "contains=sqlIsKeyword,sqlIsFunction,sqlComment,sqlIdentifier,sqlNumber,sqlOperator,sqlSpecial,sqlString,sqlTodo," .. s:plgroups
|
||||
|
||||
else
|
||||
|
||||
execute 'syn region sqlFold start=/^\s*\zs\c\(create\|update\|alter\|select\|insert\|do\)\>/ end=/;$/ transparent fold '
|
||||
\ .. "contains=sqlIsKeyword,sqlIsFunction,sqlComment,sqlIdentifier,sqlNumber,sqlOperator,sqlSpecial,sqlString,sqlTodo," .. s:plgroups
|
||||
|
||||
endif
|
||||
|
||||
unlet s:plgroups
|
||||
|
||||
" Default highlighting
|
||||
@@ -2058,4 +2071,3 @@ hi def link sqlCreateOperatorKeyword sqlKeyword
|
||||
hi def link sqlCreateTextSearchKeyword sqlKeyword
|
||||
|
||||
let b:current_syntax = "sql"
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@ syn match puppetOperator "+=\|-=\|==\|!=\|=\~\|!\~\|>=\|<=\|<-\|<\~\|=>\|+>\|->
|
||||
" three character operators
|
||||
syn match puppetOperator "<<|\||>>"
|
||||
|
||||
syn region puppetBracketOperator matchgroup=puppetDelimiter start="\[\s*" end="\s*]" contains=ALLBUT,@puppetNotTop
|
||||
syn region puppetBraceOperator matchgroup=puppetDelimiter start="{\s*" end="\s*}" contains=ALLBUT,@puppetNotTop
|
||||
syn region puppetParenOperator matchgroup=puppetDelimiter start="(\s*" end="\s*)" contains=ALLBUT,@puppetNotTop
|
||||
syn region puppetBracketOperator matchgroup=puppetDelimiter start="\[\s*" end="\s*]" fold contains=ALLBUT,@puppetNotTop
|
||||
syn region puppetBraceOperator matchgroup=puppetDelimiter start="{\s*" end="\s*}" fold contains=ALLBUT,@puppetNotTop
|
||||
syn region puppetParenOperator matchgroup=puppetDelimiter start="(\s*" end="\s*)" fold contains=ALLBUT,@puppetNotTop
|
||||
|
||||
" Expression Substitution and Backslash Notation {{{1
|
||||
syn match puppetStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display
|
||||
|
||||
@@ -21,8 +21,9 @@ syn case ignore
|
||||
syn match rstTransition /^[=`:.'"~^_*+#-]\{4,}\s*$/
|
||||
|
||||
syn cluster rstCruft contains=rstEmphasis,rstStrongEmphasis,
|
||||
\ rstInterpretedText,rstInlineLiteral,rstSubstitutionReference,
|
||||
\ rstInlineInternalTargets,rstFootnoteReference,rstHyperlinkReference
|
||||
\ rstInterpretedTextOrHyperlinkReference,rstInlineLiteral,
|
||||
\ rstSubstitutionReference, rstInlineInternalTargets,rstFootnoteReference,
|
||||
\ rstHyperlinkReference
|
||||
|
||||
syn region rstLiteralBlock matchgroup=rstDelimiter
|
||||
\ start='\(^\z(\s*\).*\)\@<=::\n\s*\n' skip='^\s*$' end='^\(\z1\s\+\)\@!'
|
||||
@@ -88,7 +89,7 @@ syn region rstHyperlinkTarget matchgroup=rstDirective
|
||||
execute 'syn region rstExDirective contained matchgroup=rstDirective' .
|
||||
\ ' start=+' . s:ReferenceName . '::\_s+' .
|
||||
\ ' skip=+^$+' .
|
||||
\ ' end=+^\s\@!+ contains=@rstCruft,rstLiteralBlock'
|
||||
\ ' end=+^\s\@!+ contains=@rstCruft,rstLiteralBlock,rstExplicitMarkup'
|
||||
|
||||
execute 'syn match rstSubstitutionDefinition contained' .
|
||||
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
|
||||
|
||||
@@ -13,7 +13,7 @@ endif
|
||||
let b:current_syntax = "smt2"
|
||||
|
||||
" Comments
|
||||
syntax match smt2Comment ";.*$"
|
||||
syntax match smt2Comment "\m\C;.*$"
|
||||
|
||||
" Commands
|
||||
syntax keyword smt2Commands
|
||||
@@ -64,10 +64,10 @@ syntax keyword smt2Commands
|
||||
\ set-logic
|
||||
\ set-option
|
||||
\ simplify
|
||||
syntax match smt2Commands "!"
|
||||
syntax match smt2Commands "\m\C!"
|
||||
|
||||
" Operators
|
||||
syntax match smt2Operator "[=\|>\|<\|<=\|>=\|=>\|+\|\-\|*\|/\|!]"
|
||||
syntax match smt2Operator "\m\C[=\|>\|<\|<=\|>=\|=>\|+\|\-\|*\|/\|!]"
|
||||
|
||||
" Builtins
|
||||
syntax keyword smt2Builtin
|
||||
@@ -140,29 +140,29 @@ syntax keyword smt2Builtin
|
||||
\ unsat
|
||||
\ xor
|
||||
\ zero_extend
|
||||
syntax match smt2Builtin "[\^\~]"
|
||||
syntax match smt2Builtin "\m\C[\^\~]"
|
||||
|
||||
" Identifier
|
||||
syntax match smt2Identifier "\<[a-z_][a-zA-Z0-9_\-\.']*\>"
|
||||
syntax match smt2Identifier "\m\C\<[a-z_][a-zA-Z0-9_\-\.']*\>"
|
||||
|
||||
" Types
|
||||
syntax match smt2Type "\<[A-Z][a-zA-Z0-9_\-\.']*\>"
|
||||
syntax match smt2Type "\m\C\<[A-Z][a-zA-Z0-9_\-\.']*\>"
|
||||
|
||||
" Strings
|
||||
syntax region smt2String start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syntax match smt2Option "\<:[a-zA-Z0-9_\-\.']*\>"
|
||||
syntax match smt2Option "\m\C\<:[a-zA-Z0-9_\-\.']*\>"
|
||||
|
||||
" Constructors
|
||||
syntax match smt2Constructor "\<\$[a-zA-Z0-9_\-\.']*\>"
|
||||
syntax match smt2Constructor "\m\C\<\$[a-zA-Z0-9_\-\.']*\>"
|
||||
|
||||
" Number
|
||||
syntax match smt2Int "\<[0-9]\+\>"
|
||||
syntax match smt2Hex "\<[0#][xX][0-9a-fA-F]\+\>"
|
||||
syntax match smt2Binary "\<#b[01]\+\>"
|
||||
syntax match smt2Float "\<[0-9]\+\.[0-9]\+\([eE][\-+]\=[0-9]\+\)\=\>"
|
||||
syntax match smt2Int "\m\C\<[0-9]\+\>"
|
||||
syntax match smt2Hex "\m\C\<[0#][xX][0-9a-fA-F]\+\>"
|
||||
syntax match smt2Binary "\m\C\<#b[01]\+\>"
|
||||
syntax match smt2Float "\m\C\<[0-9]\+\.[0-9]\+\([eE][\-+]\=[0-9]\+\)\=\>"
|
||||
|
||||
" Delimiter
|
||||
syntax match smt2Delimiter "[()]"
|
||||
syntax match smt2Delimiter "\m\C[()]"
|
||||
|
||||
" Error
|
||||
syntax keyword smt2Error error
|
||||
|
||||
193
syntax/tidy.vim
193
syntax/tidy.vim
@@ -3,10 +3,11 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'tidy', 'syntax/tidy.vim')
|
||||
endif
|
||||
|
||||
" Vim syntax file
|
||||
" Language: HMTL Tidy configuration file (/etc/tidyrc ~/.tidyrc)
|
||||
" Language: HMTL Tidy Configuration
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2016 Apr 24
|
||||
" Last Change: 2020 Sep 4
|
||||
|
||||
" Preamble {{{1
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
@@ -16,10 +17,15 @@ set cpo&vim
|
||||
|
||||
syn iskeyword @,48-57,-,_
|
||||
|
||||
" Values {{{1
|
||||
syn match tidyWordSeparator contained ",\|\s" nextgroup=tidyWord skipwhite skipnl
|
||||
syn match tidyMuteIDSeparator contained ",\|\s" nextgroup=tidyMuteID skipwhite skipnl
|
||||
|
||||
syn case ignore
|
||||
syn keyword tidyBoolean contained t[rue] f[alse] y[es] n[o] 1 0
|
||||
syn keyword tidyAutoBoolean contained t[rue] f[alse] y[es] n[o] 1 0 auto
|
||||
syn case match
|
||||
syn keyword tidyCustomTags contained no blocklevel empty inline pre
|
||||
syn keyword tidyDoctype contained html5 omit auto strict loose transitional user
|
||||
syn keyword tidyEncoding contained raw ascii latin0 latin1 utf8 iso2022 mac win1252 ibm858 utf16le utf16be utf16 big5 shiftjis
|
||||
syn keyword tidyNewline contained LF CRLF CR
|
||||
@@ -28,36 +34,148 @@ syn keyword tidyRepeat contained keep-first keep-last
|
||||
syn keyword tidySorter contained alpha none
|
||||
syn region tidyString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline
|
||||
syn region tidyString contained start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline
|
||||
syn match tidyTags contained "\<\w\+\(\s*,\s*\w\+\)*\>"
|
||||
" Tag and attribute lists
|
||||
syn match tidyWord contained "\<\k\+\>:\@!" nextgroup=tidyWordSeparator skipwhite skipnl
|
||||
|
||||
syn keyword tidyBooleanOption add-xml-decl add-xml-pi add-xml-space
|
||||
\ anchor-as-name ascii-chars assume-xml-procins bare break-before-br
|
||||
\ clean coerce-endtags decorate-inferred-ul drop-empty-paras
|
||||
\ drop-empty-elements drop-font-tags drop-proprietary-attributes
|
||||
\ enclose-block-text enclose-text escape-cdata escape-scripts
|
||||
\ fix-backslash fix-bad-comments fix-uri force-output gdoc gnu-emacs
|
||||
\ hide-comments hide-endtags indent-attributes indent-cdata
|
||||
\ indent-with-tabs input-xml join-classes join-styles keep-time
|
||||
\ language literal-attributes logical-emphasis lower-literals markup
|
||||
\ merge-emphasis ncr numeric-entities omit-optional-tags output-html
|
||||
\ output-xhtml output-xml preserve-entities punctuation-wrap quiet
|
||||
\ quote-ampersand quote-marks quote-nbsp raw replace-color show-info
|
||||
\ show-warnings skip-nested split strict-tags-attributes tidy-mark
|
||||
\ uppercase-attributes uppercase-tags word-2000 wrap-asp
|
||||
\ wrap-attributes wrap-jste wrap-php wrap-script-literals
|
||||
\ wrap-sections write-back
|
||||
" Mute Message IDs {{{2
|
||||
syn keyword tidyMuteID ADDED_MISSING_CHARSET ANCHOR_DUPLICATED
|
||||
\ ANCHOR_NOT_UNIQUE APOS_UNDEFINED APPLET_MISSING_ALT AREA_MISSING_ALT
|
||||
\ ASCII_REQUIRES_DESCRIPTION ASSOCIATE_LABELS_EXPLICITLY
|
||||
\ ASSOCIATE_LABELS_EXPLICITLY_FOR ASSOCIATE_LABELS_EXPLICITLY_ID
|
||||
\ ATTRIBUTE_IS_NOT_ALLOWED ATTRIBUTE_VALUE_REPLACED
|
||||
\ ATTR_VALUE_NOT_LCASE AUDIO_MISSING_TEXT_AIFF AUDIO_MISSING_TEXT_AU
|
||||
\ AUDIO_MISSING_TEXT_RA AUDIO_MISSING_TEXT_RM AUDIO_MISSING_TEXT_SND
|
||||
\ AUDIO_MISSING_TEXT_WAV BACKSLASH_IN_URI BAD_ATTRIBUTE_VALUE
|
||||
\ BAD_ATTRIBUTE_VALUE_REPLACED BAD_CDATA_CONTENT BAD_SUMMARY_HTML5
|
||||
\ BAD_SURROGATE_LEAD BAD_SURROGATE_PAIR BAD_SURROGATE_TAIL
|
||||
\ CANT_BE_NESTED COERCE_TO_ENDTAG COLOR_CONTRAST_ACTIVE_LINK
|
||||
\ COLOR_CONTRAST_LINK COLOR_CONTRAST_TEXT COLOR_CONTRAST_VISITED_LINK
|
||||
\ CONTENT_AFTER_BODY CUSTOM_TAG_DETECTED DATA_TABLE_MISSING_HEADERS
|
||||
\ DATA_TABLE_MISSING_HEADERS_COLUMN DATA_TABLE_MISSING_HEADERS_ROW
|
||||
\ DATA_TABLE_REQUIRE_MARKUP_COLUMN_HEADERS
|
||||
\ DATA_TABLE_REQUIRE_MARKUP_ROW_HEADERS DISCARDING_UNEXPECTED
|
||||
\ DOCTYPE_AFTER_TAGS DOCTYPE_MISSING DUPLICATE_FRAMESET
|
||||
\ ELEMENT_NOT_EMPTY ELEMENT_VERS_MISMATCH_ERROR
|
||||
\ ELEMENT_VERS_MISMATCH_WARN ENCODING_MISMATCH
|
||||
\ ENSURE_PROGRAMMATIC_OBJECTS_ACCESSIBLE_APPLET
|
||||
\ ENSURE_PROGRAMMATIC_OBJECTS_ACCESSIBLE_EMBED
|
||||
\ ENSURE_PROGRAMMATIC_OBJECTS_ACCESSIBLE_OBJECT
|
||||
\ ENSURE_PROGRAMMATIC_OBJECTS_ACCESSIBLE_SCRIPT ESCAPED_ILLEGAL_URI
|
||||
\ FILE_CANT_OPEN FILE_CANT_OPEN_CFG FILE_NOT_FILE FIXED_BACKSLASH
|
||||
\ FOUND_STYLE_IN_BODY FRAME_MISSING_LONGDESC FRAME_MISSING_NOFRAMES
|
||||
\ FRAME_MISSING_TITLE FRAME_SRC_INVALID FRAME_TITLE_INVALID_NULL
|
||||
\ FRAME_TITLE_INVALID_SPACES HEADERS_IMPROPERLY_NESTED
|
||||
\ HEADER_USED_FORMAT_TEXT ID_NAME_MISMATCH ILLEGAL_NESTING
|
||||
\ ILLEGAL_URI_CODEPOINT ILLEGAL_URI_REFERENCE
|
||||
\ IMAGE_MAP_SERVER_SIDE_REQUIRES_CONVERSION
|
||||
\ IMG_ALT_SUSPICIOUS_FILENAME IMG_ALT_SUSPICIOUS_FILE_SIZE
|
||||
\ IMG_ALT_SUSPICIOUS_PLACEHOLDER IMG_ALT_SUSPICIOUS_TOO_LONG
|
||||
\ IMG_BUTTON_MISSING_ALT IMG_MAP_CLIENT_MISSING_TEXT_LINKS
|
||||
\ IMG_MAP_SERVER_REQUIRES_TEXT_LINKS IMG_MISSING_ALT IMG_MISSING_DLINK
|
||||
\ IMG_MISSING_LONGDESC IMG_MISSING_LONGDESC_DLINK
|
||||
\ INFORMATION_NOT_CONVEYED_APPLET INFORMATION_NOT_CONVEYED_IMAGE
|
||||
\ INFORMATION_NOT_CONVEYED_INPUT INFORMATION_NOT_CONVEYED_OBJECT
|
||||
\ INFORMATION_NOT_CONVEYED_SCRIPT INSERTING_AUTO_ATTRIBUTE
|
||||
\ INSERTING_TAG INVALID_ATTRIBUTE INVALID_NCR INVALID_SGML_CHARS
|
||||
\ INVALID_UTF16 INVALID_UTF8 INVALID_XML_ID JOINING_ATTRIBUTE
|
||||
\ LANGUAGE_INVALID LANGUAGE_NOT_IDENTIFIED
|
||||
\ LAYOUT_TABLES_LINEARIZE_PROPERLY LAYOUT_TABLE_INVALID_MARKUP
|
||||
\ LINK_TEXT_MISSING LINK_TEXT_NOT_MEANINGFUL
|
||||
\ LINK_TEXT_NOT_MEANINGFUL_CLICK_HERE LINK_TEXT_TOO_LONG
|
||||
\ LIST_USAGE_INVALID_LI LIST_USAGE_INVALID_OL LIST_USAGE_INVALID_UL
|
||||
\ MALFORMED_COMMENT MALFORMED_COMMENT_DROPPING MALFORMED_COMMENT_EOS
|
||||
\ MALFORMED_COMMENT_WARN MALFORMED_DOCTYPE METADATA_MISSING
|
||||
\ METADATA_MISSING_REDIRECT_AUTOREFRESH MISMATCHED_ATTRIBUTE_ERROR
|
||||
\ MISMATCHED_ATTRIBUTE_WARN MISSING_ATTRIBUTE MISSING_ATTR_VALUE
|
||||
\ MISSING_DOCTYPE MISSING_ENDTAG_BEFORE MISSING_ENDTAG_FOR
|
||||
\ MISSING_ENDTAG_OPTIONAL MISSING_IMAGEMAP MISSING_QUOTEMARK
|
||||
\ MISSING_QUOTEMARK_OPEN MISSING_SEMICOLON MISSING_SEMICOLON_NCR
|
||||
\ MISSING_STARTTAG MISSING_TITLE_ELEMENT MOVED_STYLE_TO_HEAD
|
||||
\ MULTIMEDIA_REQUIRES_TEXT NESTED_EMPHASIS NESTED_QUOTATION
|
||||
\ NEWLINE_IN_URI NEW_WINDOWS_REQUIRE_WARNING_BLANK
|
||||
\ NEW_WINDOWS_REQUIRE_WARNING_NEW NOFRAMES_CONTENT
|
||||
\ NOFRAMES_INVALID_CONTENT NOFRAMES_INVALID_LINK
|
||||
\ NOFRAMES_INVALID_NO_VALUE NON_MATCHING_ENDTAG OBJECT_MISSING_ALT
|
||||
\ OBSOLETE_ELEMENT OPTION_REMOVED OPTION_REMOVED_APPLIED
|
||||
\ OPTION_REMOVED_UNAPPLIED POTENTIAL_HEADER_BOLD
|
||||
\ POTENTIAL_HEADER_ITALICS POTENTIAL_HEADER_UNDERLINE
|
||||
\ PREVIOUS_LOCATION PROGRAMMATIC_OBJECTS_REQUIRE_TESTING_APPLET
|
||||
\ PROGRAMMATIC_OBJECTS_REQUIRE_TESTING_EMBED
|
||||
\ PROGRAMMATIC_OBJECTS_REQUIRE_TESTING_OBJECT
|
||||
\ PROGRAMMATIC_OBJECTS_REQUIRE_TESTING_SCRIPT PROPRIETARY_ATTRIBUTE
|
||||
\ PROPRIETARY_ATTR_VALUE PROPRIETARY_ELEMENT REMOVED_HTML5
|
||||
\ REMOVE_AUTO_REDIRECT REMOVE_AUTO_REFRESH REMOVE_BLINK_MARQUEE
|
||||
\ REMOVE_FLICKER_ANIMATED_GIF REMOVE_FLICKER_APPLET
|
||||
\ REMOVE_FLICKER_EMBED REMOVE_FLICKER_OBJECT REMOVE_FLICKER_SCRIPT
|
||||
\ REPEATED_ATTRIBUTE REPLACE_DEPRECATED_HTML_APPLET
|
||||
\ REPLACE_DEPRECATED_HTML_BASEFONT REPLACE_DEPRECATED_HTML_CENTER
|
||||
\ REPLACE_DEPRECATED_HTML_DIR REPLACE_DEPRECATED_HTML_FONT
|
||||
\ REPLACE_DEPRECATED_HTML_ISINDEX REPLACE_DEPRECATED_HTML_MENU
|
||||
\ REPLACE_DEPRECATED_HTML_S REPLACE_DEPRECATED_HTML_STRIKE
|
||||
\ REPLACE_DEPRECATED_HTML_U REPLACING_ELEMENT REPLACING_UNEX_ELEMENT
|
||||
\ SCRIPT_MISSING_NOSCRIPT SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_CLICK
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_DOWN
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_MOVE
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_OUT
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_OVER
|
||||
\ SCRIPT_NOT_KEYBOARD_ACCESSIBLE_ON_MOUSE_UP SKIPOVER_ASCII_ART
|
||||
\ SPACE_PRECEDING_XMLDECL STRING_ARGUMENT_BAD STRING_CONTENT_LOOKS
|
||||
\ STRING_DOCTYPE_GIVEN STRING_MISSING_MALFORMED STRING_MUTING_TYPE
|
||||
\ STRING_NO_SYSID STRING_UNKNOWN_OPTION
|
||||
\ STYLESHEETS_REQUIRE_TESTING_LINK
|
||||
\ STYLESHEETS_REQUIRE_TESTING_STYLE_ATTR
|
||||
\ STYLESHEETS_REQUIRE_TESTING_STYLE_ELEMENT
|
||||
\ STYLE_SHEET_CONTROL_PRESENTATION SUSPECTED_MISSING_QUOTE
|
||||
\ TABLE_MAY_REQUIRE_HEADER_ABBR TABLE_MAY_REQUIRE_HEADER_ABBR_NULL
|
||||
\ TABLE_MAY_REQUIRE_HEADER_ABBR_SPACES TABLE_MISSING_CAPTION
|
||||
\ TABLE_MISSING_SUMMARY TABLE_SUMMARY_INVALID_NULL
|
||||
\ TABLE_SUMMARY_INVALID_PLACEHOLDER TABLE_SUMMARY_INVALID_SPACES
|
||||
\ TAG_NOT_ALLOWED_IN TEXT_EQUIVALENTS_REQUIRE_UPDATING_APPLET
|
||||
\ TEXT_EQUIVALENTS_REQUIRE_UPDATING_OBJECT
|
||||
\ TEXT_EQUIVALENTS_REQUIRE_UPDATING_SCRIPT TOO_MANY_ELEMENTS
|
||||
\ TOO_MANY_ELEMENTS_IN TRIM_EMPTY_ELEMENT UNESCAPED_AMPERSAND
|
||||
\ UNEXPECTED_ENDTAG UNEXPECTED_ENDTAG_ERR UNEXPECTED_ENDTAG_IN
|
||||
\ UNEXPECTED_END_OF_FILE UNEXPECTED_END_OF_FILE_ATTR
|
||||
\ UNEXPECTED_EQUALSIGN UNEXPECTED_GT UNEXPECTED_QUOTEMARK
|
||||
\ UNKNOWN_ELEMENT UNKNOWN_ELEMENT_LOOKS_CUSTOM UNKNOWN_ENTITY
|
||||
\ USING_BR_INPLACE_OF VENDOR_SPECIFIC_CHARS WHITE_IN_URI
|
||||
\ XML_DECLARATION_DETECTED XML_ID_SYNTAX
|
||||
\ contained nextgroup=tidyMuteIDSeparator skipwhite skipnl
|
||||
|
||||
" Options {{{1
|
||||
syn keyword tidyCustomTagsOption custom-tags contained nextgroup=tidyCustomTagsDelimiter
|
||||
syn match tidyCustomTagsDelimiter ":" nextgroup=tidyCustomTags contained skipwhite
|
||||
|
||||
syn keyword tidyBooleanOption add-meta-charset add-xml-decl
|
||||
\ add-xml-pi add-xml-space anchor-as-name ascii-chars
|
||||
\ assume-xml-procins bare break-before-br clean coerce-endtags
|
||||
\ decorate-inferred-ul drop-empty-paras drop-empty-elements
|
||||
\ drop-font-tags drop-proprietary-attributes enclose-block-text
|
||||
\ enclose-text escape-cdata escape-scripts fix-backslash
|
||||
\ fix-style-tags fix-uri force-output gdoc gnu-emacs hide-comments
|
||||
\ hide-endtags indent-attributes indent-cdata indent-with-tabs
|
||||
\ input-xml join-classes join-styles keep-tabs keep-time language
|
||||
\ literal-attributes logical-emphasis lower-literals markup
|
||||
\ merge-emphasis mute-id ncr numeric-entities omit-optional-tags
|
||||
\ output-html output-xhtml output-xml preserve-entities
|
||||
\ punctuation-wrap quiet quote-ampersand quote-marks quote-nbsp raw
|
||||
\ replace-color show-filename show-info show-meta-change show-warnings
|
||||
\ skip-nested split strict-tags-attributes tidy-mark
|
||||
\ uppercase-attributes uppercase-tags warn-proprietary-attributes
|
||||
\ word-2000 wrap-asp wrap-attributes wrap-jste wrap-php
|
||||
\ wrap-script-literals wrap-sections write-back
|
||||
\ contained nextgroup=tidyBooleanDelimiter
|
||||
|
||||
syn match tidyBooleanDelimiter ":" nextgroup=tidyBoolean contained skipwhite
|
||||
|
||||
syn keyword tidyAutoBooleanOption indent merge-divs merge-spans output-bom show-body-only vertical-space contained nextgroup=tidyAutoBooleanDelimiter
|
||||
syn keyword tidyAutoBooleanOption fix-bad-comments indent merge-divs merge-spans output-bom show-body-only vertical-space contained nextgroup=tidyAutoBooleanDelimiter
|
||||
syn match tidyAutoBooleanDelimiter ":" nextgroup=tidyAutoBoolean contained skipwhite
|
||||
|
||||
syn keyword tidyCSSSelectorOption css-prefix contained nextgroup=tidyCSSSelectorDelimiter
|
||||
syn match tidyCSSSelectorDelimiter ":" nextgroup=tidyCSSSelector contained skipwhite
|
||||
|
||||
syn keyword tidyDoctypeOption doctype contained nextgroup=tidyDoctypeDelimiter
|
||||
syn match tidyDoctypeDelimiter ":" nextgroup=tidyDoctype contained skipwhite
|
||||
syn match tidyDoctypeDelimiter ":" nextgroup=tidyDoctype,tidyString contained skipwhite
|
||||
|
||||
syn keyword tidyEncodingOption char-encoding input-encoding output-encoding contained nextgroup=tidyEncodingDelimiter
|
||||
syn match tidyEncodingDelimiter ":" nextgroup=tidyEncoding contained skipwhite
|
||||
@@ -71,8 +189,11 @@ syn match tidyNameDelimiter ":" nextgroup=tidyName contained skipwhite
|
||||
syn keyword tidyNewlineOption newline contained nextgroup=tidyNewlineDelimiter
|
||||
syn match tidyNewlineDelimiter ":" nextgroup=tidyNewline contained skipwhite
|
||||
|
||||
syn keyword tidyAttributesOption priority-attributes contained nextgroup=tidyAttributesDelimiter
|
||||
syn match tidyAttributesDelimiter ":" nextgroup=tidyWord contained skipwhite
|
||||
|
||||
syn keyword tidyTagsOption new-blocklevel-tags new-empty-tags new-inline-tags new-pre-tags contained nextgroup=tidyTagsDelimiter
|
||||
syn match tidyTagsDelimiter ":" nextgroup=tidyTags contained skipwhite
|
||||
syn match tidyTagsDelimiter ":" nextgroup=tidyWord contained skipwhite
|
||||
|
||||
syn keyword tidyRepeatOption repeated-attributes contained nextgroup=tidyRepeatDelimiter
|
||||
syn match tidyRepeatDelimiter ":" nextgroup=tidyRepeat contained skipwhite
|
||||
@@ -83,57 +204,77 @@ syn match tidySorterDelimiter ":" nextgroup=tidySorter contained skipwhite
|
||||
syn keyword tidyStringOption alt-text error-file gnu-emacs-file output-file contained nextgroup=tidyStringDelimiter
|
||||
syn match tidyStringDelimiter ":" nextgroup=tidyString contained skipwhite
|
||||
|
||||
syn keyword tidyMuteOption mute contained nextgroup=tidyMuteDelimiter
|
||||
syn match tidyMuteDelimiter ":" nextgroup=tidyMuteID contained skipwhite
|
||||
|
||||
syn cluster tidyOptions contains=tidy.*Option
|
||||
|
||||
" Option line anchor {{{1
|
||||
syn match tidyStart "^" nextgroup=@tidyOptions
|
||||
" Long standing bug - option lines (except the first) with leading whitespace
|
||||
" are silently ignored.
|
||||
syn match tidyErrorStart '^\s\+\ze\S'
|
||||
|
||||
" Comments {{{1
|
||||
syn match tidyComment "^\s*//.*$" contains=tidyTodo
|
||||
syn match tidyComment "^\s*#.*$" contains=tidyTodo
|
||||
syn keyword tidyTodo TODO NOTE FIXME XXX contained
|
||||
|
||||
" Default highlighting {{{1
|
||||
hi def link tidyAttributesOption Identifier
|
||||
hi def link tidyAutoBooleanOption Identifier
|
||||
hi def link tidyBooleanOption Identifier
|
||||
hi def link tidyCSSSelectorOption Identifier
|
||||
hi def link tidyCustomTagsOption Identifier
|
||||
hi def link tidyDoctypeOption Identifier
|
||||
hi def link tidyEncodingOption Identifier
|
||||
hi def link tidyIntegerOption Identifier
|
||||
hi def link tidyMuteOption Identifier
|
||||
hi def link tidyNameOption Identifier
|
||||
hi def link tidyNewlineOption Identifier
|
||||
hi def link tidyTagsOption Identifier
|
||||
hi def link tidyRepeatOption Identifier
|
||||
hi def link tidySorterOption Identifier
|
||||
hi def link tidyStringOption Identifier
|
||||
hi def link tidyTagsOption Identifier
|
||||
|
||||
hi def link tidyAttributesDelimiter Special
|
||||
hi def link tidyAutoBooleanDelimiter Special
|
||||
hi def link tidyBooleanDelimiter Special
|
||||
hi def link tidyCSSSelectorDelimiter Special
|
||||
hi def link tidyCustomTagsDelimiter Special
|
||||
hi def link tidyDoctypeDelimiter Special
|
||||
hi def link tidyEncodingDelimiter Special
|
||||
hi def link tidyIntegerDelimiter Special
|
||||
hi def link tidyMuteDelimiter Special
|
||||
hi def link tidyNameDelimiter Special
|
||||
hi def link tidyNewlineDelimiter Special
|
||||
hi def link tidyTagsDelimiter Special
|
||||
hi def link tidyRepeatDelimiter Special
|
||||
hi def link tidySorterDelimiter Special
|
||||
hi def link tidyStringDelimiter Special
|
||||
hi def link tidyTagsDelimiter Special
|
||||
|
||||
hi def link tidyAutoBoolean Boolean
|
||||
hi def link tidyBoolean Boolean
|
||||
hi def link tidyCustomTags Constant
|
||||
hi def link tidyDoctype Constant
|
||||
hi def link tidyEncoding Constant
|
||||
hi def link tidyMuteID Constant
|
||||
hi def link tidyNewline Constant
|
||||
hi def link tidyTags Constant
|
||||
hi def link tidyNumber Number
|
||||
hi def link tidyRepeat Constant
|
||||
hi def link tidySorter Constant
|
||||
hi def link tidyString String
|
||||
hi def link tidyWord Constant
|
||||
|
||||
hi def link tidyComment Comment
|
||||
hi def link tidyTodo Todo
|
||||
|
||||
hi def link tidyErrorStart Error
|
||||
|
||||
" Postscript {{{1
|
||||
let b:current_syntax = "tidy"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8
|
||||
" vim: ts=8 fdm=marker
|
||||
|
||||
346
syntax/zig.vim
346
syntax/zig.vim
@@ -10,99 +10,283 @@ endif
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let b:current_syntax = "zig"
|
||||
|
||||
syn keyword zigStorage const var extern packed export pub noalias inline noinline comptime callconv volatile allowzero align linksection threadlocal anytype
|
||||
syn keyword zigStructure struct enum union error opaque
|
||||
syn keyword zigStatement break return continue asm defer errdefer unreachable try catch async nosuspend await suspend resume
|
||||
syn keyword zigConditional if else switch and or orelse
|
||||
syn keyword zigRepeat while for
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn keyword zigConstant null undefined
|
||||
syn keyword zigKeyword fn usingnamespace test
|
||||
syn keyword zigType bool f16 f32 f64 f128 void noreturn type anyerror anyframe
|
||||
syn keyword zigType i0 u0 isize usize comptime_int comptime_float
|
||||
syn keyword zigType c_short c_ushort c_int c_uint c_long c_ulong c_longlong c_ulonglong c_longdouble c_void
|
||||
let s:zig_syntax_keywords = {
|
||||
\ 'zigBoolean': ["true"
|
||||
\ , "false"]
|
||||
\ , 'zigNull': ["null"]
|
||||
\ , 'zigType': ["bool"
|
||||
\ , "f16"
|
||||
\ , "f32"
|
||||
\ , "f64"
|
||||
\ , "f128"
|
||||
\ , "void"
|
||||
\ , "type"
|
||||
\ , "anytype"
|
||||
\ , "anyerror"
|
||||
\ , "anyframe"
|
||||
\ , "volatile"
|
||||
\ , "linksection"
|
||||
\ , "noreturn"
|
||||
\ , "allowzero"
|
||||
\ , "i0"
|
||||
\ , "u0"
|
||||
\ , "isize"
|
||||
\ , "usize"
|
||||
\ , "comptime_int"
|
||||
\ , "comptime_float"
|
||||
\ , "c_short"
|
||||
\ , "c_ushort"
|
||||
\ , "c_int"
|
||||
\ , "c_uint"
|
||||
\ , "c_long"
|
||||
\ , "c_ulong"
|
||||
\ , "c_longlong"
|
||||
\ , "c_ulonglong"
|
||||
\ , "c_longdouble"
|
||||
\ , "c_void"]
|
||||
\ , 'zigConstant': ["undefined"
|
||||
\ , "unreachable"]
|
||||
\ , 'zigConditional': ["if"
|
||||
\ , "else"
|
||||
\ , "switch"]
|
||||
\ , 'zigRepeat': ["while"
|
||||
\ , "for"]
|
||||
\ , 'zigComparatorWord': ["and"
|
||||
\ , "or"
|
||||
\ , "orelse"]
|
||||
\ , 'zigStructure': ["struct"
|
||||
\ , "enum"
|
||||
\ , "union"
|
||||
\ , "error"
|
||||
\ , "packed"
|
||||
\ , "opaque"]
|
||||
\ , 'zigException': ["error"]
|
||||
\ , 'zigVarDecl': ["var"
|
||||
\ , "const"
|
||||
\ , "comptime"
|
||||
\ , "threadlocal"]
|
||||
\ , 'zigDummyVariable': ["_"]
|
||||
\ , 'zigKeyword': ["fn"
|
||||
\ , "try"
|
||||
\ , "test"
|
||||
\ , "pub"
|
||||
\ , "usingnamespace"]
|
||||
\ , 'zigExecution': ["return"
|
||||
\ , "break"
|
||||
\ , "continue"]
|
||||
\ , 'zigMacro': ["defer"
|
||||
\ , "errdefer"
|
||||
\ , "async"
|
||||
\ , "nosuspend"
|
||||
\ , "await"
|
||||
\ , "suspend"
|
||||
\ , "resume"
|
||||
\ , "export"
|
||||
\ , "extern"]
|
||||
\ , 'zigPreProc': ["catch"
|
||||
\ , "inline"
|
||||
\ , "noinline"
|
||||
\ , "asm"
|
||||
\ , "callconv"
|
||||
\ , "noalias"]
|
||||
\ , 'zigBuiltinFn': ["align"
|
||||
\ , "@add"
|
||||
\ , "@WithOverflow"
|
||||
\ , "@as"
|
||||
\ , "@atomicLoad"
|
||||
\ , "@atomicStore"
|
||||
\ , "@bitCast"
|
||||
\ , "@breakpoint"
|
||||
\ , "@alignCast"
|
||||
\ , "@alignOf"
|
||||
\ , "@cDefine"
|
||||
\ , "@cImport"
|
||||
\ , "@cInclude"
|
||||
\ , "@cUndef"
|
||||
\ , "@canImplicitCast"
|
||||
\ , "@clz"
|
||||
\ , "@cmpxchgWeak"
|
||||
\ , "@cmpxchgStrong"
|
||||
\ , "@compileError"
|
||||
\ , "@compileLog"
|
||||
\ , "@ctz"
|
||||
\ , "@popCount"
|
||||
\ , "@divExact"
|
||||
\ , "@divFloor"
|
||||
\ , "@divTrunc"
|
||||
\ , "@embedFile"
|
||||
\ , "@export"
|
||||
\ , "@tagName"
|
||||
\ , "@TagType"
|
||||
\ , "@errorName"
|
||||
\ , "@call"
|
||||
\ , "@errorReturnTrace"
|
||||
\ , "@fence"
|
||||
\ , "@fieldParentPtr"
|
||||
\ , "@field"
|
||||
\ , "@unionInit"
|
||||
\ , "@frameAddress"
|
||||
\ , "@import"
|
||||
\ , "@newStackCall"
|
||||
\ , "@asyncCall"
|
||||
\ , "@intToPtr"
|
||||
\ , "@memcpy"
|
||||
\ , "@memset"
|
||||
\ , "@mod"
|
||||
\ , "@mulWithOverflow"
|
||||
\ , "@splat"
|
||||
\ , "@src"
|
||||
\ , "@bitOffsetOf"
|
||||
\ , "@byteOffsetOf"
|
||||
\ , "@OpaqueType"
|
||||
\ , "@panic"
|
||||
\ , "@ptrCast"
|
||||
\ , "@ptrToInt"
|
||||
\ , "@rem"
|
||||
\ , "@returnAddress"
|
||||
\ , "@setCold"
|
||||
\ , "@Type"
|
||||
\ , "@shuffle"
|
||||
\ , "@reduce"
|
||||
\ , "@setRuntimeSafety"
|
||||
\ , "@setEvalBranchQuota"
|
||||
\ , "@setFloatMode"
|
||||
\ , "@setGlobalLinkage"
|
||||
\ , "@setGlobalSection"
|
||||
\ , "@shlExact"
|
||||
\ , "@This"
|
||||
\ , "@hasDecl"
|
||||
\ , "@hasField"
|
||||
\ , "@shlWithOverflow"
|
||||
\ , "@shrExact"
|
||||
\ , "@sizeOf"
|
||||
\ , "@bitSizeOf"
|
||||
\ , "@sqrt"
|
||||
\ , "@byteSwap"
|
||||
\ , "@subWithOverflow"
|
||||
\ , "@intCast"
|
||||
\ , "@floatCast"
|
||||
\ , "@intToFloat"
|
||||
\ , "@floatToInt"
|
||||
\ , "@boolToInt"
|
||||
\ , "@errSetCast"
|
||||
\ , "@truncate"
|
||||
\ , "@typeInfo"
|
||||
\ , "@typeName"
|
||||
\ , "@TypeOf"
|
||||
\ , "@atomicRmw"
|
||||
\ , "@bytesToSlice"
|
||||
\ , "@sliceToBytes"
|
||||
\ , "@intToError"
|
||||
\ , "@errorToInt"
|
||||
\ , "@intToEnum"
|
||||
\ , "@enumToInt"
|
||||
\ , "@setAlignStack"
|
||||
\ , "@frame"
|
||||
\ , "@Frame"
|
||||
\ , "@frameSize"
|
||||
\ , "@bitReverse"
|
||||
\ , "@Vector"
|
||||
\ , "@sin"
|
||||
\ , "@cos"
|
||||
\ , "@exp"
|
||||
\ , "@exp2"
|
||||
\ , "@log"
|
||||
\ , "@log2"
|
||||
\ , "@log10"
|
||||
\ , "@fabs"
|
||||
\ , "@floor"
|
||||
\ , "@ceil"
|
||||
\ , "@trunc"
|
||||
\ , "@round"]
|
||||
\ }
|
||||
|
||||
syn keyword zigBoolean true false
|
||||
function! s:syntax_keyword(dict)
|
||||
for key in keys(a:dict)
|
||||
execute 'syntax keyword' key join(a:dict[key], ' ')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
syn match zigType "\v<[iu][1-9]\d*>"
|
||||
call s:syntax_keyword(s:zig_syntax_keywords)
|
||||
|
||||
syn match zigOperator display "\V\[-+/*=^&?|!><%~]"
|
||||
syn match zigArrowCharacter display "\V->"
|
||||
|
||||
syn match zigBuiltinFn "\v\@(addWithOverflow|as|atomicLoad|atomicStore|bitCast|breakpoint)>"
|
||||
syn match zigBuiltinFn "\v\@(alignCast|alignOf|cDefine|cImport|cInclude)>"
|
||||
syn match zigBuiltinFn "\v\@(cUndef|canImplicitCast|clz|cmpxchgWeak|cmpxchgStrong|compileError)>"
|
||||
syn match zigBuiltinFn "\v\@(compileLog|ctz|popCount|divExact|divFloor|divTrunc)>"
|
||||
syn match zigBuiltinFn "\v\@(embedFile|export|tagName|TagType|errorName|call)>"
|
||||
syn match zigBuiltinFn "\v\@(errorReturnTrace|fence|fieldParentPtr|field|unionInit)>"
|
||||
syn match zigBuiltinFn "\v\@(frameAddress|import|newStackCall|asyncCall|intToPtr)>"
|
||||
syn match zigBuiltinFn "\v\@(memcpy|memset|mod|mulWithOverflow|splat|src)>"
|
||||
syn match zigBuiltinFn "\v\@(bitOffsetOf|byteOffsetOf|OpaqueType|panic|ptrCast)>"
|
||||
syn match zigBuiltinFn "\v\@(ptrToInt|rem|returnAddress|setCold|Type|shuffle|reduce)>"
|
||||
syn match zigBuiltinFn "\v\@(setRuntimeSafety|setEvalBranchQuota|setFloatMode)>"
|
||||
syn match zigBuiltinFn "\v\@(setGlobalLinkage|setGlobalSection|shlExact|This|hasDecl|hasField)>"
|
||||
syn match zigBuiltinFn "\v\@(shlWithOverflow|shrExact|sizeOf|bitSizeOf|sqrt|byteSwap|subWithOverflow|intCast|floatCast|intToFloat|floatToInt|boolToInt|errSetCast)>"
|
||||
syn match zigBuiltinFn "\v\@(truncate|typeInfo|typeName|TypeOf|atomicRmw|bytesToSlice|sliceToBytes)>"
|
||||
syn match zigBuiltinFn "\v\@(intToError|errorToInt|intToEnum|enumToInt|setAlignStack|frame|Frame|frameSize|bitReverse|Vector)>"
|
||||
syn match zigBuiltinFn "\v\@(sin|cos|exp|exp2|log|log2|log10|fabs|floor|ceil|trunc|round)>"
|
||||
syntax match zigType "\v<[iu][1-9]\d*>"
|
||||
syntax match zigOperator display "\V\[-+/*=^&?|!><%~]"
|
||||
syntax match zigArrowCharacter display "\V->"
|
||||
|
||||
" 12_34 (. but not ..)? (12_34)? (exponent 12_34)?
|
||||
syn match zigDecNumber display "\v<\d%(_?\d)*%(\.\.@!)?%(\d%(_?\d)*)?%([eE][+-]?\d%(_?\d)*)?"
|
||||
syn match zigHexNumber display "\v<0x\x%(_?\x)*%(\.\.@!)?%(\x%(_?\x)*)?%([pP][+-]?\d%(_?\d)*)?"
|
||||
syn match zigOctNumber display "\v<0o\o%(_?\o)*"
|
||||
syn match zigBinNumber display "\v<0b[01]%(_?[01])*"
|
||||
syntax match zigDecNumber display "\v<\d%(_?\d)*%(\.\.@!)?%(\d%(_?\d)*)?%([eE][+-]?\d%(_?\d)*)?"
|
||||
syntax match zigHexNumber display "\v<0x\x%(_?\x)*%(\.\.@!)?%(\x%(_?\x)*)?%([pP][+-]?\d%(_?\d)*)?"
|
||||
syntax match zigOctNumber display "\v<0o\o%(_?\o)*"
|
||||
syntax match zigBinNumber display "\v<0b[01]%(_?[01])*"
|
||||
|
||||
syn match zigCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
||||
syn match zigCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||
syn match zigCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=zigEscape,zigEscapeError,zigCharacterInvalid,zigCharacterInvalidUnicode
|
||||
syn match zigCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{6}\)\)'/ contains=zigEscape,zigEscapeUnicode,zigEscapeError,zigCharacterInvalid
|
||||
syntax match zigCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
||||
syntax match zigCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||
syntax match zigCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=zigEscape,zigEscapeError,zigCharacterInvalid,zigCharacterInvalidUnicode
|
||||
syntax match zigCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{6}\)\)'/ contains=zigEscape,zigEscapeUnicode,zigEscapeError,zigCharacterInvalid
|
||||
|
||||
syn region zigBlock start="{" end="}" transparent fold
|
||||
syntax region zigBlock start="{" end="}" transparent fold
|
||||
|
||||
syn region zigCommentLine start="//" end="$" contains=zigTodo,@Spell
|
||||
syn region zigCommentLineDoc start="//[/!]/\@!" end="$" contains=zigTodo,@Spell
|
||||
syntax region zigCommentLine start="//" end="$" contains=zigTodo,@Spell
|
||||
syntax region zigCommentLineDoc start="//[/!]/\@!" end="$" contains=zigTodo,@Spell
|
||||
|
||||
" TODO: match only the first '\\' within the zigMultilineString as zigMultilineStringPrefix
|
||||
syn match zigMultilineStringPrefix display contained /c\?\\\\/
|
||||
syn region zigMultilineString start="c\?\\\\" end="$" contains=zigMultilineStringPrefix
|
||||
syntax match zigMultilineStringPrefix /c\?\\\\/ contained containedin=zigMultilineString
|
||||
syntax region zigMultilineString matchgroup=zigMultilineStringDelimiter start="c\?\\\\" end="$" contains=zigMultilineStringPrefix display
|
||||
|
||||
syn keyword zigTodo contained TODO
|
||||
syntax keyword zigTodo contained TODO
|
||||
|
||||
syn match zigEscapeError display contained /\\./
|
||||
syn match zigEscape display contained /\\\([nrt\\'"]\|x\x\{2}\)/
|
||||
syn match zigEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{6}\)/
|
||||
syn region zigString start=+c\?"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=zigEscape,zigEscapeUnicode,zigEscapeError,@Spell
|
||||
syntax region zigString matchgroup=zigStringDelimiter start=+c\?"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=zigEscape,zigEscapeUnicode,zigEscapeError,@Spell
|
||||
syntax match zigEscapeError display contained /\\./
|
||||
syntax match zigEscape display contained /\\\([nrt\\'"]\|x\x\{2}\)/
|
||||
syntax match zigEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{6}\)/
|
||||
|
||||
hi def link zigDecNumber zigNumber
|
||||
hi def link zigHexNumber zigNumber
|
||||
hi def link zigOctNumber zigNumber
|
||||
hi def link zigBinNumber zigNumber
|
||||
highlight default link zigDecNumber zigNumber
|
||||
highlight default link zigHexNumber zigNumber
|
||||
highlight default link zigOctNumber zigNumber
|
||||
highlight default link zigBinNumber zigNumber
|
||||
|
||||
hi def link zigBuiltinFn Function
|
||||
hi def link zigKeyword Keyword
|
||||
hi def link zigType Type
|
||||
hi def link zigCommentLine Comment
|
||||
hi def link zigCommentLineDoc SpecialComment
|
||||
hi def link zigTodo Todo
|
||||
hi def link zigString String
|
||||
hi def link zigMultilineString String
|
||||
hi def link zigMultilineStringContent String
|
||||
hi def link zigMultilineStringPrefix Comment
|
||||
hi def link zigCharacterInvalid Error
|
||||
hi def link zigCharacterInvalidUnicode zigCharacterInvalid
|
||||
hi def link zigCharacter Character
|
||||
hi def link zigEscape Special
|
||||
hi def link zigEscapeUnicode zigEscape
|
||||
hi def link zigEscapeError Error
|
||||
hi def link zigBoolean Boolean
|
||||
hi def link zigConstant Constant
|
||||
hi def link zigNumber Number
|
||||
hi def link zigArrowCharacter zigOperator
|
||||
hi def link zigOperator Operator
|
||||
hi def link zigStorage StorageClass
|
||||
hi def link zigStructure Structure
|
||||
hi def link zigStatement Statement
|
||||
hi def link zigConditional Conditional
|
||||
hi def link zigRepeat Repeat
|
||||
highlight default link zigBuiltinFn Statement
|
||||
highlight default link zigKeyword Keyword
|
||||
highlight default link zigType Type
|
||||
highlight default link zigCommentLine Comment
|
||||
highlight default link zigCommentLineDoc Comment
|
||||
highlight default link zigDummyVariable Comment
|
||||
highlight default link zigTodo Todo
|
||||
highlight default link zigString String
|
||||
highlight default link zigStringDelimiter Delimiter
|
||||
highlight default link zigMultilineString String
|
||||
highlight default link zigMultilineStringContent String
|
||||
highlight default link zigMultilineStringPrefix String
|
||||
highlight default link zigMultilineStringDelimiter Ignore
|
||||
highlight default link zigCharacterInvalid Error
|
||||
highlight default link zigCharacterInvalidUnicode zigCharacterInvalid
|
||||
highlight default link zigCharacter Character
|
||||
highlight default link zigEscape Special
|
||||
highlight default link zigEscapeUnicode zigEscape
|
||||
highlight default link zigEscapeError Error
|
||||
highlight default link zigBoolean Boolean
|
||||
highlight default link zigNull Boolean
|
||||
highlight default link zigConstant Constant
|
||||
highlight default link zigNumber Number
|
||||
highlight default link zigArrowCharacter zigOperator
|
||||
highlight default link zigOperator Operator
|
||||
highlight default link zigStructure Structure
|
||||
highlight default link zigExecution Special
|
||||
highlight default link zigMacro Macro
|
||||
highlight default link zigConditional Conditional
|
||||
highlight default link zigComparatorWord Operator
|
||||
highlight default link zigRepeat Repeat
|
||||
highlight default link zigSpecial Special
|
||||
highlight default link zigVarDecl Function
|
||||
highlight default link zigPreProc PreProc
|
||||
highlight default link zigException Exception
|
||||
|
||||
delfunction s:syntax_keyword
|
||||
|
||||
let b:current_syntax = "zig"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet! s:cpo_save
|
||||
|
||||
Reference in New Issue
Block a user