From fd74d8b2b170b540680a9bbf6c64990f8ebafd08 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 8 Oct 2018 19:00:59 +0200 Subject: [PATCH] Update --- README.md | 2 +- after/ftplugin/jsx.vim | 5 +- after/ftplugin/terraform.vim | 7 + after/syntax/jsx.vim | 6 +- after/syntax/yaml.vim | 7 +- autoload/crystal_lang.vim | 4 + autoload/elixir/indent.vim | 347 ++--- autoload/go/config.vim | 18 +- autoload/julia/doc.vim | 246 ++++ autoload/julia_blocks.vim | 4 +- autoload/julia_latex_symbols.vim | 2295 +++++++++++++++--------------- autoload/rubycomplete.vim | 35 +- autoload/rust.vim | 97 +- autoload/rust/debugging.vim | 1 + autoload/rust/delimitmate.vim | 48 + autoload/rustfmt.vim | 142 +- compiler/cargo.vim | 4 + compiler/nix-build.vim | 15 + compiler/rspec.vim | 1 + compiler/rustc.vim | 10 +- ftdetect/polyglot.vim | 31 +- ftplugin/crystal.vim | 1 + ftplugin/git.vim | 2 +- ftplugin/julia.vim | 11 +- ftplugin/juliadoc.vim | 34 + ftplugin/rust.vim | 44 +- ftplugin/rust/tagbar.vim | 32 +- ftplugin/slim.vim | 18 +- ftplugin/terraform.vim | 73 + ftplugin/vue.vim | 4 +- indent/crystal.vim | 6 +- indent/cython.vim | 64 +- indent/dart.vim | 2 +- indent/go.vim | 23 +- indent/julia.vim | 5 +- indent/markdown.vim | 16 +- indent/nix.vim | 16 +- indent/python.vim | 64 +- indent/ruby.vim | 42 +- indent/rust.vim | 36 +- syntax/Jenkinsfile.vim | 12 +- syntax/carp.vim | 4 +- syntax/crystal.vim | 95 +- syntax/gitcommit.vim | 2 +- syntax/go.vim | 15 +- syntax/gomod.vim | 50 + syntax/javascript.vim | 6 +- syntax/julia.vim | 184 ++- syntax/juliadoc.vim | 69 + syntax/markdown.vim | 29 +- syntax/mustache.vim | 6 +- syntax/nix.vim | 85 +- syntax/pug.vim | 2 +- syntax/qml.vim | 4 +- syntax/rust.vim | 15 +- syntax/swift.vim | 2 + syntax/toml.vim | 12 +- syntax/typescript.vim | 48 +- syntax/vifm.vim | 20 +- 59 files changed, 2570 insertions(+), 1908 deletions(-) create mode 100644 autoload/julia/doc.vim create mode 100644 autoload/rust/delimitmate.vim create mode 100644 compiler/nix-build.vim create mode 100644 ftplugin/juliadoc.vim create mode 100644 ftplugin/terraform.vim create mode 100644 syntax/gomod.vim create mode 100644 syntax/juliadoc.vim diff --git a/README.md b/README.md index e620b91..fa70aff 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ If you need full functionality of any plugin, please use it directly with your p - [mathematica](https://github.com/rsmenon/vim-mathematica) (syntax, ftplugin) - [nginx](https://github.com/chr4/nginx.vim) (syntax, indent, ftplugin) - [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent) -- [nix](https://github.com/LnL7/vim-nix) (syntax, indent, ftplugin) +- [nix](https://github.com/LnL7/vim-nix) (syntax, indent, compiler, ftplugin) - [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent) - [ocaml](https://github.com/jrk/vim-ocaml) (syntax, indent, ftplugin) - [octave](https://github.com/vim-scripts/octave.vim--) (syntax) diff --git a/after/ftplugin/jsx.vim b/after/ftplugin/jsx.vim index a568289..380d476 100644 --- a/after/ftplugin/jsx.vim +++ b/after/ftplugin/jsx.vim @@ -11,8 +11,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1 " modified from html.vim if exists("loaded_matchit") let b:match_ignorecase = 0 - let b:match_words = '(:),\[:\],{:},<:>,' . + let s:jsx_match_words = '(:),\[:\],{:},<:>,' . \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(/\@\|$\):<\@<=/\1>' + let b:match_words = exists('b:match_words') + \ ? b:match_words . ',' . s:jsx_match_words + \ : s:jsx_match_words endif setlocal suffixesadd+=.jsx diff --git a/after/ftplugin/terraform.vim b/after/ftplugin/terraform.vim index 1328931..48ae0f2 100644 --- a/after/ftplugin/terraform.vim +++ b/after/ftplugin/terraform.vim @@ -75,4 +75,11 @@ if get(g:, "terraform_align", 1) setlocal shiftwidth=2 endif +" Set the commentstring +if exists('g:terraform_commentstring') + let &l:commentstring=g:terraform_commentstring +else + setlocal commentstring=#%s +endif + endif diff --git a/after/syntax/jsx.vim b/after/syntax/jsx.vim index 0598714..1785b4b 100644 --- a/after/syntax/jsx.vim +++ b/after/syntax/jsx.vim @@ -36,6 +36,10 @@ endif " jsBlock take care of ending the region. syn region xmlString contained start=+{+ end=++ contains=jsBlock,javascriptBlock +" JSX comments inside XML tag should color as comment. Note the trivial end pattern; we let +" jsComment take care of ending the region. +syn region xmlString contained start=+//+ end=++ contains=jsComment + " JSX child blocks behave just like JSX attributes, except that (a) they are " syntactically distinct, and (b) they need the syn-extend argument, or else " nested XML end-tag patterns may end the outer jsxRegion. @@ -49,7 +53,7 @@ syn region jsxChild contained start=+{+ end=++ contains=jsBlock,javascriptBlock " and generic Flow type annotations (http://flowtype.org/). syn region jsxRegion \ contains=@Spell,@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock - \ start=+\%(<\|\w\)\@[:,]\@!\)\([^>]*>(\)\@!+ + \ start=+\%(<\|\w\)\@[:,]\@!\)\([^>]*>(\)\@!+ \ skip=++ \ end=++ \ end=+/>+ diff --git a/after/syntax/yaml.vim b/after/syntax/yaml.vim index 0a4a4af..489691b 100644 --- a/after/syntax/yaml.vim +++ b/after/syntax/yaml.vim @@ -21,13 +21,17 @@ if version < 600 endif syntax clear -syn match yamlBlock "[\[\]\{\}\|\>]" +syn match yamlInline "[\[\]\{\}]" +syn match yamlBlock "[>|]\d\?[+-]" syn region yamlComment start="\#" end="$" syn match yamlIndicator "#YAML:\S\+" syn region yamlString start="\(^\|\s\|\[\|\,\|\-\)'" end="'" skip="\\'" syn region yamlString start='"' end='"' skip='\\"' contains=yamlEscape +syn region yamlString matchgroup=yamlBlock start=/[>|]\s*\n\+\z(\s\+\)\S/rs=s+1 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1 +syn region yamlString matchgroup=yamlBlock start=/[>|]\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+2 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1 +syn region yamlString matchgroup=yamlBlock start=/[>|]\d\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+3 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1 syn match yamlEscape +\\[abfnrtv'"\\]+ contained syn match yamlEscape "\\\o\o\=\o\=" contained syn match yamlEscape "\\x\x\+" contained @@ -53,6 +57,7 @@ hi link yamlKey Identifier hi link yamlType Type hi link yamlComment Comment +hi link yamlInline Operator hi link yamlBlock Operator hi link yamlString String hi link yamlEscape Special diff --git a/autoload/crystal_lang.vim b/autoload/crystal_lang.vim index aaf626c..bffa721 100644 --- a/autoload/crystal_lang.vim +++ b/autoload/crystal_lang.vim @@ -310,6 +310,10 @@ function! crystal_lang#format(option_str, ...) abort call setpos('.', pos_save) endfunction +function! crystal_lang#expand(file, pos, ...) abort + return crystal_lang#tool('expand', a:file, a:pos, get(a:, 1, '')) +endfunction + let &cpo = s:save_cpo unlet s:save_cpo diff --git a/autoload/elixir/indent.vim b/autoload/elixir/indent.vim index aca5a2f..20271ac 100644 --- a/autoload/elixir/indent.vim +++ b/autoload/elixir/indent.vim @@ -23,22 +23,18 @@ function! elixir#indent#indent(lnum) let handlers = [ \'top_of_file', - \'starts_with_end', - \'starts_with_mid_or_end_block_keyword', - \'following_trailing_do', - \'following_trailing_rocket', \'following_trailing_binary_operator', \'starts_with_pipe', - \'starts_with_close_bracket', \'starts_with_binary_operator', - \'inside_nested_construct', - \'starts_with_comment', + \'inside_block', + \'starts_with_end', \'inside_generic_block', \'follow_prev_nb' \] for handler in handlers call s:debug('testing handler elixir#indent#handle_'.handler) - let indent = function('elixir#indent#handle_'.handler)(lnum, text, prev_nb_lnum, prev_nb_text) + let context = {'lnum': lnum, 'text': text, 'prev_nb_lnum': prev_nb_lnum, 'prev_nb_text': prev_nb_text} + let indent = function('elixir#indent#handle_'.handler)(context) if indent != -1 call s:debug('line '.lnum.': elixir#indent#handle_'.handler.' returned '.indent) call cursor(curs_lnum, curs_col) @@ -57,9 +53,17 @@ function! s:debug(str) endif endfunction +function! s:starts_with(context, expr) + return s:_starts_with(a:context.text, a:expr, a:context.lnum) +endfunction + +function! s:prev_starts_with(context, expr) + return s:_starts_with(a:context.prev_nb_text, a:expr, a:context.prev_nb_lnum) +endfunction + " Returns 0 or 1 based on whether or not the text starts with the given " expression and is not a string or comment -function! s:starts_with(text, expr, lnum) +function! s:_starts_with(text, expr, lnum) let pos = match(a:text, '^\s*'.a:expr) if pos == -1 return 0 @@ -74,9 +78,13 @@ function! s:starts_with(text, expr, lnum) end endfunction +function! s:prev_ends_with(context, expr) + return s:_ends_with(a:context.prev_nb_text, a:expr, a:context.prev_nb_lnum) +endfunction + " Returns 0 or 1 based on whether or not the text ends with the given " expression and is not a string or comment -function! s:ends_with(text, expr, lnum) +function! s:_ends_with(text, expr, lnum) let pos = match(a:text, a:expr.'\s*$') if pos == -1 return 0 @@ -140,16 +148,16 @@ function! s:find_last_pos(lnum, text, match) return -1 endfunction -function! elixir#indent#handle_top_of_file(_lnum, _text, prev_nb_lnum, _prev_nb_text) - if a:prev_nb_lnum == 0 +function! elixir#indent#handle_top_of_file(context) + if a:context.prev_nb_lnum == 0 return 0 else return -1 end endfunction -function! elixir#indent#handle_follow_prev_nb(_lnum, _text, prev_nb_lnum, prev_nb_text) - return s:get_base_indent(a:prev_nb_lnum, a:prev_nb_text) +function! elixir#indent#handle_follow_prev_nb(context) + return s:get_base_indent(a:context.prev_nb_lnum, a:context.prev_nb_text) endfunction " Given the line at `lnum`, returns the indent of the line that acts as the 'base indent' @@ -163,13 +171,13 @@ function! s:get_base_indent(lnum, text) let data_structure_close = '\%(\]\|}\|)\)' let pipe = '|>' - if s:starts_with(a:text, binary_operator, a:lnum) + if s:_starts_with(a:text, binary_operator, a:lnum) return s:get_base_indent(prev_nb_lnum, prev_nb_text) - elseif s:starts_with(a:text, pipe, a:lnum) + elseif s:_starts_with(a:text, pipe, a:lnum) return s:get_base_indent(prev_nb_lnum, prev_nb_text) - elseif s:ends_with(prev_nb_text, binary_operator, prev_nb_lnum) + elseif s:_ends_with(prev_nb_text, binary_operator, prev_nb_lnum) return s:get_base_indent(prev_nb_lnum, prev_nb_text) - elseif s:ends_with(a:text, data_structure_close, a:lnum) + elseif s:_ends_with(a:text, data_structure_close, a:lnum) let data_structure_open = '\%(\[\|{\|(\)' let close_match_idx = match(a:text, data_structure_close . '\s*$') call cursor(a:lnum, close_match_idx + 1) @@ -181,54 +189,26 @@ function! s:get_base_indent(lnum, text) endif endfunction -function! elixir#indent#handle_following_trailing_do(lnum, text, prev_nb_lnum, prev_nb_text) - if s:ends_with(a:prev_nb_text, s:keyword('do'), a:prev_nb_lnum) - if s:starts_with(a:text, s:keyword('end'), a:lnum) - return indent(a:prev_nb_lnum) - else - return indent(a:prev_nb_lnum) + s:sw() - end - else - return -1 - endif -endfunction - -function! elixir#indent#handle_following_trailing_rocket(lnum, text, prev_nb_lnum, prev_nb_text) - if s:ends_with(a:prev_nb_text, '->', a:prev_nb_lnum) - return indent(a:prev_nb_lnum) + s:sw() - else - return -1 - endif -endfunction - -function! elixir#indent#handle_following_trailing_binary_operator(lnum, text, prev_nb_lnum, prev_nb_text) +function! elixir#indent#handle_following_trailing_binary_operator(context) let binary_operator = '\%(=\|<>\|>>>\|<=\|||\|+\|\~\~\~\|-\|&&\|<<<\|/\|\^\^\^\|\*\)' - if s:ends_with(a:prev_nb_text, binary_operator, a:prev_nb_lnum) - return indent(a:prev_nb_lnum) + s:sw() + if s:prev_ends_with(a:context, binary_operator) + return indent(a:context.prev_nb_lnum) + s:sw() else return -1 endif endfunction -function! elixir#indent#handle_following_prev_end(_lnum, _text, prev_nb_lnum, prev_nb_text) - if s:ends_with(a:prev_nb_text, s:keyword('end'), a:prev_nb_lnum) - return indent(a:prev_nb_lnum) - else - return -1 - endif -endfunction - -function! elixir#indent#handle_starts_with_pipe(lnum, text, prev_nb_lnum, prev_nb_text) - if s:starts_with(a:text, '|>', a:lnum) +function! elixir#indent#handle_starts_with_pipe(context) + if s:starts_with(a:context, '|>') let match_operator = '\%(!\|=\|<\|>\)\@\|\~\)\@!' - let pos = s:find_last_pos(a:prev_nb_lnum, a:prev_nb_text, match_operator) + let pos = s:find_last_pos(a:context.prev_nb_lnum, a:context.prev_nb_text, match_operator) if pos == -1 - return indent(a:prev_nb_lnum) + return indent(a:context.prev_nb_lnum) else - let next_word_pos = match(strpart(a:prev_nb_text, pos+1, len(a:prev_nb_text)-1), '\S') + let next_word_pos = match(strpart(a:context.prev_nb_text, pos+1, len(a:context.prev_nb_text)-1), '\S') if next_word_pos == -1 - return indent(a:prev_nb_lnum) + s:sw() + return indent(a:context.prev_nb_lnum) + s:sw() else return pos + 1 + next_word_pos end @@ -238,16 +218,8 @@ function! elixir#indent#handle_starts_with_pipe(lnum, text, prev_nb_lnum, prev_n endif endfunction -function! elixir#indent#handle_starts_with_comment(_lnum, text, prev_nb_lnum, _prev_nb_text) - if match(a:text, '^\s*#') != -1 - return indent(a:prev_nb_lnum) - else - return -1 - endif -endfunction - -function! elixir#indent#handle_starts_with_end(lnum, text, _prev_nb_lnum, _prev_nb_text) - if s:starts_with(a:text, s:keyword('end'), a:lnum) +function! elixir#indent#handle_starts_with_end(context) + if s:starts_with(a:context, s:keyword('end')) let pair_lnum = searchpair(s:keyword('do\|fn'), '', s:keyword('end').'\zs', 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip()") return indent(pair_lnum) else @@ -255,36 +227,18 @@ function! elixir#indent#handle_starts_with_end(lnum, text, _prev_nb_lnum, _prev_ endif endfunction -function! elixir#indent#handle_starts_with_mid_or_end_block_keyword(lnum, text, _prev_nb_lnum, _prev_nb_text) - if s:starts_with(a:text, s:keyword('catch\|rescue\|after\|else'), a:lnum) - let pair_lnum = searchpair(s:keyword('with\|receive\|try\|if\|fn'), s:keyword('catch\|rescue\|after\|else').'\zs', s:keyword('end'), 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip()") - return indent(pair_lnum) - else - return -1 - endif -endfunction - -function! elixir#indent#handle_starts_with_close_bracket(lnum, text, _prev_nb_lnum, _prev_nb_text) - if s:starts_with(a:text, '\%(\]\|}\|)\)', a:lnum) - let pair_lnum = searchpair('\%(\[\|{\|(\)', '', '\%(\]\|}\|)\)', 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip()") - return indent(pair_lnum) - else - return -1 - endif -endfunction - -function! elixir#indent#handle_starts_with_binary_operator(lnum, text, prev_nb_lnum, prev_nb_text) +function! elixir#indent#handle_starts_with_binary_operator(context) let binary_operator = '\%(=\|<>\|>>>\|<=\|||\|+\|\~\~\~\|-\|&&\|<<<\|/\|\^\^\^\|\*\)' - if s:starts_with(a:text, binary_operator, a:lnum) + if s:starts_with(a:context, binary_operator) let match_operator = '\%(!\|=\|<\|>\)\@\|\~\)\@!' - let pos = s:find_last_pos(a:prev_nb_lnum, a:prev_nb_text, match_operator) + let pos = s:find_last_pos(a:context.prev_nb_lnum, a:context.prev_nb_text, match_operator) if pos == -1 - return indent(a:prev_nb_lnum) + return indent(a:context.prev_nb_lnum) else - let next_word_pos = match(strpart(a:prev_nb_text, pos+1, len(a:prev_nb_text)-1), '\S') + let next_word_pos = match(strpart(a:context.prev_nb_text, pos+1, len(a:context.prev_nb_text)-1), '\S') if next_word_pos == -1 - return indent(a:prev_nb_lnum) + s:sw() + return indent(a:context.prev_nb_lnum) + s:sw() else return pos + 1 + next_word_pos end @@ -298,162 +252,89 @@ endfunction " nested structure. For example, we might be in a function in a map in a " function, etc... so we need to first figure out what the innermost structure " is then forward execution to the proper handler -function! elixir#indent#handle_inside_nested_construct(lnum, text, prev_nb_lnum, prev_nb_text) +function! elixir#indent#handle_inside_block(context) let start_pattern = '\C\%(\\|\\|\\|\\|\\|\\|\\|{\|\[\|(\)' let end_pattern = '\C\%(\\|\]\|}\|)\)' - let pair_info = searchpairpos(start_pattern, '', end_pattern, 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip()", max([0, a:lnum - g:elixir_indent_max_lookbehind])) - let pair_lnum = pair_info[0] - let pair_col = pair_info[1] - if pair_lnum != 0 || pair_col != 0 - let pair_text = getline(pair_lnum) - let pair_char = pair_text[pair_col - 1] - if pair_char == 'f' - call s:debug("testing s:do_handle_inside_fn") - return s:do_handle_inside_fn(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text) - elseif pair_char == '[' - call s:debug("testing s:do_handle_inside_square_brace") - return s:do_handle_inside_square_brace(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text) - elseif pair_char == '{' - call s:debug("testing s:do_handle_inside_curly_brace") - return s:do_handle_inside_curly_brace(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text) - elseif pair_char == '(' - call s:debug("testing s:do_handle_inside_parens") - return s:do_handle_inside_parens(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text) - elseif pair_char == 'w' - call s:debug("testing s:do_handle_inside_with") - return s:do_handle_inside_with(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text) + " hack - handle do: better + let block_info = searchpairpos(start_pattern, '', end_pattern, 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip() || getline(line('.')) =~ 'do:'", max([0, a:context.lnum - g:elixir_indent_max_lookbehind])) + let block_start_lnum = block_info[0] + let block_start_col = block_info[1] + if block_start_lnum != 0 || block_start_col != 0 + let block_text = getline(block_start_lnum) + let block_start_char = block_text[block_start_col - 1] + + let never_match = '\(a\)\@=b' + let config = { + \'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match}, + \'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match}, + \'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after'), 'pattern_match_clauses': s:keyword('catch\|rescue')}, + \'r': {'aligned_clauses': s:keyword('end\|after'), 'pattern_match_clauses': s:keyword('after')}, + \'i': {'aligned_clauses': s:keyword('end\|else'), 'pattern_match_clauses': never_match}, + \'[': {'aligned_clauses': ']', 'pattern_match_clauses': never_match}, + \'{': {'aligned_clauses': '}', 'pattern_match_clauses': never_match}, + \'(': {'aligned_clauses': ')', 'pattern_match_clauses': never_match} + \} + + if block_start_char == 'w' + call s:debug("testing s:handle_with") + return s:handle_with(block_start_lnum, block_start_col, a:context) else - call s:debug("testing s:do_handle_inside_keyword_block") - return s:do_handle_inside_keyword_block(pair_lnum, pair_col, a:lnum, a:text, a:prev_nb_lnum, a:prev_nb_text) - end - else - return -1 - end -endfunction - -function! s:do_handle_inside_with(pair_lnum, pair_col, lnum, text, prev_nb_lnum, prev_nb_text) - if a:pair_lnum == a:lnum - " This is the `with` line or an inline `with`/`do` - call s:debug("current line is `with`") - return -1 - else - " Determine if in with/do, do/else|end, or else/end - let start_pattern = '\C\%(\\|\\|\\)' - let end_pattern = '\C\%(\\)' - let pair_info = searchpairpos(start_pattern, '', end_pattern, 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip()") - let pair_lnum = pair_info[0] - let pair_col = pair_info[1] - - let pair_text = getline(pair_lnum) - let pair_char = pair_text[pair_col - 1] - - if s:starts_with(a:text, '\Cdo:', a:lnum) - call s:debug("current line is do:") - return pair_col - 1 + s:sw() - elseif s:starts_with(a:text, '\Celse:', a:lnum) - call s:debug("current line is else:") - return pair_col - 1 - elseif s:starts_with(a:text, '\C\(\\|\\)', a:lnum) - call s:debug("current line is do/else") - return pair_col - 1 - elseif s:starts_with(pair_text, '\C\(do\|else\):', pair_lnum) - call s:debug("inside do:/else:") - return pair_col - 1 + s:sw() - elseif pair_char == 'w' - call s:debug("inside with/do") - return pair_col + 4 - elseif pair_char == 'd' - call s:debug("inside do/else|end") - return pair_col - 1 + s:sw() - else - call s:debug("inside else/end") - return s:do_handle_inside_pattern_match_block(pair_lnum, a:text, a:prev_nb_lnum, a:prev_nb_text) - end - end -endfunction - -function! s:do_handle_inside_keyword_block(pair_lnum, _pair_col, _lnum, text, prev_nb_lnum, prev_nb_text) - let keyword_pattern = '\C\%(\\|\\|\\|\\|\\|\\|\\|\\)' - if a:pair_lnum - " last line is a "receive" or something - if s:starts_with(a:prev_nb_text, keyword_pattern, a:prev_nb_lnum) - call s:debug("prev nb line is keyword") - return indent(a:prev_nb_lnum) + s:sw() - else - return s:do_handle_inside_pattern_match_block(a:pair_lnum, a:text, a:prev_nb_lnum, a:prev_nb_text) - end - else - return -1 - endif -endfunction - -" Implements indent for pattern-matching blocks (e.g. case, fn, with/else) -function! s:do_handle_inside_pattern_match_block(block_start_lnum, text, prev_nb_lnum, prev_nb_text) - if a:text =~ '->' - call s:debug("current line contains ->") - return indent(a:block_start_lnum) + s:sw() - elseif a:prev_nb_text =~ '->' - call s:debug("prev nb line contains ->") - return indent(a:prev_nb_lnum) + s:sw() - else - return indent(a:prev_nb_lnum) - end -endfunction - -function! s:do_handle_inside_fn(pair_lnum, _pair_col, lnum, text, prev_nb_lnum, prev_nb_text) - if a:pair_lnum && a:pair_lnum != a:lnum - return s:do_handle_inside_pattern_match_block(a:pair_lnum, a:text, a:prev_nb_lnum, a:prev_nb_text) - else - return -1 - endif -endfunction - -function! s:do_handle_inside_square_brace(pair_lnum, pair_col, _lnum, _text, _prev_nb_lnum, _prev_nb_text) - " If in list... - if a:pair_lnum != 0 || a:pair_col != 0 - let pair_text = getline(a:pair_lnum) - let substr = strpart(pair_text, a:pair_col, len(pair_text)-1) - let indent_pos = match(substr, '\S') - if indent_pos != -1 - return indent_pos + a:pair_col - else - return indent(a:pair_lnum) + s:sw() - endif - else - return -1 - end -endfunction - -function! s:do_handle_inside_curly_brace(pair_lnum, _pair_col, _lnum, _text, _prev_nb_lnum, _prev_nb_text) - return indent(a:pair_lnum) + s:sw() -endfunction - -function! s:do_handle_inside_parens(pair_lnum, pair_col, _lnum, _text, prev_nb_lnum, prev_nb_text) - if a:pair_lnum - if s:ends_with(a:prev_nb_text, '(', a:prev_nb_lnum) - return indent(a:prev_nb_lnum) + s:sw() - elseif a:pair_lnum == a:prev_nb_lnum - " Align indent (e.g. "def add(a,") - let pos = s:find_last_pos(a:prev_nb_lnum, a:prev_nb_text, '[^(]\+,') - if pos == -1 - return 0 + let block_config = config[block_start_char] + if s:starts_with(a:context, block_config.aligned_clauses) + call s:debug("clause") + return indent(block_start_lnum) else - return pos - end - else - return indent(a:prev_nb_lnum) + let clause_lnum = searchpair(block_config.pattern_match_clauses, '', '*', 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip()", block_start_lnum) + let relative_lnum = max([clause_lnum, block_start_lnum]) + call s:debug("pattern matching relative to lnum " . relative_lnum) + return s:do_handle_pattern_match_block(relative_lnum, a:context) + endif end else return -1 - endif + end endfunction -function! elixir#indent#handle_inside_generic_block(lnum, _text, prev_nb_lnum, prev_nb_text) - let pair_lnum = searchpair(s:keyword('do\|fn'), '', s:keyword('end'), 'bW', "line('.') == ".a:lnum." || s:is_string_or_comment(line('.'), col('.'))", max([0, a:lnum - g:elixir_indent_max_lookbehind])) +function! s:handle_with(start_lnum, start_col, context) + let block_info = searchpairpos('\C\%(\\|\\|\\)', '', s:keyword('end'), 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip()") + let block_start_lnum = block_info[0] + let block_start_col = block_info[1] + + let block_start_text = getline(block_start_lnum) + let block_start_char = block_start_text[block_start_col - 1] + + if s:starts_with(a:context, s:keyword('do\|else\|end')) + return indent(a:start_lnum) + elseif block_start_char == 'w' || s:starts_with(a:context, '\C\(do\|else\):') + return indent(a:start_lnum) + 5 + elseif s:_starts_with(block_start_text, '\C\(do\|else\):', a:start_lnum) + return indent(block_start_lnum) + s:sw() + else + return s:do_handle_pattern_match_block(a:start_lnum, a:context) + end +endfunction + +function! s:do_handle_pattern_match_block(relative_line, context) + let relative_indent = indent(a:relative_line) + " hack! + if a:context.text =~ '\(fn.*\)\@' + call s:debug("current line contains ->; assuming match definition") + return relative_indent + s:sw() + elseif search('\(fn.*\)\@', 'bnW', a:relative_line) != 0 + call s:debug("a previous line contains ->; assuming match handler") + return relative_indent + 2 * s:sw() + else + call s:debug("couldn't find any previous ->; assuming body text") + return relative_indent + s:sw() + end +endfunction + +function! elixir#indent#handle_inside_generic_block(context) + let pair_lnum = searchpair(s:keyword('do\|fn'), '', s:keyword('end'), 'bW', "line('.') == ".a:context.lnum." || s:is_string_or_comment(line('.'), col('.'))", max([0, a:context.lnum - g:elixir_indent_max_lookbehind])) if pair_lnum " TODO: @jbodah 2017-03-29: this should probably be the case in *all* " blocks - if s:ends_with(a:prev_nb_text, ',', a:prev_nb_lnum) + if s:prev_ends_with(a:context, ',') return indent(pair_lnum) + 2 * s:sw() else return indent(pair_lnum) + s:sw() diff --git a/autoload/go/config.vim b/autoload/go/config.vim index 5eef48d..9ed523a 100644 --- a/autoload/go/config.vim +++ b/autoload/go/config.vim @@ -137,10 +137,6 @@ function! go#config#SetGuruScope(scope) abort endif endfunction -function! go#config#GocodeUnimportedPackages() abort - return get(g:, 'go_gocode_unimported_packages', 0) -endfunction - let s:sock_type = (has('win32') || has('win64')) ? 'tcp' : 'unix' function! go#config#GocodeSocketType() abort return get(g:, 'go_gocode_socket_type', s:sock_type) @@ -150,8 +146,8 @@ function! go#config#GocodeProposeBuiltins() abort return get(g:, 'go_gocode_propose_builtins', 1) endfunction -function! go#config#GocodeAutobuild() abort - return get(g:, 'go_gocode_autobuild', 1) +function! go#config#GocodeProposeSource() abort + return get(g:, 'go_gocode_propose_source', 1) endfunction function! go#config#EchoCommandInfo() abort @@ -284,6 +280,14 @@ function! go#config#SetAsmfmtAutosave(value) abort let g:go_asmfmt_autosave = a:value endfunction +function! go#config#ModFmtAutosave() abort + return get(g:, "go_mod_fmt_autosave", 1) +endfunction + +function! go#config#SetModFmtAutosave(value) abort + let g:go_mod_fmt_autosave = a:value +endfunction + function! go#config#DocMaxHeight() abort return get(g:, "go_doc_max_height", 20) endfunction @@ -418,7 +422,7 @@ function! go#config#HighlightVariableDeclarations() abort return get(g:, 'go_highlight_variable_declarations', 0) endfunction -function go#config#FoldEnable(...) abort +function! go#config#FoldEnable(...) abort if a:0 > 0 return index(go#config#FoldEnable(), a:1) > -1 endif diff --git a/autoload/julia/doc.vim b/autoload/julia/doc.vim new file mode 100644 index 0000000..8a9cab5 --- /dev/null +++ b/autoload/julia/doc.vim @@ -0,0 +1,246 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1 + +" path to the julia binary to communicate with +if has('win32') || has('win64') + if exists('g:julia#doc#juliapath') + " use assigned g:julia#doc#juliapath + elseif executable('julia') + " use julia command in PATH + let g:julia#doc#juliapath = 'julia' + else + " search julia binary in the default installation paths + let pathlist = sort(glob($LOCALAPPDATA . '\Julia-*\bin\julia.exe', 1, 1)) + let g:julia#doc#juliapath = get(pathlist, -1, 'julia') + endif +else + let g:julia#doc#juliapath = get(g:, 'julia#doc#juliapath', 'julia') +endif + +function! s:version() abort + let VERSION = {'major': 0, 'minor': 0} + if !executable(g:julia#doc#juliapath) + return VERSION + endif + + let cmd = printf('%s -v', g:julia#doc#juliapath) + let output = system(cmd) + let versionstr = matchstr(output, '\C^julia version \zs\d\+\.\d\+\ze') + let [major, minor] = map(split(versionstr, '\.'), 'str2nr(v:val)') + let VERSION.major = major + let VERSION.minor = minor + return VERSION +endfunction + +let s:VERSION = s:version() +let s:NODOCPATTERN = '\C\VNo documentation found.' + +function! julia#doc#lookup(keyword, ...) abort + let juliapath = get(a:000, 0, g:julia#doc#juliapath) + let keyword = escape(a:keyword, '"\') + let cmd = printf('%s -E "@doc %s"', juliapath, keyword) + return systemlist(cmd) +endfunction + +function! julia#doc#open(keyword) abort + if empty(a:keyword) + call s:warn('Not an appropriate keyword.') + return + endif + + if !executable(g:julia#doc#juliapath) + call s:warn('%s command is not executable', g:julia#doc#juliapath) + return + endif + + let doc = julia#doc#lookup(a:keyword, g:julia#doc#juliapath) + if empty(doc) || match(doc[0], s:NODOCPATTERN) > -1 + call s:warn('No documentation found for "%s".', a:keyword) + return + endif + + " workaround for * and ? since a buffername cannot include them + let keyword = a:keyword + let keyword = substitute(keyword, '\*', ':asterisk:', 'g') + let keyword = substitute(keyword, '?', ':question:', 'g') + let buffername = printf('juliadoc: %s', keyword) + + call s:write_to_preview_window(doc, "juliadoc", buffername) + + call filter(s:HELPHISTORY, 'v:val isnot# a:keyword') + call add(s:HELPHISTORY, a:keyword) +endfunction + +function! s:write_to_preview_window(content, ftype, buffername) + " Are we in the preview window from the outset? If not, best to close any + " preview windows that might exist. + let pvw = &previewwindow + if !pvw + silent! pclose! + endif + execute "silent! pedit +setlocal\\ nobuflisted\\ noswapfile\\" + \ "buftype=nofile\\ bufhidden=wipe" a:buffername + silent! wincmd P + if &previewwindow + setlocal modifiable noreadonly + silent! %delete _ + call append(0, a:content) + silent! $delete _ + normal! ggj + setlocal nomodified readonly nomodifiable + execute "setfiletype" a:ftype + " Only return to a normal window if we didn't start in a preview window. + if !pvw + silent! wincmd p + endif + else + " We couldn't make it to the preview window, so as a fallback we dump the + " contents in the status area. + execute printf("echo '%s'", join(a:content, "\n")) + endif +endfunction + +function! s:warn(...) abort + if a:0 == 0 + return + endif + + echohl WarningMsg + try + if a:0 == 1 + echo a:1 + else + echo call('printf', a:000) + endif + finally + echohl None + endtry +endfunction + + + +let s:KEYWORDPATTERN = '\m@\?\h\k*!\?' + +" This function is called in normal mode or visual mode. +function! julia#doc#keywordprg(word) abort + if a:word is# '' + return + endif + + let word = s:unfnameescape(a:word) + if word is# expand('') + " 'K' in normal mode + " NOTE: Because ! and @ is not in 'iskeyword' option, this func ignore + " the argument to recognize keywords like "@time" and "push!" + let view = winsaveview() + let lnum = line('.') + let tail = searchpos(s:KEYWORDPATTERN, 'ce', lnum) + let head = searchpos(s:KEYWORDPATTERN, 'bc', lnum) + call winrestview(view) + if head == [0, 0] || tail == [0, 0] + return + else + let start = head[1] - 1 + let end = tail[1] - 1 + let word = getline(lnum)[start : end] + endif + endif + call julia#doc#open(word) +endfunction + +if exists('+shellslash') + let s:ESCAPEDCHARS = " \t\n\"#%'*' because fnameescape('-') ==# fnameescape('\-'). + if a:str is# '\-' + " Remove escape anyway. + return '-' + endif + + if a:str =~# '^\\[+>]' + let str = a:str[1:] + else + let str = a:str + endif + return substitute(str, s:FNAMEESCAPEPATTERN, '', 'g') +endfunction + + + +let s:HELPPROMPT = 'help?> ' +let s:HELPHISTORY = [] + +function! julia#doc#prompt() abort + let inputhist = s:savehistory('input') + echohl MoreMsg + try + call s:restorehistory('input', s:HELPHISTORY) + let keyword = input(s:HELPPROMPT, '', 'customlist,julia#doc#complete') + + " Clear the last prompt + normal! : + finally + echohl None + call s:restorehistory('input', inputhist) + endtry + + if empty(keyword) + return + endif + + call julia#doc#open(keyword) +endfunction + +function! s:savehistory(name) abort + if histnr(a:name) == -1 + return [] + endif + + let history = [] + for i in range(1, histnr(a:name)) + let item = histget(a:name, i) + if !empty(item) + call add(history, item) + endif + endfor + return history +endfunction + +function! s:restorehistory(name, history) abort + call histdel(a:name) + for item in a:history + call histadd(a:name, item) + endfor +endfunction + + + +if s:VERSION.major == 0 && s:VERSION.minor <= 6 + let s:REPL_SEARCH = 'Base.Docs.repl_search' +else + let s:REPL_SEARCH = 'import REPL.repl_search; repl_search' +endif + +function! julia#doc#complete(ArgLead, CmdLine, CursorPos) abort + return s:likely(a:ArgLead) +endfunction + +function! s:likely(str) abort + " escape twice + let str = escape(escape(a:str, '"\'), '"\') + let cmd = printf('%s -E "%s(\"%s\")"', g:julia#doc#juliapath, s:REPL_SEARCH, str) + let output = systemlist(cmd) + return split(matchstr(output[0], '\C^search: \zs.*')) +endfunction + +endif diff --git a/autoload/julia_blocks.vim b/autoload/julia_blocks.vim index ef7cf01..0362c8d 100644 --- a/autoload/julia_blocks.vim +++ b/autoload/julia_blocks.vim @@ -244,8 +244,8 @@ function! julia_blocks#init_mappings() call julia_blocks#select_reset() augroup JuliaBlocks au! - au InsertEnter *.jl call julia_blocks#select_reset() - au CursorMoved *.jl call s:cursor_moved() + au InsertEnter call julia_blocks#select_reset() + au CursorMoved call s:cursor_moved() augroup END " we would need some autocmd event associated with exiting from diff --git a/autoload/julia_latex_symbols.vim b/autoload/julia_latex_symbols.vim index 8fdb856..5dc87df 100644 --- a/autoload/julia_latex_symbols.vim +++ b/autoload/julia_latex_symbols.vim @@ -1,38 +1,36 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1 " This file is autogenerated from the script 'generate_latex_symbols_table.jl' -" The symbols are based on Julia version 0.7.0-DEV.2011 +" The symbols are based on Julia version 0.7.0-rc2.0 scriptencoding utf-8 function! julia_latex_symbols#get_dict() return { - \ '\textexclamdown': '¡', + \ '\exclamdown': '¡', \ '\sterling': '£', \ '\yen': '¥', - \ '\textbrokenbar': '¦', + \ '\brokenbar': '¦', \ '\S': '§', - \ '\textasciidieresis': '¨', \ '\copyright': '©', \ '\:copyright:': '©', - \ '\textordfeminine': 'ª', + \ '\ordfeminine': 'ª', \ '\neg': '¬', \ '\circledR': '®', \ '\:registered:': '®', - \ '\textasciimacron': '¯', + \ '\highminus': '¯', \ '\degree': '°', \ '\pm': '±', \ '\^2': '²', \ '\^3': '³', - \ '\textasciiacute': '´', \ '\P': '¶', \ '\cdotp': '·', \ '\^1': '¹', - \ '\textordmasculine': 'º', - \ '\textonequarter': '¼', - \ '\textonehalf': '½', - \ '\textthreequarters': '¾', - \ '\textquestiondown': '¿', + \ '\ordmasculine': 'º', + \ '\1/4': '¼', + \ '\1/2': '½', + \ '\3/4': '¾', + \ '\questiondown': '¿', \ '\AA': 'Å', \ '\AE': 'Æ', \ '\DH': 'Ð', @@ -43,80 +41,81 @@ function! julia_latex_symbols#get_dict() \ '\aa': 'å', \ '\ae': 'æ', \ '\eth': 'ð', + \ '\dh': 'ð', \ '\div': '÷', \ '\o': 'ø', \ '\th': 'þ', \ '\DJ': 'Đ', \ '\dj': 'đ', - \ '\Elzxh': 'ħ', \ '\hbar': 'ħ', + \ '\imath': 'ı', \ '\L': 'Ł', \ '\l': 'ł', \ '\NG': 'Ŋ', \ '\ng': 'ŋ', \ '\OE': 'Œ', \ '\oe': 'œ', - \ '\texthvlig': 'ƕ', - \ '\textnrleg': 'ƞ', + \ '\hvlig': 'ƕ', + \ '\nrleg': 'ƞ', \ '\Zbar': 'Ƶ', - \ '\textdoublepipe': 'ǂ', - \ '\Elztrna': 'ɐ', - \ '\Elztrnsa': 'ɒ', - \ '\Elzopeno': 'ɔ', - \ '\Elzrtld': 'ɖ', - \ '\Elzschwa': 'ə', - \ '\Elzpgamma': 'ɣ', - \ '\Elzpbgam': 'ɤ', - \ '\Elztrnh': 'ɥ', - \ '\Elzbtdl': 'ɬ', - \ '\Elzrtll': 'ɭ', - \ '\Elztrnm': 'ɯ', - \ '\Elztrnmlr': 'ɰ', - \ '\Elzltlmr': 'ɱ', - \ '\Elzltln': 'ɲ', - \ '\Elzrtln': 'ɳ', - \ '\Elzclomeg': 'ɷ', - \ '\textphi': 'ɸ', - \ '\Elztrnr': 'ɹ', - \ '\Elztrnrl': 'ɺ', - \ '\Elzrttrnr': 'ɻ', - \ '\Elzrl': 'ɼ', - \ '\Elzrtlr': 'ɽ', - \ '\Elzfhr': 'ɾ', - \ '\Elzrtls': 'ʂ', - \ '\Elzesh': 'ʃ', - \ '\Elztrnt': 'ʇ', - \ '\Elzrtlt': 'ʈ', - \ '\Elzpupsil': 'ʊ', - \ '\Elzpscrv': 'ʋ', - \ '\Elzinvv': 'ʌ', - \ '\Elzinvw': 'ʍ', - \ '\Elztrny': 'ʎ', - \ '\Elzrtlz': 'ʐ', - \ '\Elzyogh': 'ʒ', - \ '\Elzglst': 'ʔ', - \ '\Elzreglst': 'ʕ', - \ '\Elzinglst': 'ʖ', - \ '\textturnk': 'ʞ', - \ '\Elzdyogh': 'ʤ', - \ '\Elztesh': 'ʧ', + \ '\doublepipe': 'ǂ', + \ '\jmath': 'ȷ', + \ '\trna': 'ɐ', + \ '\trnsa': 'ɒ', + \ '\openo': 'ɔ', + \ '\rtld': 'ɖ', + \ '\schwa': 'ə', + \ '\pgamma': 'ɣ', + \ '\pbgam': 'ɤ', + \ '\trnh': 'ɥ', + \ '\btdl': 'ɬ', + \ '\rtll': 'ɭ', + \ '\trnm': 'ɯ', + \ '\trnmlr': 'ɰ', + \ '\ltlmr': 'ɱ', + \ '\ltln': 'ɲ', + \ '\rtln': 'ɳ', + \ '\clomeg': 'ɷ', + \ '\ltphi': 'ɸ', + \ '\trnr': 'ɹ', + \ '\trnrl': 'ɺ', + \ '\rttrnr': 'ɻ', + \ '\rl': 'ɼ', + \ '\rtlr': 'ɽ', + \ '\fhr': 'ɾ', + \ '\rtls': 'ʂ', + \ '\esh': 'ʃ', + \ '\trnt': 'ʇ', + \ '\rtlt': 'ʈ', + \ '\pupsil': 'ʊ', + \ '\pscrv': 'ʋ', + \ '\invv': 'ʌ', + \ '\invw': 'ʍ', + \ '\trny': 'ʎ', + \ '\rtlz': 'ʐ', + \ '\yogh': 'ʒ', + \ '\glst': 'ʔ', + \ '\reglst': 'ʕ', + \ '\inglst': 'ʖ', + \ '\turnk': 'ʞ', + \ '\dyogh': 'ʤ', + \ '\tesh': 'ʧ', \ '\^h': 'ʰ', \ '\^j': 'ʲ', \ '\^r': 'ʳ', \ '\^w': 'ʷ', \ '\^y': 'ʸ', \ '\rasp': 'ʼ', - \ '\textasciicaron': 'ˇ', - \ '\Elzverts': 'ˈ', - \ '\Elzverti': 'ˌ', - \ '\Elzlmrk': 'ː', - \ '\Elzhlmrk': 'ˑ', - \ '\Elzsbrhr': '˒', - \ '\Elzsblhr': '˓', - \ '\Elzrais': '˔', - \ '\Elzlow': '˕', + \ '\verts': 'ˈ', + \ '\verti': 'ˌ', + \ '\lmrk': 'ː', + \ '\hlmrk': 'ˑ', + \ '\sbrhr': '˒', + \ '\sblhr': '˓', + \ '\rais': '˔', + \ '\low': '˕', \ '\u': '˘', - \ '\texttildelow': '˜', + \ '\tildelow': '˜', \ '\^l': 'ˡ', \ '\^s': 'ˢ', \ '\^x': 'ˣ', @@ -137,15 +136,14 @@ function! julia_latex_symbols#get_dict() \ '\oturnedcomma': '̒', \ '\ocommatopright': '̕', \ '\droang': '̚', - \ '\Elzpalh': '̡', - \ '\Elzrh': '̢', + \ '\palh': '̡', + \ '\rh': '̢', \ '\c': '̧', \ '\k': '̨', - \ '\Elzsbbrg': '̪', + \ '\sbbrg': '̪', \ '\wideutilde': '̰', \ '\underbar': '̲', - \ '\Elzxl': '̵', - \ '\Elzbar': '̶', + \ '\strike': '̶', \ '\sout': '̶', \ '\not': '̸', \ '\underleftrightarrow': '͍', @@ -215,7 +213,7 @@ function! julia_latex_symbols#get_dict() \ '\upsampi': 'ϡ', \ '\varkappa': 'ϰ', \ '\varrho': 'ϱ', - \ '\textTheta': 'ϴ', + \ '\varTheta': 'ϴ', \ '\epsilon': 'ϵ', \ '\backepsilon': '϶', \ '\^A': 'ᴬ', @@ -280,16 +278,16 @@ function! julia_latex_symbols#get_dict() \ '\Vert': '‖', \ '\lq': '‘', \ '\rq': '’', - \ '\Elzreapos': '‛', - \ '\textquotedblleft': '“', - \ '\textquotedblright': '”', + \ '\reapos': '‛', + \ '\quotedblleft': '“', + \ '\quotedblright': '”', \ '\dagger': '†', \ '\ddagger': '‡', \ '\bullet': '•', \ '\dots': '…', \ '\ldots': '…', - \ '\textperthousand': '‰', - \ '\textpertenthousand': '‱', + \ '\perthousand': '‰', + \ '\pertenthousand': '‱', \ '\prime': '′', \ '\pprime': '″', \ '\ppprime': '‴', @@ -302,6 +300,7 @@ function! julia_latex_symbols#get_dict() \ '\tieconcat': '⁀', \ '\:interrobang:': '⁉', \ '\pppprime': '⁗', + \ '\tricolon': '⁝', \ '\nolinebreak': '⁠', \ '\^0': '⁰', \ '\^i': 'ⁱ', @@ -345,7 +344,7 @@ function! julia_latex_symbols#get_dict() \ '\_p': 'ₚ', \ '\_s': 'ₛ', \ '\_t': 'ₜ', - \ '\Elzpes': '₧', + \ '\pes': '₧', \ '\euro': '€', \ '\leftharpoonaccent': '⃐', \ '\rightharpoonaccent': '⃑', @@ -367,64 +366,81 @@ function! julia_latex_symbols#get_dict() \ '\underleftarrow': '⃮', \ '\underrightarrow': '⃯', \ '\asteraccent': '⃰', - \ '\BbbC': 'ℂ', - \ '\Eulerconst': 'ℇ', - \ '\mscrg': 'ℊ', - \ '\mscrH': 'ℋ', - \ '\mfrakH': 'ℌ', - \ '\BbbH': 'ℍ', - \ '\Planckconst': 'ℎ', + \ '\bbC': 'ℂ', + \ '\eulermascheroni': 'ℇ', + \ '\scrg': 'ℊ', + \ '\scrH': 'ℋ', + \ '\frakH': 'ℌ', + \ '\bbH': 'ℍ', + \ '\planck': 'ℎ', \ '\hslash': 'ℏ', - \ '\mscrI': 'ℐ', + \ '\scrI': 'ℐ', \ '\Im': 'ℑ', - \ '\mscrL': 'ℒ', + \ '\scrL': 'ℒ', \ '\ell': 'ℓ', - \ '\BbbN': 'ℕ', - \ '\textnumero': '№', + \ '\bbN': 'ℕ', + \ '\numero': '№', \ '\wp': '℘', - \ '\BbbP': 'ℙ', - \ '\BbbQ': 'ℚ', - \ '\mscrR': 'ℛ', + \ '\bbP': 'ℙ', + \ '\bbQ': 'ℚ', + \ '\scrR': 'ℛ', \ '\Re': 'ℜ', - \ '\BbbR': 'ℝ', - \ '\Elzxrat': '℞', - \ '\texttrademark': '™', + \ '\bbR': 'ℝ', + \ '\xrat': '℞', + \ '\trademark': '™', \ '\:tm:': '™', - \ '\BbbZ': 'ℤ', + \ '\bbZ': 'ℤ', \ '\mho': '℧', - \ '\mfrakZ': 'ℨ', + \ '\frakZ': 'ℨ', \ '\turnediota': '℩', \ '\Angstrom': 'Å', - \ '\mscrB': 'ℬ', - \ '\mfrakC': 'ℭ', - \ '\mscre': 'ℯ', + \ '\scrB': 'ℬ', + \ '\frakC': 'ℭ', + \ '\scre': 'ℯ', \ '\euler': 'ℯ', - \ '\mscrE': 'ℰ', - \ '\mscrF': 'ℱ', + \ '\scrE': 'ℰ', + \ '\scrF': 'ℱ', \ '\Finv': 'Ⅎ', - \ '\mscrM': 'ℳ', - \ '\mscro': 'ℴ', + \ '\scrM': 'ℳ', + \ '\scro': 'ℴ', \ '\aleph': 'ℵ', \ '\beth': 'ℶ', \ '\gimel': 'ℷ', \ '\daleth': 'ℸ', \ '\:information_source:': 'ℹ', - \ '\Bbbpi': 'ℼ', - \ '\Bbbgamma': 'ℽ', - \ '\BbbGamma': 'ℾ', - \ '\BbbPi': 'ℿ', + \ '\bbpi': 'ℼ', + \ '\bbgamma': 'ℽ', + \ '\bbGamma': 'ℾ', + \ '\bbPi': 'ℿ', \ '\bbsum': '⅀', \ '\Game': '⅁', \ '\sansLturned': '⅂', \ '\sansLmirrored': '⅃', \ '\Yup': '⅄', - \ '\mitBbbD': 'ⅅ', - \ '\mitBbbd': 'ⅆ', - \ '\mitBbbe': 'ⅇ', - \ '\mitBbbi': 'ⅈ', - \ '\mitBbbj': 'ⅉ', + \ '\bbiD': 'ⅅ', + \ '\bbid': 'ⅆ', + \ '\bbie': 'ⅇ', + \ '\bbii': 'ⅈ', + \ '\bbij': 'ⅉ', \ '\PropertyLine': '⅊', \ '\upand': '⅋', + \ '\1/7': '⅐', + \ '\1/9': '⅑', + \ '\1/10': '⅒', + \ '\1/3': '⅓', + \ '\2/3': '⅔', + \ '\1/5': '⅕', + \ '\2/5': '⅖', + \ '\3/5': '⅗', + \ '\4/5': '⅘', + \ '\1/6': '⅙', + \ '\5/6': '⅚', + \ '\1/8': '⅛', + \ '\3/8': '⅜', + \ '\5/8': '⅝', + \ '\7/8': '⅞', + \ '\1/': '⅟', + \ '\0/3': '↉', \ '\leftarrow': '←', \ '\uparrow': '↑', \ '\to': '→', @@ -778,7 +794,7 @@ function! julia_latex_symbols#get_dict() \ '\nsqsubseteq': '⋢', \ '\nsqsupseteq': '⋣', \ '\sqsubsetneq': '⋤', - \ '\Elzsqspne': '⋥', + \ '\sqspne': '⋥', \ '\lnsim': '⋦', \ '\gnsim': '⋧', \ '\precnsim': '⋨', @@ -832,12 +848,12 @@ function! julia_latex_symbols#get_dict() \ '\conictaper': '⌲', \ '\topbot': '⌶', \ '\obar': '⌽', - \ '\APLnotslash': '⌿', - \ '\APLnotbackslash': '⍀', - \ '\APLboxupcaret': '⍓', - \ '\APLboxquestion': '⍰', + \ '\notslash': '⌿', + \ '\notbackslash': '⍀', + \ '\boxupcaret': '⍓', + \ '\boxquestion': '⍰', \ '\hexagon': '⎔', - \ '\Elzdlcorn': '⎣', + \ '\dlcorn': '⎣', \ '\lmoustache': '⎰', \ '\rmoustache': '⎱', \ '\overbracket': '⎴', @@ -862,11 +878,11 @@ function! julia_latex_symbols#get_dict() \ '\:alarm_clock:': '⏰', \ '\:hourglass_flowing_sand:': '⏳', \ '\blanksymbol': '␢', - \ '\textvisiblespace': '␣', + \ '\visiblespace': '␣', \ '\:m:': 'Ⓜ', \ '\circledS': 'Ⓢ', - \ '\Elzdshfnc': '┆', - \ '\Elzsqfnw': '┙', + \ '\dshfnc': '┆', + \ '\sqfnw': '┙', \ '\diagup': '╱', \ '\diagdown': '╲', \ '\blockuphalf': '▀', @@ -894,7 +910,7 @@ function! julia_latex_symbols#get_dict() \ '\hrectangleblack': '▬', \ '\hrectangle': '▭', \ '\vrectangleblack': '▮', - \ '\Elzvrecto': '▯', + \ '\vrecto': '▯', \ '\parallelogramblack': '▰', \ '\parallelogram': '▱', \ '\bigblacktriangleup': '▲', @@ -929,15 +945,15 @@ function! julia_latex_symbols#get_dict() \ '\circlevertfill': '◍', \ '\bullseye': '◎', \ '\mdlgblkcircle': '●', - \ '\Elzcirfl': '◐', - \ '\Elzcirfr': '◑', - \ '\Elzcirfb': '◒', + \ '\cirfl': '◐', + \ '\cirfr': '◑', + \ '\cirfb': '◒', \ '\circletophalfblack': '◓', \ '\circleurquadblack': '◔', \ '\blackcircleulquadwhite': '◕', \ '\blacklefthalfcircle': '◖', \ '\blackrighthalfcircle': '◗', - \ '\Elzrvbull': '◘', + \ '\rvbull': '◘', \ '\inversewhitecircle': '◙', \ '\invwhiteupperhalfcircle': '◚', \ '\invwhitelowerhalfcircle': '◛', @@ -952,10 +968,10 @@ function! julia_latex_symbols#get_dict() \ '\ulblacktriangle': '◤', \ '\urblacktriangle': '◥', \ '\smwhtcircle': '◦', - \ '\Elzsqfl': '◧', - \ '\Elzsqfr': '◨', + \ '\sqfl': '◧', + \ '\sqfr': '◨', \ '\squareulblack': '◩', - \ '\Elzsqfse': '◪', + \ '\sqfse': '◪', \ '\boxbar': '◫', \ '\trianglecdot': '◬', \ '\triangleleftblack': '◭', @@ -1066,7 +1082,7 @@ function! julia_latex_symbols#get_dict() \ '\:anchor:': '⚓', \ '\:warning:': '⚠', \ '\:zap:': '⚡', - \ '\Hermaphrodite': '⚥', + \ '\hermaphrodite': '⚥', \ '\mdwhtcircle': '⚪', \ '\:white_circle:': '⚪', \ '\mdblkcircle': '⚫', @@ -1199,11 +1215,11 @@ function! julia_latex_symbols#get_dict() \ '\nwovnearrow': '⤲', \ '\:arrow_heading_up:': '⤴', \ '\:arrow_heading_down:': '⤵', - \ '\ElzRlarr': '⥂', - \ '\ElzrLarr': '⥄', + \ '\Rlarr': '⥂', + \ '\rLarr': '⥄', \ '\rightarrowplus': '⥅', \ '\leftarrowplus': '⥆', - \ '\Elzrarrx': '⥇', + \ '\rarrx': '⥇', \ '\leftrightarrowcircle': '⥈', \ '\twoheaduparrowcircle': '⥉', \ '\leftrightharpoonupdown': '⥊', @@ -1247,13 +1263,13 @@ function! julia_latex_symbols#get_dict() \ '\RoundImplies': '⥰', \ '\Vvert': '⦀', \ '\Elroang': '⦆', - \ '\Elzddfnc': '⦙', + \ '\ddfnc': '⦙', \ '\measuredangleleft': '⦛', \ '\Angle': '⦜', \ '\rightanglemdot': '⦝', \ '\angles': '⦞', \ '\angdnr': '⦟', - \ '\Elzlpargt': '⦠', + \ '\lpargt': '⦠', \ '\sphericalangleup': '⦡', \ '\turnangle': '⦢', \ '\revangle': '⦣', @@ -1285,8 +1301,8 @@ function! julia_latex_symbols#get_dict() \ '\boxbslash': '⧅', \ '\boxast': '⧆', \ '\boxcircle': '⧇', - \ '\ElzLap': '⧊', - \ '\Elzdefas': '⧋', + \ '\Lap': '⧊', + \ '\defas': '⧋', \ '\LeftTriangleBar': '⧏', \ '\NotLeftTriangleBar': '⧏̸', \ '\RightTriangleBar': '⧐', @@ -1332,6 +1348,7 @@ function! julia_latex_symbols#get_dict() \ '\upint': '⨛', \ '\lowint': '⨜', \ '\Join': '⨝', + \ '\join': '⨝', \ '\ringplus': '⨢', \ '\plushat': '⨣', \ '\simplus': '⨤', @@ -1345,7 +1362,7 @@ function! julia_latex_symbols#get_dict() \ '\minusrdots': '⨬', \ '\opluslhrim': '⨭', \ '\oplusrhrim': '⨮', - \ '\ElzTimes': '⨯', + \ '\Times': '⨯', \ '\dottimes': '⨰', \ '\timesbar': '⨱', \ '\btimes': '⨲', @@ -1376,8 +1393,8 @@ function! julia_latex_symbols#get_dict() \ '\closedvarcupsmashprod': '⩐', \ '\wedgeodot': '⩑', \ '\veeodot': '⩒', - \ '\ElzAnd': '⩓', - \ '\ElzOr': '⩔', + \ '\And': '⩓', + \ '\Or': '⩔', \ '\wedgeonwedge': '⩕', \ '\ElOr': '⩖', \ '\bigslopedvee': '⩗', @@ -1387,7 +1404,7 @@ function! julia_latex_symbols#get_dict() \ '\midbarwedge': '⩜', \ '\midbarvee': '⩝', \ '\perspcorrespond': '⩞', - \ '\Elzminhat': '⩟', + \ '\minhat': '⩟', \ '\wedgedoublebar': '⩠', \ '\varveebar': '⩡', \ '\doublebarvee': '⩢', @@ -1520,7 +1537,7 @@ function! julia_latex_symbols#get_dict() \ '\dashV': '⫣', \ '\Dashv': '⫤', \ '\interleave': '⫴', - \ '\Elztdcol': '⫶', + \ '\tdcol': '⫶', \ '\lllnest': '⫷', \ '\gggnest': '⫸', \ '\leqqslant': '⫹', @@ -1603,1002 +1620,1002 @@ function! julia_latex_symbols#get_dict() \ '\:part_alternation_mark:': '〽', \ '\:congratulations:': '㊗', \ '\:secret:': '㊙', - \ '\mbfA': '𝐀', - \ '\mbfB': '𝐁', - \ '\mbfC': '𝐂', - \ '\mbfD': '𝐃', - \ '\mbfE': '𝐄', - \ '\mbfF': '𝐅', - \ '\mbfG': '𝐆', - \ '\mbfH': '𝐇', - \ '\mbfI': '𝐈', - \ '\mbfJ': '𝐉', - \ '\mbfK': '𝐊', - \ '\mbfL': '𝐋', - \ '\mbfM': '𝐌', - \ '\mbfN': '𝐍', - \ '\mbfO': '𝐎', - \ '\mbfP': '𝐏', - \ '\mbfQ': '𝐐', - \ '\mbfR': '𝐑', - \ '\mbfS': '𝐒', - \ '\mbfT': '𝐓', - \ '\mbfU': '𝐔', - \ '\mbfV': '𝐕', - \ '\mbfW': '𝐖', - \ '\mbfX': '𝐗', - \ '\mbfY': '𝐘', - \ '\mbfZ': '𝐙', - \ '\mbfa': '𝐚', - \ '\mbfb': '𝐛', - \ '\mbfc': '𝐜', - \ '\mbfd': '𝐝', - \ '\mbfe': '𝐞', - \ '\mbff': '𝐟', - \ '\mbfg': '𝐠', - \ '\mbfh': '𝐡', - \ '\mbfi': '𝐢', - \ '\mbfj': '𝐣', - \ '\mbfk': '𝐤', - \ '\mbfl': '𝐥', - \ '\mbfm': '𝐦', - \ '\mbfn': '𝐧', - \ '\mbfo': '𝐨', - \ '\mbfp': '𝐩', - \ '\mbfq': '𝐪', - \ '\mbfr': '𝐫', - \ '\mbfs': '𝐬', - \ '\mbft': '𝐭', - \ '\mbfu': '𝐮', - \ '\mbfv': '𝐯', - \ '\mbfw': '𝐰', - \ '\mbfx': '𝐱', - \ '\mbfy': '𝐲', - \ '\mbfz': '𝐳', - \ '\mitA': '𝐴', - \ '\mitB': '𝐵', - \ '\mitC': '𝐶', - \ '\mitD': '𝐷', - \ '\mitE': '𝐸', - \ '\mitF': '𝐹', - \ '\mitG': '𝐺', - \ '\mitH': '𝐻', - \ '\mitI': '𝐼', - \ '\mitJ': '𝐽', - \ '\mitK': '𝐾', - \ '\mitL': '𝐿', - \ '\mitM': '𝑀', - \ '\mitN': '𝑁', - \ '\mitO': '𝑂', - \ '\mitP': '𝑃', - \ '\mitQ': '𝑄', - \ '\mitR': '𝑅', - \ '\mitS': '𝑆', - \ '\mitT': '𝑇', - \ '\mitU': '𝑈', - \ '\mitV': '𝑉', - \ '\mitW': '𝑊', - \ '\mitX': '𝑋', - \ '\mitY': '𝑌', - \ '\mitZ': '𝑍', - \ '\mita': '𝑎', - \ '\mitb': '𝑏', - \ '\mitc': '𝑐', - \ '\mitd': '𝑑', - \ '\mite': '𝑒', - \ '\mitf': '𝑓', - \ '\mitg': '𝑔', - \ '\miti': '𝑖', - \ '\mitj': '𝑗', - \ '\mitk': '𝑘', - \ '\mitl': '𝑙', - \ '\mitm': '𝑚', - \ '\mitn': '𝑛', - \ '\mito': '𝑜', - \ '\mitp': '𝑝', - \ '\mitq': '𝑞', - \ '\mitr': '𝑟', - \ '\mits': '𝑠', - \ '\mitt': '𝑡', - \ '\mitu': '𝑢', - \ '\mitv': '𝑣', - \ '\mitw': '𝑤', - \ '\mitx': '𝑥', - \ '\mity': '𝑦', - \ '\mitz': '𝑧', - \ '\mbfitA': '𝑨', - \ '\mbfitB': '𝑩', - \ '\mbfitC': '𝑪', - \ '\mbfitD': '𝑫', - \ '\mbfitE': '𝑬', - \ '\mbfitF': '𝑭', - \ '\mbfitG': '𝑮', - \ '\mbfitH': '𝑯', - \ '\mbfitI': '𝑰', - \ '\mbfitJ': '𝑱', - \ '\mbfitK': '𝑲', - \ '\mbfitL': '𝑳', - \ '\mbfitM': '𝑴', - \ '\mbfitN': '𝑵', - \ '\mbfitO': '𝑶', - \ '\mbfitP': '𝑷', - \ '\mbfitQ': '𝑸', - \ '\mbfitR': '𝑹', - \ '\mbfitS': '𝑺', - \ '\mbfitT': '𝑻', - \ '\mbfitU': '𝑼', - \ '\mbfitV': '𝑽', - \ '\mbfitW': '𝑾', - \ '\mbfitX': '𝑿', - \ '\mbfitY': '𝒀', - \ '\mbfitZ': '𝒁', - \ '\mbfita': '𝒂', - \ '\mbfitb': '𝒃', - \ '\mbfitc': '𝒄', - \ '\mbfitd': '𝒅', - \ '\mbfite': '𝒆', - \ '\mbfitf': '𝒇', - \ '\mbfitg': '𝒈', - \ '\mbfith': '𝒉', - \ '\mbfiti': '𝒊', - \ '\mbfitj': '𝒋', - \ '\mbfitk': '𝒌', - \ '\mbfitl': '𝒍', - \ '\mbfitm': '𝒎', - \ '\mbfitn': '𝒏', - \ '\mbfito': '𝒐', - \ '\mbfitp': '𝒑', - \ '\mbfitq': '𝒒', - \ '\mbfitr': '𝒓', - \ '\mbfits': '𝒔', - \ '\mbfitt': '𝒕', - \ '\mbfitu': '𝒖', - \ '\mbfitv': '𝒗', - \ '\mbfitw': '𝒘', - \ '\mbfitx': '𝒙', - \ '\mbfity': '𝒚', - \ '\mbfitz': '𝒛', - \ '\mscrA': '𝒜', - \ '\mscrC': '𝒞', - \ '\mscrD': '𝒟', - \ '\mscrG': '𝒢', - \ '\mscrJ': '𝒥', - \ '\mscrK': '𝒦', - \ '\mscrN': '𝒩', - \ '\mscrO': '𝒪', - \ '\mscrP': '𝒫', - \ '\mscrQ': '𝒬', - \ '\mscrS': '𝒮', - \ '\mscrT': '𝒯', - \ '\mscrU': '𝒰', - \ '\mscrV': '𝒱', - \ '\mscrW': '𝒲', - \ '\mscrX': '𝒳', - \ '\mscrY': '𝒴', - \ '\mscrZ': '𝒵', - \ '\mscra': '𝒶', - \ '\mscrb': '𝒷', - \ '\mscrc': '𝒸', - \ '\mscrd': '𝒹', - \ '\mscrf': '𝒻', - \ '\mscrh': '𝒽', - \ '\mscri': '𝒾', - \ '\mscrj': '𝒿', - \ '\mscrk': '𝓀', - \ '\mscrl': '𝓁', - \ '\mscrm': '𝓂', - \ '\mscrn': '𝓃', - \ '\mscrp': '𝓅', - \ '\mscrq': '𝓆', - \ '\mscrr': '𝓇', - \ '\mscrs': '𝓈', - \ '\mscrt': '𝓉', - \ '\mscru': '𝓊', - \ '\mscrv': '𝓋', - \ '\mscrw': '𝓌', - \ '\mscrx': '𝓍', - \ '\mscry': '𝓎', - \ '\mscrz': '𝓏', - \ '\mbfscrA': '𝓐', - \ '\mbfscrB': '𝓑', - \ '\mbfscrC': '𝓒', - \ '\mbfscrD': '𝓓', - \ '\mbfscrE': '𝓔', - \ '\mbfscrF': '𝓕', - \ '\mbfscrG': '𝓖', - \ '\mbfscrH': '𝓗', - \ '\mbfscrI': '𝓘', - \ '\mbfscrJ': '𝓙', - \ '\mbfscrK': '𝓚', - \ '\mbfscrL': '𝓛', - \ '\mbfscrM': '𝓜', - \ '\mbfscrN': '𝓝', - \ '\mbfscrO': '𝓞', - \ '\mbfscrP': '𝓟', - \ '\mbfscrQ': '𝓠', - \ '\mbfscrR': '𝓡', - \ '\mbfscrS': '𝓢', - \ '\mbfscrT': '𝓣', - \ '\mbfscrU': '𝓤', - \ '\mbfscrV': '𝓥', - \ '\mbfscrW': '𝓦', - \ '\mbfscrX': '𝓧', - \ '\mbfscrY': '𝓨', - \ '\mbfscrZ': '𝓩', - \ '\mbfscra': '𝓪', - \ '\mbfscrb': '𝓫', - \ '\mbfscrc': '𝓬', - \ '\mbfscrd': '𝓭', - \ '\mbfscre': '𝓮', - \ '\mbfscrf': '𝓯', - \ '\mbfscrg': '𝓰', - \ '\mbfscrh': '𝓱', - \ '\mbfscri': '𝓲', - \ '\mbfscrj': '𝓳', - \ '\mbfscrk': '𝓴', - \ '\mbfscrl': '𝓵', - \ '\mbfscrm': '𝓶', - \ '\mbfscrn': '𝓷', - \ '\mbfscro': '𝓸', - \ '\mbfscrp': '𝓹', - \ '\mbfscrq': '𝓺', - \ '\mbfscrr': '𝓻', - \ '\mbfscrs': '𝓼', - \ '\mbfscrt': '𝓽', - \ '\mbfscru': '𝓾', - \ '\mbfscrv': '𝓿', - \ '\mbfscrw': '𝔀', - \ '\mbfscrx': '𝔁', - \ '\mbfscry': '𝔂', - \ '\mbfscrz': '𝔃', - \ '\mfrakA': '𝔄', - \ '\mfrakB': '𝔅', - \ '\mfrakD': '𝔇', - \ '\mfrakE': '𝔈', - \ '\mfrakF': '𝔉', - \ '\mfrakG': '𝔊', - \ '\mfrakJ': '𝔍', - \ '\mfrakK': '𝔎', - \ '\mfrakL': '𝔏', - \ '\mfrakM': '𝔐', - \ '\mfrakN': '𝔑', - \ '\mfrakO': '𝔒', - \ '\mfrakP': '𝔓', - \ '\mfrakQ': '𝔔', - \ '\mfrakS': '𝔖', - \ '\mfrakT': '𝔗', - \ '\mfrakU': '𝔘', - \ '\mfrakV': '𝔙', - \ '\mfrakW': '𝔚', - \ '\mfrakX': '𝔛', - \ '\mfrakY': '𝔜', - \ '\mfraka': '𝔞', - \ '\mfrakb': '𝔟', - \ '\mfrakc': '𝔠', - \ '\mfrakd': '𝔡', - \ '\mfrake': '𝔢', - \ '\mfrakf': '𝔣', - \ '\mfrakg': '𝔤', - \ '\mfrakh': '𝔥', - \ '\mfraki': '𝔦', - \ '\mfrakj': '𝔧', - \ '\mfrakk': '𝔨', - \ '\mfrakl': '𝔩', - \ '\mfrakm': '𝔪', - \ '\mfrakn': '𝔫', - \ '\mfrako': '𝔬', - \ '\mfrakp': '𝔭', - \ '\mfrakq': '𝔮', - \ '\mfrakr': '𝔯', - \ '\mfraks': '𝔰', - \ '\mfrakt': '𝔱', - \ '\mfraku': '𝔲', - \ '\mfrakv': '𝔳', - \ '\mfrakw': '𝔴', - \ '\mfrakx': '𝔵', - \ '\mfraky': '𝔶', - \ '\mfrakz': '𝔷', - \ '\BbbA': '𝔸', - \ '\BbbB': '𝔹', - \ '\BbbD': '𝔻', - \ '\BbbE': '𝔼', - \ '\BbbF': '𝔽', - \ '\BbbG': '𝔾', - \ '\BbbI': '𝕀', - \ '\BbbJ': '𝕁', - \ '\BbbK': '𝕂', - \ '\BbbL': '𝕃', - \ '\BbbM': '𝕄', - \ '\BbbO': '𝕆', - \ '\BbbS': '𝕊', - \ '\BbbT': '𝕋', - \ '\BbbU': '𝕌', - \ '\BbbV': '𝕍', - \ '\BbbW': '𝕎', - \ '\BbbX': '𝕏', - \ '\BbbY': '𝕐', - \ '\Bbba': '𝕒', - \ '\Bbbb': '𝕓', - \ '\Bbbc': '𝕔', - \ '\Bbbd': '𝕕', - \ '\Bbbe': '𝕖', - \ '\Bbbf': '𝕗', - \ '\Bbbg': '𝕘', - \ '\Bbbh': '𝕙', - \ '\Bbbi': '𝕚', - \ '\Bbbj': '𝕛', - \ '\Bbbk': '𝕜', - \ '\Bbbl': '𝕝', - \ '\Bbbm': '𝕞', - \ '\Bbbn': '𝕟', - \ '\Bbbo': '𝕠', - \ '\Bbbp': '𝕡', - \ '\Bbbq': '𝕢', - \ '\Bbbr': '𝕣', - \ '\Bbbs': '𝕤', - \ '\Bbbt': '𝕥', - \ '\Bbbu': '𝕦', - \ '\Bbbv': '𝕧', - \ '\Bbbw': '𝕨', - \ '\Bbbx': '𝕩', - \ '\Bbby': '𝕪', - \ '\Bbbz': '𝕫', - \ '\mbffrakA': '𝕬', - \ '\mbffrakB': '𝕭', - \ '\mbffrakC': '𝕮', - \ '\mbffrakD': '𝕯', - \ '\mbffrakE': '𝕰', - \ '\mbffrakF': '𝕱', - \ '\mbffrakG': '𝕲', - \ '\mbffrakH': '𝕳', - \ '\mbffrakI': '𝕴', - \ '\mbffrakJ': '𝕵', - \ '\mbffrakK': '𝕶', - \ '\mbffrakL': '𝕷', - \ '\mbffrakM': '𝕸', - \ '\mbffrakN': '𝕹', - \ '\mbffrakO': '𝕺', - \ '\mbffrakP': '𝕻', - \ '\mbffrakQ': '𝕼', - \ '\mbffrakR': '𝕽', - \ '\mbffrakS': '𝕾', - \ '\mbffrakT': '𝕿', - \ '\mbffrakU': '𝖀', - \ '\mbffrakV': '𝖁', - \ '\mbffrakW': '𝖂', - \ '\mbffrakX': '𝖃', - \ '\mbffrakY': '𝖄', - \ '\mbffrakZ': '𝖅', - \ '\mbffraka': '𝖆', - \ '\mbffrakb': '𝖇', - \ '\mbffrakc': '𝖈', - \ '\mbffrakd': '𝖉', - \ '\mbffrake': '𝖊', - \ '\mbffrakf': '𝖋', - \ '\mbffrakg': '𝖌', - \ '\mbffrakh': '𝖍', - \ '\mbffraki': '𝖎', - \ '\mbffrakj': '𝖏', - \ '\mbffrakk': '𝖐', - \ '\mbffrakl': '𝖑', - \ '\mbffrakm': '𝖒', - \ '\mbffrakn': '𝖓', - \ '\mbffrako': '𝖔', - \ '\mbffrakp': '𝖕', - \ '\mbffrakq': '𝖖', - \ '\mbffrakr': '𝖗', - \ '\mbffraks': '𝖘', - \ '\mbffrakt': '𝖙', - \ '\mbffraku': '𝖚', - \ '\mbffrakv': '𝖛', - \ '\mbffrakw': '𝖜', - \ '\mbffrakx': '𝖝', - \ '\mbffraky': '𝖞', - \ '\mbffrakz': '𝖟', - \ '\msansA': '𝖠', - \ '\msansB': '𝖡', - \ '\msansC': '𝖢', - \ '\msansD': '𝖣', - \ '\msansE': '𝖤', - \ '\msansF': '𝖥', - \ '\msansG': '𝖦', - \ '\msansH': '𝖧', - \ '\msansI': '𝖨', - \ '\msansJ': '𝖩', - \ '\msansK': '𝖪', - \ '\msansL': '𝖫', - \ '\msansM': '𝖬', - \ '\msansN': '𝖭', - \ '\msansO': '𝖮', - \ '\msansP': '𝖯', - \ '\msansQ': '𝖰', - \ '\msansR': '𝖱', - \ '\msansS': '𝖲', - \ '\msansT': '𝖳', - \ '\msansU': '𝖴', - \ '\msansV': '𝖵', - \ '\msansW': '𝖶', - \ '\msansX': '𝖷', - \ '\msansY': '𝖸', - \ '\msansZ': '𝖹', - \ '\msansa': '𝖺', - \ '\msansb': '𝖻', - \ '\msansc': '𝖼', - \ '\msansd': '𝖽', - \ '\msanse': '𝖾', - \ '\msansf': '𝖿', - \ '\msansg': '𝗀', - \ '\msansh': '𝗁', - \ '\msansi': '𝗂', - \ '\msansj': '𝗃', - \ '\msansk': '𝗄', - \ '\msansl': '𝗅', - \ '\msansm': '𝗆', - \ '\msansn': '𝗇', - \ '\msanso': '𝗈', - \ '\msansp': '𝗉', - \ '\msansq': '𝗊', - \ '\msansr': '𝗋', - \ '\msanss': '𝗌', - \ '\msanst': '𝗍', - \ '\msansu': '𝗎', - \ '\msansv': '𝗏', - \ '\msansw': '𝗐', - \ '\msansx': '𝗑', - \ '\msansy': '𝗒', - \ '\msansz': '𝗓', - \ '\mbfsansA': '𝗔', - \ '\mbfsansB': '𝗕', - \ '\mbfsansC': '𝗖', - \ '\mbfsansD': '𝗗', - \ '\mbfsansE': '𝗘', - \ '\mbfsansF': '𝗙', - \ '\mbfsansG': '𝗚', - \ '\mbfsansH': '𝗛', - \ '\mbfsansI': '𝗜', - \ '\mbfsansJ': '𝗝', - \ '\mbfsansK': '𝗞', - \ '\mbfsansL': '𝗟', - \ '\mbfsansM': '𝗠', - \ '\mbfsansN': '𝗡', - \ '\mbfsansO': '𝗢', - \ '\mbfsansP': '𝗣', - \ '\mbfsansQ': '𝗤', - \ '\mbfsansR': '𝗥', - \ '\mbfsansS': '𝗦', - \ '\mbfsansT': '𝗧', - \ '\mbfsansU': '𝗨', - \ '\mbfsansV': '𝗩', - \ '\mbfsansW': '𝗪', - \ '\mbfsansX': '𝗫', - \ '\mbfsansY': '𝗬', - \ '\mbfsansZ': '𝗭', - \ '\mbfsansa': '𝗮', - \ '\mbfsansb': '𝗯', - \ '\mbfsansc': '𝗰', - \ '\mbfsansd': '𝗱', - \ '\mbfsanse': '𝗲', - \ '\mbfsansf': '𝗳', - \ '\mbfsansg': '𝗴', - \ '\mbfsansh': '𝗵', - \ '\mbfsansi': '𝗶', - \ '\mbfsansj': '𝗷', - \ '\mbfsansk': '𝗸', - \ '\mbfsansl': '𝗹', - \ '\mbfsansm': '𝗺', - \ '\mbfsansn': '𝗻', - \ '\mbfsanso': '𝗼', - \ '\mbfsansp': '𝗽', - \ '\mbfsansq': '𝗾', - \ '\mbfsansr': '𝗿', - \ '\mbfsanss': '𝘀', - \ '\mbfsanst': '𝘁', - \ '\mbfsansu': '𝘂', - \ '\mbfsansv': '𝘃', - \ '\mbfsansw': '𝘄', - \ '\mbfsansx': '𝘅', - \ '\mbfsansy': '𝘆', - \ '\mbfsansz': '𝘇', - \ '\mitsansA': '𝘈', - \ '\mitsansB': '𝘉', - \ '\mitsansC': '𝘊', - \ '\mitsansD': '𝘋', - \ '\mitsansE': '𝘌', - \ '\mitsansF': '𝘍', - \ '\mitsansG': '𝘎', - \ '\mitsansH': '𝘏', - \ '\mitsansI': '𝘐', - \ '\mitsansJ': '𝘑', - \ '\mitsansK': '𝘒', - \ '\mitsansL': '𝘓', - \ '\mitsansM': '𝘔', - \ '\mitsansN': '𝘕', - \ '\mitsansO': '𝘖', - \ '\mitsansP': '𝘗', - \ '\mitsansQ': '𝘘', - \ '\mitsansR': '𝘙', - \ '\mitsansS': '𝘚', - \ '\mitsansT': '𝘛', - \ '\mitsansU': '𝘜', - \ '\mitsansV': '𝘝', - \ '\mitsansW': '𝘞', - \ '\mitsansX': '𝘟', - \ '\mitsansY': '𝘠', - \ '\mitsansZ': '𝘡', - \ '\mitsansa': '𝘢', - \ '\mitsansb': '𝘣', - \ '\mitsansc': '𝘤', - \ '\mitsansd': '𝘥', - \ '\mitsanse': '𝘦', - \ '\mitsansf': '𝘧', - \ '\mitsansg': '𝘨', - \ '\mitsansh': '𝘩', - \ '\mitsansi': '𝘪', - \ '\mitsansj': '𝘫', - \ '\mitsansk': '𝘬', - \ '\mitsansl': '𝘭', - \ '\mitsansm': '𝘮', - \ '\mitsansn': '𝘯', - \ '\mitsanso': '𝘰', - \ '\mitsansp': '𝘱', - \ '\mitsansq': '𝘲', - \ '\mitsansr': '𝘳', - \ '\mitsanss': '𝘴', - \ '\mitsanst': '𝘵', - \ '\mitsansu': '𝘶', - \ '\mitsansv': '𝘷', - \ '\mitsansw': '𝘸', - \ '\mitsansx': '𝘹', - \ '\mitsansy': '𝘺', - \ '\mitsansz': '𝘻', - \ '\mbfitsansA': '𝘼', - \ '\mbfitsansB': '𝘽', - \ '\mbfitsansC': '𝘾', - \ '\mbfitsansD': '𝘿', - \ '\mbfitsansE': '𝙀', - \ '\mbfitsansF': '𝙁', - \ '\mbfitsansG': '𝙂', - \ '\mbfitsansH': '𝙃', - \ '\mbfitsansI': '𝙄', - \ '\mbfitsansJ': '𝙅', - \ '\mbfitsansK': '𝙆', - \ '\mbfitsansL': '𝙇', - \ '\mbfitsansM': '𝙈', - \ '\mbfitsansN': '𝙉', - \ '\mbfitsansO': '𝙊', - \ '\mbfitsansP': '𝙋', - \ '\mbfitsansQ': '𝙌', - \ '\mbfitsansR': '𝙍', - \ '\mbfitsansS': '𝙎', - \ '\mbfitsansT': '𝙏', - \ '\mbfitsansU': '𝙐', - \ '\mbfitsansV': '𝙑', - \ '\mbfitsansW': '𝙒', - \ '\mbfitsansX': '𝙓', - \ '\mbfitsansY': '𝙔', - \ '\mbfitsansZ': '𝙕', - \ '\mbfitsansa': '𝙖', - \ '\mbfitsansb': '𝙗', - \ '\mbfitsansc': '𝙘', - \ '\mbfitsansd': '𝙙', - \ '\mbfitsanse': '𝙚', - \ '\mbfitsansf': '𝙛', - \ '\mbfitsansg': '𝙜', - \ '\mbfitsansh': '𝙝', - \ '\mbfitsansi': '𝙞', - \ '\mbfitsansj': '𝙟', - \ '\mbfitsansk': '𝙠', - \ '\mbfitsansl': '𝙡', - \ '\mbfitsansm': '𝙢', - \ '\mbfitsansn': '𝙣', - \ '\mbfitsanso': '𝙤', - \ '\mbfitsansp': '𝙥', - \ '\mbfitsansq': '𝙦', - \ '\mbfitsansr': '𝙧', - \ '\mbfitsanss': '𝙨', - \ '\mbfitsanst': '𝙩', - \ '\mbfitsansu': '𝙪', - \ '\mbfitsansv': '𝙫', - \ '\mbfitsansw': '𝙬', - \ '\mbfitsansx': '𝙭', - \ '\mbfitsansy': '𝙮', - \ '\mbfitsansz': '𝙯', - \ '\mttA': '𝙰', - \ '\mttB': '𝙱', - \ '\mttC': '𝙲', - \ '\mttD': '𝙳', - \ '\mttE': '𝙴', - \ '\mttF': '𝙵', - \ '\mttG': '𝙶', - \ '\mttH': '𝙷', - \ '\mttI': '𝙸', - \ '\mttJ': '𝙹', - \ '\mttK': '𝙺', - \ '\mttL': '𝙻', - \ '\mttM': '𝙼', - \ '\mttN': '𝙽', - \ '\mttO': '𝙾', - \ '\mttP': '𝙿', - \ '\mttQ': '𝚀', - \ '\mttR': '𝚁', - \ '\mttS': '𝚂', - \ '\mttT': '𝚃', - \ '\mttU': '𝚄', - \ '\mttV': '𝚅', - \ '\mttW': '𝚆', - \ '\mttX': '𝚇', - \ '\mttY': '𝚈', - \ '\mttZ': '𝚉', - \ '\mtta': '𝚊', - \ '\mttb': '𝚋', - \ '\mttc': '𝚌', - \ '\mttd': '𝚍', - \ '\mtte': '𝚎', - \ '\mttf': '𝚏', - \ '\mttg': '𝚐', - \ '\mtth': '𝚑', - \ '\mtti': '𝚒', - \ '\mttj': '𝚓', - \ '\mttk': '𝚔', - \ '\mttl': '𝚕', - \ '\mttm': '𝚖', - \ '\mttn': '𝚗', - \ '\mtto': '𝚘', - \ '\mttp': '𝚙', - \ '\mttq': '𝚚', - \ '\mttr': '𝚛', - \ '\mtts': '𝚜', - \ '\mttt': '𝚝', - \ '\mttu': '𝚞', - \ '\mttv': '𝚟', - \ '\mttw': '𝚠', - \ '\mttx': '𝚡', - \ '\mtty': '𝚢', - \ '\mttz': '𝚣', - \ '\imath': '𝚤', - \ '\jmath': '𝚥', - \ '\mbfAlpha': '𝚨', - \ '\mbfBeta': '𝚩', - \ '\mbfGamma': '𝚪', - \ '\mbfDelta': '𝚫', - \ '\mbfEpsilon': '𝚬', - \ '\mbfZeta': '𝚭', - \ '\mbfEta': '𝚮', - \ '\mbfTheta': '𝚯', - \ '\mbfIota': '𝚰', - \ '\mbfKappa': '𝚱', - \ '\mbfLambda': '𝚲', - \ '\mbfMu': '𝚳', - \ '\mbfNu': '𝚴', - \ '\mbfXi': '𝚵', - \ '\mbfOmicron': '𝚶', - \ '\mbfPi': '𝚷', - \ '\mbfRho': '𝚸', - \ '\mbfvarTheta': '𝚹', - \ '\mbfSigma': '𝚺', - \ '\mbfTau': '𝚻', - \ '\mbfUpsilon': '𝚼', - \ '\mbfPhi': '𝚽', - \ '\mbfChi': '𝚾', - \ '\mbfPsi': '𝚿', - \ '\mbfOmega': '𝛀', - \ '\mbfnabla': '𝛁', - \ '\mbfalpha': '𝛂', - \ '\mbfbeta': '𝛃', - \ '\mbfgamma': '𝛄', - \ '\mbfdelta': '𝛅', - \ '\mbfepsilon': '𝛆', - \ '\mbfzeta': '𝛇', - \ '\mbfeta': '𝛈', - \ '\mbftheta': '𝛉', - \ '\mbfiota': '𝛊', - \ '\mbfkappa': '𝛋', - \ '\mbflambda': '𝛌', - \ '\mbfmu': '𝛍', - \ '\mbfnu': '𝛎', - \ '\mbfxi': '𝛏', - \ '\mbfomicron': '𝛐', - \ '\mbfpi': '𝛑', - \ '\mbfrho': '𝛒', - \ '\mbfvarsigma': '𝛓', - \ '\mbfsigma': '𝛔', - \ '\mbftau': '𝛕', - \ '\mbfupsilon': '𝛖', - \ '\mbfvarphi': '𝛗', - \ '\mbfchi': '𝛘', - \ '\mbfpsi': '𝛙', - \ '\mbfomega': '𝛚', - \ '\mbfpartial': '𝛛', - \ '\mbfvarepsilon': '𝛜', - \ '\mbfvartheta': '𝛝', - \ '\mbfvarkappa': '𝛞', - \ '\mbfphi': '𝛟', - \ '\mbfvarrho': '𝛠', - \ '\mbfvarpi': '𝛡', - \ '\mitAlpha': '𝛢', - \ '\mitBeta': '𝛣', - \ '\mitGamma': '𝛤', - \ '\mitDelta': '𝛥', - \ '\mitEpsilon': '𝛦', - \ '\mitZeta': '𝛧', - \ '\mitEta': '𝛨', - \ '\mitTheta': '𝛩', - \ '\mitIota': '𝛪', - \ '\mitKappa': '𝛫', - \ '\mitLambda': '𝛬', - \ '\mitMu': '𝛭', - \ '\mitNu': '𝛮', - \ '\mitXi': '𝛯', - \ '\mitOmicron': '𝛰', - \ '\mitPi': '𝛱', - \ '\mitRho': '𝛲', - \ '\mitvarTheta': '𝛳', - \ '\mitSigma': '𝛴', - \ '\mitTau': '𝛵', - \ '\mitUpsilon': '𝛶', - \ '\mitPhi': '𝛷', - \ '\mitChi': '𝛸', - \ '\mitPsi': '𝛹', - \ '\mitOmega': '𝛺', - \ '\mitnabla': '𝛻', - \ '\mitalpha': '𝛼', - \ '\mitbeta': '𝛽', - \ '\mitgamma': '𝛾', - \ '\mitdelta': '𝛿', - \ '\mitepsilon': '𝜀', - \ '\mitzeta': '𝜁', - \ '\miteta': '𝜂', - \ '\mittheta': '𝜃', - \ '\mitiota': '𝜄', - \ '\mitkappa': '𝜅', - \ '\mitlambda': '𝜆', - \ '\mitmu': '𝜇', - \ '\mitnu': '𝜈', - \ '\mitxi': '𝜉', - \ '\mitomicron': '𝜊', - \ '\mitpi': '𝜋', - \ '\mitrho': '𝜌', - \ '\mitvarsigma': '𝜍', - \ '\mitsigma': '𝜎', - \ '\mittau': '𝜏', - \ '\mitupsilon': '𝜐', - \ '\mitphi': '𝜑', - \ '\mitchi': '𝜒', - \ '\mitpsi': '𝜓', - \ '\mitomega': '𝜔', - \ '\mitpartial': '𝜕', - \ '\mitvarepsilon': '𝜖', - \ '\mitvartheta': '𝜗', - \ '\mitvarkappa': '𝜘', - \ '\mitvarphi': '𝜙', - \ '\mitvarrho': '𝜚', - \ '\mitvarpi': '𝜛', - \ '\mbfitAlpha': '𝜜', - \ '\mbfitBeta': '𝜝', - \ '\mbfitGamma': '𝜞', - \ '\mbfitDelta': '𝜟', - \ '\mbfitEpsilon': '𝜠', - \ '\mbfitZeta': '𝜡', - \ '\mbfitEta': '𝜢', - \ '\mbfitTheta': '𝜣', - \ '\mbfitIota': '𝜤', - \ '\mbfitKappa': '𝜥', - \ '\mbfitLambda': '𝜦', - \ '\mbfitMu': '𝜧', - \ '\mbfitNu': '𝜨', - \ '\mbfitXi': '𝜩', - \ '\mbfitOmicron': '𝜪', - \ '\mbfitPi': '𝜫', - \ '\mbfitRho': '𝜬', - \ '\mbfitvarTheta': '𝜭', - \ '\mbfitSigma': '𝜮', - \ '\mbfitTau': '𝜯', - \ '\mbfitUpsilon': '𝜰', - \ '\mbfitPhi': '𝜱', - \ '\mbfitChi': '𝜲', - \ '\mbfitPsi': '𝜳', - \ '\mbfitOmega': '𝜴', - \ '\mbfitnabla': '𝜵', - \ '\mbfitalpha': '𝜶', - \ '\mbfitbeta': '𝜷', - \ '\mbfitgamma': '𝜸', - \ '\mbfitdelta': '𝜹', - \ '\mbfitepsilon': '𝜺', - \ '\mbfitzeta': '𝜻', - \ '\mbfiteta': '𝜼', - \ '\mbfittheta': '𝜽', - \ '\mbfitiota': '𝜾', - \ '\mbfitkappa': '𝜿', - \ '\mbfitlambda': '𝝀', - \ '\mbfitmu': '𝝁', - \ '\mbfitnu': '𝝂', - \ '\mbfitxi': '𝝃', - \ '\mbfitomicron': '𝝄', - \ '\mbfitpi': '𝝅', - \ '\mbfitrho': '𝝆', - \ '\mbfitvarsigma': '𝝇', - \ '\mbfitsigma': '𝝈', - \ '\mbfittau': '𝝉', - \ '\mbfitupsilon': '𝝊', - \ '\mbfitphi': '𝝋', - \ '\mbfitchi': '𝝌', - \ '\mbfitpsi': '𝝍', - \ '\mbfitomega': '𝝎', - \ '\mbfitpartial': '𝝏', - \ '\mbfitvarepsilon': '𝝐', - \ '\mbfitvartheta': '𝝑', - \ '\mbfitvarkappa': '𝝒', - \ '\mbfitvarphi': '𝝓', - \ '\mbfitvarrho': '𝝔', - \ '\mbfitvarpi': '𝝕', - \ '\mbfsansAlpha': '𝝖', - \ '\mbfsansBeta': '𝝗', - \ '\mbfsansGamma': '𝝘', - \ '\mbfsansDelta': '𝝙', - \ '\mbfsansEpsilon': '𝝚', - \ '\mbfsansZeta': '𝝛', - \ '\mbfsansEta': '𝝜', - \ '\mbfsansTheta': '𝝝', - \ '\mbfsansIota': '𝝞', - \ '\mbfsansKappa': '𝝟', - \ '\mbfsansLambda': '𝝠', - \ '\mbfsansMu': '𝝡', - \ '\mbfsansNu': '𝝢', - \ '\mbfsansXi': '𝝣', - \ '\mbfsansOmicron': '𝝤', - \ '\mbfsansPi': '𝝥', - \ '\mbfsansRho': '𝝦', - \ '\mbfsansvarTheta': '𝝧', - \ '\mbfsansSigma': '𝝨', - \ '\mbfsansTau': '𝝩', - \ '\mbfsansUpsilon': '𝝪', - \ '\mbfsansPhi': '𝝫', - \ '\mbfsansChi': '𝝬', - \ '\mbfsansPsi': '𝝭', - \ '\mbfsansOmega': '𝝮', - \ '\mbfsansnabla': '𝝯', - \ '\mbfsansalpha': '𝝰', - \ '\mbfsansbeta': '𝝱', - \ '\mbfsansgamma': '𝝲', - \ '\mbfsansdelta': '𝝳', - \ '\mbfsansepsilon': '𝝴', - \ '\mbfsanszeta': '𝝵', - \ '\mbfsanseta': '𝝶', - \ '\mbfsanstheta': '𝝷', - \ '\mbfsansiota': '𝝸', - \ '\mbfsanskappa': '𝝹', - \ '\mbfsanslambda': '𝝺', - \ '\mbfsansmu': '𝝻', - \ '\mbfsansnu': '𝝼', - \ '\mbfsansxi': '𝝽', - \ '\mbfsansomicron': '𝝾', - \ '\mbfsanspi': '𝝿', - \ '\mbfsansrho': '𝞀', - \ '\mbfsansvarsigma': '𝞁', - \ '\mbfsanssigma': '𝞂', - \ '\mbfsanstau': '𝞃', - \ '\mbfsansupsilon': '𝞄', - \ '\mbfsansphi': '𝞅', - \ '\mbfsanschi': '𝞆', - \ '\mbfsanspsi': '𝞇', - \ '\mbfsansomega': '𝞈', - \ '\mbfsanspartial': '𝞉', - \ '\mbfsansvarepsilon': '𝞊', - \ '\mbfsansvartheta': '𝞋', - \ '\mbfsansvarkappa': '𝞌', - \ '\mbfsansvarphi': '𝞍', - \ '\mbfsansvarrho': '𝞎', - \ '\mbfsansvarpi': '𝞏', - \ '\mbfitsansAlpha': '𝞐', - \ '\mbfitsansBeta': '𝞑', - \ '\mbfitsansGamma': '𝞒', - \ '\mbfitsansDelta': '𝞓', - \ '\mbfitsansEpsilon': '𝞔', - \ '\mbfitsansZeta': '𝞕', - \ '\mbfitsansEta': '𝞖', - \ '\mbfitsansTheta': '𝞗', - \ '\mbfitsansIota': '𝞘', - \ '\mbfitsansKappa': '𝞙', - \ '\mbfitsansLambda': '𝞚', - \ '\mbfitsansMu': '𝞛', - \ '\mbfitsansNu': '𝞜', - \ '\mbfitsansXi': '𝞝', - \ '\mbfitsansOmicron': '𝞞', - \ '\mbfitsansPi': '𝞟', - \ '\mbfitsansRho': '𝞠', - \ '\mbfitsansvarTheta': '𝞡', - \ '\mbfitsansSigma': '𝞢', - \ '\mbfitsansTau': '𝞣', - \ '\mbfitsansUpsilon': '𝞤', - \ '\mbfitsansPhi': '𝞥', - \ '\mbfitsansChi': '𝞦', - \ '\mbfitsansPsi': '𝞧', - \ '\mbfitsansOmega': '𝞨', - \ '\mbfitsansnabla': '𝞩', - \ '\mbfitsansalpha': '𝞪', - \ '\mbfitsansbeta': '𝞫', - \ '\mbfitsansgamma': '𝞬', - \ '\mbfitsansdelta': '𝞭', - \ '\mbfitsansepsilon': '𝞮', - \ '\mbfitsanszeta': '𝞯', - \ '\mbfitsanseta': '𝞰', - \ '\mbfitsanstheta': '𝞱', - \ '\mbfitsansiota': '𝞲', - \ '\mbfitsanskappa': '𝞳', - \ '\mbfitsanslambda': '𝞴', - \ '\mbfitsansmu': '𝞵', - \ '\mbfitsansnu': '𝞶', - \ '\mbfitsansxi': '𝞷', - \ '\mbfitsansomicron': '𝞸', - \ '\mbfitsanspi': '𝞹', - \ '\mbfitsansrho': '𝞺', - \ '\mbfitsansvarsigma': '𝞻', - \ '\mbfitsanssigma': '𝞼', - \ '\mbfitsanstau': '𝞽', - \ '\mbfitsansupsilon': '𝞾', - \ '\mbfitsansphi': '𝞿', - \ '\mbfitsanschi': '𝟀', - \ '\mbfitsanspsi': '𝟁', - \ '\mbfitsansomega': '𝟂', - \ '\mbfitsanspartial': '𝟃', - \ '\mbfitsansvarepsilon': '𝟄', - \ '\mbfitsansvartheta': '𝟅', - \ '\mbfitsansvarkappa': '𝟆', - \ '\mbfitsansvarphi': '𝟇', - \ '\mbfitsansvarrho': '𝟈', - \ '\mbfitsansvarpi': '𝟉', - \ '\mbfDigamma': '𝟊', - \ '\mbfdigamma': '𝟋', - \ '\mbfzero': '𝟎', - \ '\mbfone': '𝟏', - \ '\mbftwo': '𝟐', - \ '\mbfthree': '𝟑', - \ '\mbffour': '𝟒', - \ '\mbffive': '𝟓', - \ '\mbfsix': '𝟔', - \ '\mbfseven': '𝟕', - \ '\mbfeight': '𝟖', - \ '\mbfnine': '𝟗', - \ '\Bbbzero': '𝟘', - \ '\Bbbone': '𝟙', - \ '\Bbbtwo': '𝟚', - \ '\Bbbthree': '𝟛', - \ '\Bbbfour': '𝟜', - \ '\Bbbfive': '𝟝', - \ '\Bbbsix': '𝟞', - \ '\Bbbseven': '𝟟', - \ '\Bbbeight': '𝟠', - \ '\Bbbnine': '𝟡', - \ '\msanszero': '𝟢', - \ '\msansone': '𝟣', - \ '\msanstwo': '𝟤', - \ '\msansthree': '𝟥', - \ '\msansfour': '𝟦', - \ '\msansfive': '𝟧', - \ '\msanssix': '𝟨', - \ '\msansseven': '𝟩', - \ '\msanseight': '𝟪', - \ '\msansnine': '𝟫', - \ '\mbfsanszero': '𝟬', - \ '\mbfsansone': '𝟭', - \ '\mbfsanstwo': '𝟮', - \ '\mbfsansthree': '𝟯', - \ '\mbfsansfour': '𝟰', - \ '\mbfsansfive': '𝟱', - \ '\mbfsanssix': '𝟲', - \ '\mbfsansseven': '𝟳', - \ '\mbfsanseight': '𝟴', - \ '\mbfsansnine': '𝟵', - \ '\mttzero': '𝟶', - \ '\mttone': '𝟷', - \ '\mtttwo': '𝟸', - \ '\mttthree': '𝟹', - \ '\mttfour': '𝟺', - \ '\mttfive': '𝟻', - \ '\mttsix': '𝟼', - \ '\mttseven': '𝟽', - \ '\mtteight': '𝟾', - \ '\mttnine': '𝟿', + \ '\bfA': '𝐀', + \ '\bfB': '𝐁', + \ '\bfC': '𝐂', + \ '\bfD': '𝐃', + \ '\bfE': '𝐄', + \ '\bfF': '𝐅', + \ '\bfG': '𝐆', + \ '\bfH': '𝐇', + \ '\bfI': '𝐈', + \ '\bfJ': '𝐉', + \ '\bfK': '𝐊', + \ '\bfL': '𝐋', + \ '\bfM': '𝐌', + \ '\bfN': '𝐍', + \ '\bfO': '𝐎', + \ '\bfP': '𝐏', + \ '\bfQ': '𝐐', + \ '\bfR': '𝐑', + \ '\bfS': '𝐒', + \ '\bfT': '𝐓', + \ '\bfU': '𝐔', + \ '\bfV': '𝐕', + \ '\bfW': '𝐖', + \ '\bfX': '𝐗', + \ '\bfY': '𝐘', + \ '\bfZ': '𝐙', + \ '\bfa': '𝐚', + \ '\bfb': '𝐛', + \ '\bfc': '𝐜', + \ '\bfd': '𝐝', + \ '\bfe': '𝐞', + \ '\bff': '𝐟', + \ '\bfg': '𝐠', + \ '\bfh': '𝐡', + \ '\bfi': '𝐢', + \ '\bfj': '𝐣', + \ '\bfk': '𝐤', + \ '\bfl': '𝐥', + \ '\bfm': '𝐦', + \ '\bfn': '𝐧', + \ '\bfo': '𝐨', + \ '\bfp': '𝐩', + \ '\bfq': '𝐪', + \ '\bfr': '𝐫', + \ '\bfs': '𝐬', + \ '\bft': '𝐭', + \ '\bfu': '𝐮', + \ '\bfv': '𝐯', + \ '\bfw': '𝐰', + \ '\bfx': '𝐱', + \ '\bfy': '𝐲', + \ '\bfz': '𝐳', + \ '\itA': '𝐴', + \ '\itB': '𝐵', + \ '\itC': '𝐶', + \ '\itD': '𝐷', + \ '\itE': '𝐸', + \ '\itF': '𝐹', + \ '\itG': '𝐺', + \ '\itH': '𝐻', + \ '\itI': '𝐼', + \ '\itJ': '𝐽', + \ '\itK': '𝐾', + \ '\itL': '𝐿', + \ '\itM': '𝑀', + \ '\itN': '𝑁', + \ '\itO': '𝑂', + \ '\itP': '𝑃', + \ '\itQ': '𝑄', + \ '\itR': '𝑅', + \ '\itS': '𝑆', + \ '\itT': '𝑇', + \ '\itU': '𝑈', + \ '\itV': '𝑉', + \ '\itW': '𝑊', + \ '\itX': '𝑋', + \ '\itY': '𝑌', + \ '\itZ': '𝑍', + \ '\ita': '𝑎', + \ '\itb': '𝑏', + \ '\itc': '𝑐', + \ '\itd': '𝑑', + \ '\ite': '𝑒', + \ '\itf': '𝑓', + \ '\itg': '𝑔', + \ '\iti': '𝑖', + \ '\itj': '𝑗', + \ '\itk': '𝑘', + \ '\itl': '𝑙', + \ '\itm': '𝑚', + \ '\itn': '𝑛', + \ '\ito': '𝑜', + \ '\itp': '𝑝', + \ '\itq': '𝑞', + \ '\itr': '𝑟', + \ '\its': '𝑠', + \ '\itt': '𝑡', + \ '\itu': '𝑢', + \ '\itv': '𝑣', + \ '\itw': '𝑤', + \ '\itx': '𝑥', + \ '\ity': '𝑦', + \ '\itz': '𝑧', + \ '\biA': '𝑨', + \ '\biB': '𝑩', + \ '\biC': '𝑪', + \ '\biD': '𝑫', + \ '\biE': '𝑬', + \ '\biF': '𝑭', + \ '\biG': '𝑮', + \ '\biH': '𝑯', + \ '\biI': '𝑰', + \ '\biJ': '𝑱', + \ '\biK': '𝑲', + \ '\biL': '𝑳', + \ '\biM': '𝑴', + \ '\biN': '𝑵', + \ '\biO': '𝑶', + \ '\biP': '𝑷', + \ '\biQ': '𝑸', + \ '\biR': '𝑹', + \ '\biS': '𝑺', + \ '\biT': '𝑻', + \ '\biU': '𝑼', + \ '\biV': '𝑽', + \ '\biW': '𝑾', + \ '\biX': '𝑿', + \ '\biY': '𝒀', + \ '\biZ': '𝒁', + \ '\bia': '𝒂', + \ '\bib': '𝒃', + \ '\bic': '𝒄', + \ '\bid': '𝒅', + \ '\bie': '𝒆', + \ '\bif': '𝒇', + \ '\big': '𝒈', + \ '\bih': '𝒉', + \ '\bii': '𝒊', + \ '\bij': '𝒋', + \ '\bik': '𝒌', + \ '\bil': '𝒍', + \ '\bim': '𝒎', + \ '\bin': '𝒏', + \ '\bio': '𝒐', + \ '\bip': '𝒑', + \ '\biq': '𝒒', + \ '\bir': '𝒓', + \ '\bis': '𝒔', + \ '\bit': '𝒕', + \ '\biu': '𝒖', + \ '\biv': '𝒗', + \ '\biw': '𝒘', + \ '\bix': '𝒙', + \ '\biy': '𝒚', + \ '\biz': '𝒛', + \ '\scrA': '𝒜', + \ '\scrC': '𝒞', + \ '\scrD': '𝒟', + \ '\scrG': '𝒢', + \ '\scrJ': '𝒥', + \ '\scrK': '𝒦', + \ '\scrN': '𝒩', + \ '\scrO': '𝒪', + \ '\scrP': '𝒫', + \ '\scrQ': '𝒬', + \ '\scrS': '𝒮', + \ '\scrT': '𝒯', + \ '\scrU': '𝒰', + \ '\scrV': '𝒱', + \ '\scrW': '𝒲', + \ '\scrX': '𝒳', + \ '\scrY': '𝒴', + \ '\scrZ': '𝒵', + \ '\scra': '𝒶', + \ '\scrb': '𝒷', + \ '\scrc': '𝒸', + \ '\scrd': '𝒹', + \ '\scrf': '𝒻', + \ '\scrh': '𝒽', + \ '\scri': '𝒾', + \ '\scrj': '𝒿', + \ '\scrk': '𝓀', + \ '\scrl': '𝓁', + \ '\scrm': '𝓂', + \ '\scrn': '𝓃', + \ '\scrp': '𝓅', + \ '\scrq': '𝓆', + \ '\scrr': '𝓇', + \ '\scrs': '𝓈', + \ '\scrt': '𝓉', + \ '\scru': '𝓊', + \ '\scrv': '𝓋', + \ '\scrw': '𝓌', + \ '\scrx': '𝓍', + \ '\scry': '𝓎', + \ '\scrz': '𝓏', + \ '\bscrA': '𝓐', + \ '\bscrB': '𝓑', + \ '\bscrC': '𝓒', + \ '\bscrD': '𝓓', + \ '\bscrE': '𝓔', + \ '\bscrF': '𝓕', + \ '\bscrG': '𝓖', + \ '\bscrH': '𝓗', + \ '\bscrI': '𝓘', + \ '\bscrJ': '𝓙', + \ '\bscrK': '𝓚', + \ '\bscrL': '𝓛', + \ '\bscrM': '𝓜', + \ '\bscrN': '𝓝', + \ '\bscrO': '𝓞', + \ '\bscrP': '𝓟', + \ '\bscrQ': '𝓠', + \ '\bscrR': '𝓡', + \ '\bscrS': '𝓢', + \ '\bscrT': '𝓣', + \ '\bscrU': '𝓤', + \ '\bscrV': '𝓥', + \ '\bscrW': '𝓦', + \ '\bscrX': '𝓧', + \ '\bscrY': '𝓨', + \ '\bscrZ': '𝓩', + \ '\bscra': '𝓪', + \ '\bscrb': '𝓫', + \ '\bscrc': '𝓬', + \ '\bscrd': '𝓭', + \ '\bscre': '𝓮', + \ '\bscrf': '𝓯', + \ '\bscrg': '𝓰', + \ '\bscrh': '𝓱', + \ '\bscri': '𝓲', + \ '\bscrj': '𝓳', + \ '\bscrk': '𝓴', + \ '\bscrl': '𝓵', + \ '\bscrm': '𝓶', + \ '\bscrn': '𝓷', + \ '\bscro': '𝓸', + \ '\bscrp': '𝓹', + \ '\bscrq': '𝓺', + \ '\bscrr': '𝓻', + \ '\bscrs': '𝓼', + \ '\bscrt': '𝓽', + \ '\bscru': '𝓾', + \ '\bscrv': '𝓿', + \ '\bscrw': '𝔀', + \ '\bscrx': '𝔁', + \ '\bscry': '𝔂', + \ '\bscrz': '𝔃', + \ '\frakA': '𝔄', + \ '\frakB': '𝔅', + \ '\frakD': '𝔇', + \ '\frakE': '𝔈', + \ '\frakF': '𝔉', + \ '\frakG': '𝔊', + \ '\frakJ': '𝔍', + \ '\frakK': '𝔎', + \ '\frakL': '𝔏', + \ '\frakM': '𝔐', + \ '\frakN': '𝔑', + \ '\frakO': '𝔒', + \ '\frakP': '𝔓', + \ '\frakQ': '𝔔', + \ '\frakS': '𝔖', + \ '\frakT': '𝔗', + \ '\frakU': '𝔘', + \ '\frakV': '𝔙', + \ '\frakW': '𝔚', + \ '\frakX': '𝔛', + \ '\frakY': '𝔜', + \ '\fraka': '𝔞', + \ '\frakb': '𝔟', + \ '\frakc': '𝔠', + \ '\frakd': '𝔡', + \ '\frake': '𝔢', + \ '\frakf': '𝔣', + \ '\frakg': '𝔤', + \ '\frakh': '𝔥', + \ '\fraki': '𝔦', + \ '\frakj': '𝔧', + \ '\frakk': '𝔨', + \ '\frakl': '𝔩', + \ '\frakm': '𝔪', + \ '\frakn': '𝔫', + \ '\frako': '𝔬', + \ '\frakp': '𝔭', + \ '\frakq': '𝔮', + \ '\frakr': '𝔯', + \ '\fraks': '𝔰', + \ '\frakt': '𝔱', + \ '\fraku': '𝔲', + \ '\frakv': '𝔳', + \ '\frakw': '𝔴', + \ '\frakx': '𝔵', + \ '\fraky': '𝔶', + \ '\frakz': '𝔷', + \ '\bbA': '𝔸', + \ '\bbB': '𝔹', + \ '\bbD': '𝔻', + \ '\bbE': '𝔼', + \ '\bbF': '𝔽', + \ '\bbG': '𝔾', + \ '\bbI': '𝕀', + \ '\bbJ': '𝕁', + \ '\bbK': '𝕂', + \ '\bbL': '𝕃', + \ '\bbM': '𝕄', + \ '\bbO': '𝕆', + \ '\bbS': '𝕊', + \ '\bbT': '𝕋', + \ '\bbU': '𝕌', + \ '\bbV': '𝕍', + \ '\bbW': '𝕎', + \ '\bbX': '𝕏', + \ '\bbY': '𝕐', + \ '\bba': '𝕒', + \ '\bbb': '𝕓', + \ '\bbc': '𝕔', + \ '\bbd': '𝕕', + \ '\bbe': '𝕖', + \ '\bbf': '𝕗', + \ '\bbg': '𝕘', + \ '\bbh': '𝕙', + \ '\bbi': '𝕚', + \ '\bbj': '𝕛', + \ '\bbk': '𝕜', + \ '\bbl': '𝕝', + \ '\bbm': '𝕞', + \ '\bbn': '𝕟', + \ '\bbo': '𝕠', + \ '\bbp': '𝕡', + \ '\bbq': '𝕢', + \ '\bbr': '𝕣', + \ '\bbs': '𝕤', + \ '\bbt': '𝕥', + \ '\bbu': '𝕦', + \ '\bbv': '𝕧', + \ '\bbw': '𝕨', + \ '\bbx': '𝕩', + \ '\bby': '𝕪', + \ '\bbz': '𝕫', + \ '\bfrakA': '𝕬', + \ '\bfrakB': '𝕭', + \ '\bfrakC': '𝕮', + \ '\bfrakD': '𝕯', + \ '\bfrakE': '𝕰', + \ '\bfrakF': '𝕱', + \ '\bfrakG': '𝕲', + \ '\bfrakH': '𝕳', + \ '\bfrakI': '𝕴', + \ '\bfrakJ': '𝕵', + \ '\bfrakK': '𝕶', + \ '\bfrakL': '𝕷', + \ '\bfrakM': '𝕸', + \ '\bfrakN': '𝕹', + \ '\bfrakO': '𝕺', + \ '\bfrakP': '𝕻', + \ '\bfrakQ': '𝕼', + \ '\bfrakR': '𝕽', + \ '\bfrakS': '𝕾', + \ '\bfrakT': '𝕿', + \ '\bfrakU': '𝖀', + \ '\bfrakV': '𝖁', + \ '\bfrakW': '𝖂', + \ '\bfrakX': '𝖃', + \ '\bfrakY': '𝖄', + \ '\bfrakZ': '𝖅', + \ '\bfraka': '𝖆', + \ '\bfrakb': '𝖇', + \ '\bfrakc': '𝖈', + \ '\bfrakd': '𝖉', + \ '\bfrake': '𝖊', + \ '\bfrakf': '𝖋', + \ '\bfrakg': '𝖌', + \ '\bfrakh': '𝖍', + \ '\bfraki': '𝖎', + \ '\bfrakj': '𝖏', + \ '\bfrakk': '𝖐', + \ '\bfrakl': '𝖑', + \ '\bfrakm': '𝖒', + \ '\bfrakn': '𝖓', + \ '\bfrako': '𝖔', + \ '\bfrakp': '𝖕', + \ '\bfrakq': '𝖖', + \ '\bfrakr': '𝖗', + \ '\bfraks': '𝖘', + \ '\bfrakt': '𝖙', + \ '\bfraku': '𝖚', + \ '\bfrakv': '𝖛', + \ '\bfrakw': '𝖜', + \ '\bfrakx': '𝖝', + \ '\bfraky': '𝖞', + \ '\bfrakz': '𝖟', + \ '\sansA': '𝖠', + \ '\sansB': '𝖡', + \ '\sansC': '𝖢', + \ '\sansD': '𝖣', + \ '\sansE': '𝖤', + \ '\sansF': '𝖥', + \ '\sansG': '𝖦', + \ '\sansH': '𝖧', + \ '\sansI': '𝖨', + \ '\sansJ': '𝖩', + \ '\sansK': '𝖪', + \ '\sansL': '𝖫', + \ '\sansM': '𝖬', + \ '\sansN': '𝖭', + \ '\sansO': '𝖮', + \ '\sansP': '𝖯', + \ '\sansQ': '𝖰', + \ '\sansR': '𝖱', + \ '\sansS': '𝖲', + \ '\sansT': '𝖳', + \ '\sansU': '𝖴', + \ '\sansV': '𝖵', + \ '\sansW': '𝖶', + \ '\sansX': '𝖷', + \ '\sansY': '𝖸', + \ '\sansZ': '𝖹', + \ '\sansa': '𝖺', + \ '\sansb': '𝖻', + \ '\sansc': '𝖼', + \ '\sansd': '𝖽', + \ '\sanse': '𝖾', + \ '\sansf': '𝖿', + \ '\sansg': '𝗀', + \ '\sansh': '𝗁', + \ '\sansi': '𝗂', + \ '\sansj': '𝗃', + \ '\sansk': '𝗄', + \ '\sansl': '𝗅', + \ '\sansm': '𝗆', + \ '\sansn': '𝗇', + \ '\sanso': '𝗈', + \ '\sansp': '𝗉', + \ '\sansq': '𝗊', + \ '\sansr': '𝗋', + \ '\sanss': '𝗌', + \ '\sanst': '𝗍', + \ '\sansu': '𝗎', + \ '\sansv': '𝗏', + \ '\sansw': '𝗐', + \ '\sansx': '𝗑', + \ '\sansy': '𝗒', + \ '\sansz': '𝗓', + \ '\bsansA': '𝗔', + \ '\bsansB': '𝗕', + \ '\bsansC': '𝗖', + \ '\bsansD': '𝗗', + \ '\bsansE': '𝗘', + \ '\bsansF': '𝗙', + \ '\bsansG': '𝗚', + \ '\bsansH': '𝗛', + \ '\bsansI': '𝗜', + \ '\bsansJ': '𝗝', + \ '\bsansK': '𝗞', + \ '\bsansL': '𝗟', + \ '\bsansM': '𝗠', + \ '\bsansN': '𝗡', + \ '\bsansO': '𝗢', + \ '\bsansP': '𝗣', + \ '\bsansQ': '𝗤', + \ '\bsansR': '𝗥', + \ '\bsansS': '𝗦', + \ '\bsansT': '𝗧', + \ '\bsansU': '𝗨', + \ '\bsansV': '𝗩', + \ '\bsansW': '𝗪', + \ '\bsansX': '𝗫', + \ '\bsansY': '𝗬', + \ '\bsansZ': '𝗭', + \ '\bsansa': '𝗮', + \ '\bsansb': '𝗯', + \ '\bsansc': '𝗰', + \ '\bsansd': '𝗱', + \ '\bsanse': '𝗲', + \ '\bsansf': '𝗳', + \ '\bsansg': '𝗴', + \ '\bsansh': '𝗵', + \ '\bsansi': '𝗶', + \ '\bsansj': '𝗷', + \ '\bsansk': '𝗸', + \ '\bsansl': '𝗹', + \ '\bsansm': '𝗺', + \ '\bsansn': '𝗻', + \ '\bsanso': '𝗼', + \ '\bsansp': '𝗽', + \ '\bsansq': '𝗾', + \ '\bsansr': '𝗿', + \ '\bsanss': '𝘀', + \ '\bsanst': '𝘁', + \ '\bsansu': '𝘂', + \ '\bsansv': '𝘃', + \ '\bsansw': '𝘄', + \ '\bsansx': '𝘅', + \ '\bsansy': '𝘆', + \ '\bsansz': '𝘇', + \ '\isansA': '𝘈', + \ '\isansB': '𝘉', + \ '\isansC': '𝘊', + \ '\isansD': '𝘋', + \ '\isansE': '𝘌', + \ '\isansF': '𝘍', + \ '\isansG': '𝘎', + \ '\isansH': '𝘏', + \ '\isansI': '𝘐', + \ '\isansJ': '𝘑', + \ '\isansK': '𝘒', + \ '\isansL': '𝘓', + \ '\isansM': '𝘔', + \ '\isansN': '𝘕', + \ '\isansO': '𝘖', + \ '\isansP': '𝘗', + \ '\isansQ': '𝘘', + \ '\isansR': '𝘙', + \ '\isansS': '𝘚', + \ '\isansT': '𝘛', + \ '\isansU': '𝘜', + \ '\isansV': '𝘝', + \ '\isansW': '𝘞', + \ '\isansX': '𝘟', + \ '\isansY': '𝘠', + \ '\isansZ': '𝘡', + \ '\isansa': '𝘢', + \ '\isansb': '𝘣', + \ '\isansc': '𝘤', + \ '\isansd': '𝘥', + \ '\isanse': '𝘦', + \ '\isansf': '𝘧', + \ '\isansg': '𝘨', + \ '\isansh': '𝘩', + \ '\isansi': '𝘪', + \ '\isansj': '𝘫', + \ '\isansk': '𝘬', + \ '\isansl': '𝘭', + \ '\isansm': '𝘮', + \ '\isansn': '𝘯', + \ '\isanso': '𝘰', + \ '\isansp': '𝘱', + \ '\isansq': '𝘲', + \ '\isansr': '𝘳', + \ '\isanss': '𝘴', + \ '\isanst': '𝘵', + \ '\isansu': '𝘶', + \ '\isansv': '𝘷', + \ '\isansw': '𝘸', + \ '\isansx': '𝘹', + \ '\isansy': '𝘺', + \ '\isansz': '𝘻', + \ '\bisansA': '𝘼', + \ '\bisansB': '𝘽', + \ '\bisansC': '𝘾', + \ '\bisansD': '𝘿', + \ '\bisansE': '𝙀', + \ '\bisansF': '𝙁', + \ '\bisansG': '𝙂', + \ '\bisansH': '𝙃', + \ '\bisansI': '𝙄', + \ '\bisansJ': '𝙅', + \ '\bisansK': '𝙆', + \ '\bisansL': '𝙇', + \ '\bisansM': '𝙈', + \ '\bisansN': '𝙉', + \ '\bisansO': '𝙊', + \ '\bisansP': '𝙋', + \ '\bisansQ': '𝙌', + \ '\bisansR': '𝙍', + \ '\bisansS': '𝙎', + \ '\bisansT': '𝙏', + \ '\bisansU': '𝙐', + \ '\bisansV': '𝙑', + \ '\bisansW': '𝙒', + \ '\bisansX': '𝙓', + \ '\bisansY': '𝙔', + \ '\bisansZ': '𝙕', + \ '\bisansa': '𝙖', + \ '\bisansb': '𝙗', + \ '\bisansc': '𝙘', + \ '\bisansd': '𝙙', + \ '\bisanse': '𝙚', + \ '\bisansf': '𝙛', + \ '\bisansg': '𝙜', + \ '\bisansh': '𝙝', + \ '\bisansi': '𝙞', + \ '\bisansj': '𝙟', + \ '\bisansk': '𝙠', + \ '\bisansl': '𝙡', + \ '\bisansm': '𝙢', + \ '\bisansn': '𝙣', + \ '\bisanso': '𝙤', + \ '\bisansp': '𝙥', + \ '\bisansq': '𝙦', + \ '\bisansr': '𝙧', + \ '\bisanss': '𝙨', + \ '\bisanst': '𝙩', + \ '\bisansu': '𝙪', + \ '\bisansv': '𝙫', + \ '\bisansw': '𝙬', + \ '\bisansx': '𝙭', + \ '\bisansy': '𝙮', + \ '\bisansz': '𝙯', + \ '\ttA': '𝙰', + \ '\ttB': '𝙱', + \ '\ttC': '𝙲', + \ '\ttD': '𝙳', + \ '\ttE': '𝙴', + \ '\ttF': '𝙵', + \ '\ttG': '𝙶', + \ '\ttH': '𝙷', + \ '\ttI': '𝙸', + \ '\ttJ': '𝙹', + \ '\ttK': '𝙺', + \ '\ttL': '𝙻', + \ '\ttM': '𝙼', + \ '\ttN': '𝙽', + \ '\ttO': '𝙾', + \ '\ttP': '𝙿', + \ '\ttQ': '𝚀', + \ '\ttR': '𝚁', + \ '\ttS': '𝚂', + \ '\ttT': '𝚃', + \ '\ttU': '𝚄', + \ '\ttV': '𝚅', + \ '\ttW': '𝚆', + \ '\ttX': '𝚇', + \ '\ttY': '𝚈', + \ '\ttZ': '𝚉', + \ '\tta': '𝚊', + \ '\ttb': '𝚋', + \ '\ttc': '𝚌', + \ '\ttd': '𝚍', + \ '\tte': '𝚎', + \ '\ttf': '𝚏', + \ '\ttg': '𝚐', + \ '\tth': '𝚑', + \ '\tti': '𝚒', + \ '\ttj': '𝚓', + \ '\ttk': '𝚔', + \ '\ttl': '𝚕', + \ '\ttm': '𝚖', + \ '\ttn': '𝚗', + \ '\tto': '𝚘', + \ '\ttp': '𝚙', + \ '\ttq': '𝚚', + \ '\ttr': '𝚛', + \ '\tts': '𝚜', + \ '\ttt': '𝚝', + \ '\ttu': '𝚞', + \ '\ttv': '𝚟', + \ '\ttw': '𝚠', + \ '\ttx': '𝚡', + \ '\tty': '𝚢', + \ '\ttz': '𝚣', + \ '\itimath': '𝚤', + \ '\itjmath': '𝚥', + \ '\bfAlpha': '𝚨', + \ '\bfBeta': '𝚩', + \ '\bfGamma': '𝚪', + \ '\bfDelta': '𝚫', + \ '\bfEpsilon': '𝚬', + \ '\bfZeta': '𝚭', + \ '\bfEta': '𝚮', + \ '\bfTheta': '𝚯', + \ '\bfIota': '𝚰', + \ '\bfKappa': '𝚱', + \ '\bfLambda': '𝚲', + \ '\bfMu': '𝚳', + \ '\bfNu': '𝚴', + \ '\bfXi': '𝚵', + \ '\bfOmicron': '𝚶', + \ '\bfPi': '𝚷', + \ '\bfRho': '𝚸', + \ '\bfvarTheta': '𝚹', + \ '\bfSigma': '𝚺', + \ '\bfTau': '𝚻', + \ '\bfUpsilon': '𝚼', + \ '\bfPhi': '𝚽', + \ '\bfChi': '𝚾', + \ '\bfPsi': '𝚿', + \ '\bfOmega': '𝛀', + \ '\bfnabla': '𝛁', + \ '\bfalpha': '𝛂', + \ '\bfbeta': '𝛃', + \ '\bfgamma': '𝛄', + \ '\bfdelta': '𝛅', + \ '\bfepsilon': '𝛆', + \ '\bfzeta': '𝛇', + \ '\bfeta': '𝛈', + \ '\bftheta': '𝛉', + \ '\bfiota': '𝛊', + \ '\bfkappa': '𝛋', + \ '\bflambda': '𝛌', + \ '\bfmu': '𝛍', + \ '\bfnu': '𝛎', + \ '\bfxi': '𝛏', + \ '\bfomicron': '𝛐', + \ '\bfpi': '𝛑', + \ '\bfrho': '𝛒', + \ '\bfvarsigma': '𝛓', + \ '\bfsigma': '𝛔', + \ '\bftau': '𝛕', + \ '\bfupsilon': '𝛖', + \ '\bfvarphi': '𝛗', + \ '\bfchi': '𝛘', + \ '\bfpsi': '𝛙', + \ '\bfomega': '𝛚', + \ '\bfpartial': '𝛛', + \ '\bfvarepsilon': '𝛜', + \ '\bfvartheta': '𝛝', + \ '\bfvarkappa': '𝛞', + \ '\bfphi': '𝛟', + \ '\bfvarrho': '𝛠', + \ '\bfvarpi': '𝛡', + \ '\itAlpha': '𝛢', + \ '\itBeta': '𝛣', + \ '\itGamma': '𝛤', + \ '\itDelta': '𝛥', + \ '\itEpsilon': '𝛦', + \ '\itZeta': '𝛧', + \ '\itEta': '𝛨', + \ '\itTheta': '𝛩', + \ '\itIota': '𝛪', + \ '\itKappa': '𝛫', + \ '\itLambda': '𝛬', + \ '\itMu': '𝛭', + \ '\itNu': '𝛮', + \ '\itXi': '𝛯', + \ '\itOmicron': '𝛰', + \ '\itPi': '𝛱', + \ '\itRho': '𝛲', + \ '\itvarTheta': '𝛳', + \ '\itSigma': '𝛴', + \ '\itTau': '𝛵', + \ '\itUpsilon': '𝛶', + \ '\itPhi': '𝛷', + \ '\itChi': '𝛸', + \ '\itPsi': '𝛹', + \ '\itOmega': '𝛺', + \ '\itnabla': '𝛻', + \ '\italpha': '𝛼', + \ '\itbeta': '𝛽', + \ '\itgamma': '𝛾', + \ '\itdelta': '𝛿', + \ '\itepsilon': '𝜀', + \ '\itzeta': '𝜁', + \ '\iteta': '𝜂', + \ '\ittheta': '𝜃', + \ '\itiota': '𝜄', + \ '\itkappa': '𝜅', + \ '\itlambda': '𝜆', + \ '\itmu': '𝜇', + \ '\itnu': '𝜈', + \ '\itxi': '𝜉', + \ '\itomicron': '𝜊', + \ '\itpi': '𝜋', + \ '\itrho': '𝜌', + \ '\itvarsigma': '𝜍', + \ '\itsigma': '𝜎', + \ '\ittau': '𝜏', + \ '\itupsilon': '𝜐', + \ '\itphi': '𝜑', + \ '\itchi': '𝜒', + \ '\itpsi': '𝜓', + \ '\itomega': '𝜔', + \ '\itpartial': '𝜕', + \ '\itvarepsilon': '𝜖', + \ '\itvartheta': '𝜗', + \ '\itvarkappa': '𝜘', + \ '\itvarphi': '𝜙', + \ '\itvarrho': '𝜚', + \ '\itvarpi': '𝜛', + \ '\biAlpha': '𝜜', + \ '\biBeta': '𝜝', + \ '\biGamma': '𝜞', + \ '\biDelta': '𝜟', + \ '\biEpsilon': '𝜠', + \ '\biZeta': '𝜡', + \ '\biEta': '𝜢', + \ '\biTheta': '𝜣', + \ '\biIota': '𝜤', + \ '\biKappa': '𝜥', + \ '\biLambda': '𝜦', + \ '\biMu': '𝜧', + \ '\biNu': '𝜨', + \ '\biXi': '𝜩', + \ '\biOmicron': '𝜪', + \ '\biPi': '𝜫', + \ '\biRho': '𝜬', + \ '\bivarTheta': '𝜭', + \ '\biSigma': '𝜮', + \ '\biTau': '𝜯', + \ '\biUpsilon': '𝜰', + \ '\biPhi': '𝜱', + \ '\biChi': '𝜲', + \ '\biPsi': '𝜳', + \ '\biOmega': '𝜴', + \ '\binabla': '𝜵', + \ '\bialpha': '𝜶', + \ '\bibeta': '𝜷', + \ '\bigamma': '𝜸', + \ '\bidelta': '𝜹', + \ '\biepsilon': '𝜺', + \ '\bizeta': '𝜻', + \ '\bieta': '𝜼', + \ '\bitheta': '𝜽', + \ '\biiota': '𝜾', + \ '\bikappa': '𝜿', + \ '\bilambda': '𝝀', + \ '\bimu': '𝝁', + \ '\binu': '𝝂', + \ '\bixi': '𝝃', + \ '\biomicron': '𝝄', + \ '\bipi': '𝝅', + \ '\birho': '𝝆', + \ '\bivarsigma': '𝝇', + \ '\bisigma': '𝝈', + \ '\bitau': '𝝉', + \ '\biupsilon': '𝝊', + \ '\biphi': '𝝋', + \ '\bichi': '𝝌', + \ '\bipsi': '𝝍', + \ '\biomega': '𝝎', + \ '\bipartial': '𝝏', + \ '\bivarepsilon': '𝝐', + \ '\bivartheta': '𝝑', + \ '\bivarkappa': '𝝒', + \ '\bivarphi': '𝝓', + \ '\bivarrho': '𝝔', + \ '\bivarpi': '𝝕', + \ '\bsansAlpha': '𝝖', + \ '\bsansBeta': '𝝗', + \ '\bsansGamma': '𝝘', + \ '\bsansDelta': '𝝙', + \ '\bsansEpsilon': '𝝚', + \ '\bsansZeta': '𝝛', + \ '\bsansEta': '𝝜', + \ '\bsansTheta': '𝝝', + \ '\bsansIota': '𝝞', + \ '\bsansKappa': '𝝟', + \ '\bsansLambda': '𝝠', + \ '\bsansMu': '𝝡', + \ '\bsansNu': '𝝢', + \ '\bsansXi': '𝝣', + \ '\bsansOmicron': '𝝤', + \ '\bsansPi': '𝝥', + \ '\bsansRho': '𝝦', + \ '\bsansvarTheta': '𝝧', + \ '\bsansSigma': '𝝨', + \ '\bsansTau': '𝝩', + \ '\bsansUpsilon': '𝝪', + \ '\bsansPhi': '𝝫', + \ '\bsansChi': '𝝬', + \ '\bsansPsi': '𝝭', + \ '\bsansOmega': '𝝮', + \ '\bsansnabla': '𝝯', + \ '\bsansalpha': '𝝰', + \ '\bsansbeta': '𝝱', + \ '\bsansgamma': '𝝲', + \ '\bsansdelta': '𝝳', + \ '\bsansepsilon': '𝝴', + \ '\bsanszeta': '𝝵', + \ '\bsanseta': '𝝶', + \ '\bsanstheta': '𝝷', + \ '\bsansiota': '𝝸', + \ '\bsanskappa': '𝝹', + \ '\bsanslambda': '𝝺', + \ '\bsansmu': '𝝻', + \ '\bsansnu': '𝝼', + \ '\bsansxi': '𝝽', + \ '\bsansomicron': '𝝾', + \ '\bsanspi': '𝝿', + \ '\bsansrho': '𝞀', + \ '\bsansvarsigma': '𝞁', + \ '\bsanssigma': '𝞂', + \ '\bsanstau': '𝞃', + \ '\bsansupsilon': '𝞄', + \ '\bsansphi': '𝞅', + \ '\bsanschi': '𝞆', + \ '\bsanspsi': '𝞇', + \ '\bsansomega': '𝞈', + \ '\bsanspartial': '𝞉', + \ '\bsansvarepsilon': '𝞊', + \ '\bsansvartheta': '𝞋', + \ '\bsansvarkappa': '𝞌', + \ '\bsansvarphi': '𝞍', + \ '\bsansvarrho': '𝞎', + \ '\bsansvarpi': '𝞏', + \ '\bisansAlpha': '𝞐', + \ '\bisansBeta': '𝞑', + \ '\bisansGamma': '𝞒', + \ '\bisansDelta': '𝞓', + \ '\bisansEpsilon': '𝞔', + \ '\bisansZeta': '𝞕', + \ '\bisansEta': '𝞖', + \ '\bisansTheta': '𝞗', + \ '\bisansIota': '𝞘', + \ '\bisansKappa': '𝞙', + \ '\bisansLambda': '𝞚', + \ '\bisansMu': '𝞛', + \ '\bisansNu': '𝞜', + \ '\bisansXi': '𝞝', + \ '\bisansOmicron': '𝞞', + \ '\bisansPi': '𝞟', + \ '\bisansRho': '𝞠', + \ '\bisansvarTheta': '𝞡', + \ '\bisansSigma': '𝞢', + \ '\bisansTau': '𝞣', + \ '\bisansUpsilon': '𝞤', + \ '\bisansPhi': '𝞥', + \ '\bisansChi': '𝞦', + \ '\bisansPsi': '𝞧', + \ '\bisansOmega': '𝞨', + \ '\bisansnabla': '𝞩', + \ '\bisansalpha': '𝞪', + \ '\bisansbeta': '𝞫', + \ '\bisansgamma': '𝞬', + \ '\bisansdelta': '𝞭', + \ '\bisansepsilon': '𝞮', + \ '\bisanszeta': '𝞯', + \ '\bisanseta': '𝞰', + \ '\bisanstheta': '𝞱', + \ '\bisansiota': '𝞲', + \ '\bisanskappa': '𝞳', + \ '\bisanslambda': '𝞴', + \ '\bisansmu': '𝞵', + \ '\bisansnu': '𝞶', + \ '\bisansxi': '𝞷', + \ '\bisansomicron': '𝞸', + \ '\bisanspi': '𝞹', + \ '\bisansrho': '𝞺', + \ '\bisansvarsigma': '𝞻', + \ '\bisanssigma': '𝞼', + \ '\bisanstau': '𝞽', + \ '\bisansupsilon': '𝞾', + \ '\bisansphi': '𝞿', + \ '\bisanschi': '𝟀', + \ '\bisanspsi': '𝟁', + \ '\bisansomega': '𝟂', + \ '\bisanspartial': '𝟃', + \ '\bisansvarepsilon': '𝟄', + \ '\bisansvartheta': '𝟅', + \ '\bisansvarkappa': '𝟆', + \ '\bisansvarphi': '𝟇', + \ '\bisansvarrho': '𝟈', + \ '\bisansvarpi': '𝟉', + \ '\bfDigamma': '𝟊', + \ '\bfdigamma': '𝟋', + \ '\bfzero': '𝟎', + \ '\bfone': '𝟏', + \ '\bftwo': '𝟐', + \ '\bfthree': '𝟑', + \ '\bffour': '𝟒', + \ '\bffive': '𝟓', + \ '\bfsix': '𝟔', + \ '\bfseven': '𝟕', + \ '\bfeight': '𝟖', + \ '\bfnine': '𝟗', + \ '\bbzero': '𝟘', + \ '\bbone': '𝟙', + \ '\bbtwo': '𝟚', + \ '\bbthree': '𝟛', + \ '\bbfour': '𝟜', + \ '\bbfive': '𝟝', + \ '\bbsix': '𝟞', + \ '\bbseven': '𝟟', + \ '\bbeight': '𝟠', + \ '\bbnine': '𝟡', + \ '\sanszero': '𝟢', + \ '\sansone': '𝟣', + \ '\sanstwo': '𝟤', + \ '\sansthree': '𝟥', + \ '\sansfour': '𝟦', + \ '\sansfive': '𝟧', + \ '\sanssix': '𝟨', + \ '\sansseven': '𝟩', + \ '\sanseight': '𝟪', + \ '\sansnine': '𝟫', + \ '\bsanszero': '𝟬', + \ '\bsansone': '𝟭', + \ '\bsanstwo': '𝟮', + \ '\bsansthree': '𝟯', + \ '\bsansfour': '𝟰', + \ '\bsansfive': '𝟱', + \ '\bsanssix': '𝟲', + \ '\bsansseven': '𝟳', + \ '\bsanseight': '𝟴', + \ '\bsansnine': '𝟵', + \ '\ttzero': '𝟶', + \ '\ttone': '𝟷', + \ '\tttwo': '𝟸', + \ '\ttthree': '𝟹', + \ '\ttfour': '𝟺', + \ '\ttfive': '𝟻', + \ '\ttsix': '𝟼', + \ '\ttseven': '𝟽', + \ '\tteight': '𝟾', + \ '\ttnine': '𝟿', \ '\:mahjong:': '🀄', \ '\:black_joker:': '🃏', \ '\:a:': '🅰', diff --git a/autoload/rubycomplete.vim b/autoload/rubycomplete.vim index 1184c42..88dfaad 100644 --- a/autoload/rubycomplete.vim +++ b/autoload/rubycomplete.vim @@ -105,7 +105,7 @@ function! s:GetBufferRubyEntity( name, type, ... ) endif let curpos = getpos(".") - let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'wr' ) + let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'W' ) call cursor(lastpos[1], lastpos[2]) if lnum > enum @@ -255,15 +255,27 @@ class VimRubyCompletion # {{{ buffer analysis magic def load_requires + + custom_paths = VIM::evaluate("get(g:, 'rubycomplete_load_paths', [])") + + if !custom_paths.empty? + $LOAD_PATH.concat(custom_paths).uniq! + end + buf = VIM::Buffer.current enum = buf.line_number nums = Range.new( 1, enum ) nums.each do |x| + ln = buf[x] begin - eval( "require %s" % $1 ) if /.*require\s*(["'].*?["'])/.match( ln ) - rescue Exception - #ignore? + if /.*require_relative\s*(.*)$/.match( ln ) + eval( "require %s" % File.expand_path($1) ) + elsif /.*require\s*(["'].*?["'])/.match( ln ) + eval( "require %s" % $1 ) + end + rescue Exception => e + dprint e.inspect end end end @@ -346,8 +358,13 @@ class VimRubyCompletion if x != cur_line next if x == 0 ln = buf[x] - if /^\s*(module|class|def|include)\s+/.match(ln) - clscnt += 1 if $1 == "class" + is_const = false + if /^\s*(module|class|def|include)\s+/.match(ln) || is_const = /^\s*?[A-Z]([A-z]|[1-9])*\s*?[|]{0,2}=\s*?.+\s*?/.match(ln) + clscnt += 1 if /class|module/.match($1) + # We must make sure to load each constant only once to avoid errors + if is_const + ln.gsub!(/\s*?[|]{0,2}=\s*?/, '||=') + end #dprint "\$1$1 classdef += "%s\n" % ln classdef += "end\n" if /def\s+/.match(ln) @@ -425,7 +442,6 @@ class VimRubyCompletion return get_buffer_entity_list( "class" ) end - def load_rails allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails") return if allow_rails.to_i.zero? @@ -531,7 +547,6 @@ class VimRubyCompletion ret += ActiveRecord::ConnectionAdapters::SchemaStatements.methods end - return ret end @@ -616,7 +631,6 @@ class VimRubyCompletion want_gems = VIM::evaluate("get(g:, 'rubycomplete_load_gemfile')") load_gems unless want_gems.to_i.zero? - input = VIM::Buffer.current.line cpos = VIM::Window.current.cursor[1] - 1 @@ -670,6 +684,7 @@ class VimRubyCompletion message = Regexp.quote($4) dprint "const or cls 2 [recv: \'%s\', msg: \'%s\']" % [ receiver, message ] load_buffer_class( receiver ) + load_buffer_module( receiver ) begin classes = eval("#{receiver}.constants") #methods = eval("#{receiver}.methods") @@ -790,7 +805,6 @@ class VimRubyCompletion methods += Kernel.public_methods end - include_object = VIM::evaluate("exists('g:rubycomplete_include_object') && g:rubycomplete_include_object") methods = clean_sel( methods, message ) methods = (methods-Object.instance_methods) if include_object == "0" @@ -833,7 +847,6 @@ let s:rubycomplete_rails_loaded = 0 call s:DefRuby() "}}} ruby-side code - " vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl: endif diff --git a/autoload/rust.vim b/autoload/rust.vim index 7e766da..77c38b7 100644 --- a/autoload/rust.vim +++ b/autoload/rust.vim @@ -86,7 +86,7 @@ function! s:Run(dict, rustc_args, args) let pwd = a:dict.istemp ? a:dict.tmpdir : '' let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)'))) - if output != '' + if output !=# '' echohl WarningMsg echo output echohl None @@ -153,7 +153,7 @@ function! s:Expand(dict, pretty, args) endfunction function! rust#CompleteExpand(lead, line, pos) - if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$' + if a:line[: a:pos-1] =~# '^RustExpand!\s*\S*$' " first argument and it has a ! let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"] if !empty(a:lead) @@ -182,7 +182,7 @@ function! s:Emit(dict, type, args) let args = [relpath, '--emit', a:type, '-o', output_path] + a:args let pwd = a:dict.istemp ? a:dict.tmpdir : '' let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)'))) - if output != '' + if output !=# '' echohl WarningMsg echo output echohl None @@ -192,10 +192,10 @@ function! s:Emit(dict, type, args) exe 'silent keepalt read' fnameescape(output_path) 1 d - if a:type == "llvm-ir" + if a:type ==# "llvm-ir" setl filetype=llvm let extension = 'll' - elseif a:type == "asm" + elseif a:type ==# "asm" setl filetype=asm let extension = 's' endif @@ -261,8 +261,8 @@ function! s:WithPath(func, ...) let dict.tmpdir_relpath = filename let dict.path = dict.tmpdir.'/'.filename - let saved.mod = &mod - set nomod + let saved.mod = &modified + set nomodified silent exe 'keepalt write! ' . fnameescape(dict.path) if pathisempty @@ -343,7 +343,7 @@ function! s:ShellTokenize(text) endif let l:state = 3 elseif l:state == 5 " single-quoted - if l:c == "'" + if l:c ==# "'" let l:state = 1 else let l:current .= l:c @@ -361,7 +361,7 @@ function! s:RmDir(path) if empty(a:path) echoerr 'Attempted to delete empty path' return 0 - elseif a:path == '/' || a:path == $HOME + elseif a:path ==# '/' || a:path ==# $HOME echoerr 'Attempted to delete protected path: ' . a:path return 0 endif @@ -414,22 +414,83 @@ function! rust#Play(count, line1, line2, ...) abort call setreg('"', save_regcont, save_regtype) endif - let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content) + let url = l:rust_playpen_url."?code=".webapi#http#encodeURI(content) - if strlen(body) > 5000 - echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None + if strlen(url) > 5000 + echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(url).')' | echohl None return endif - let payload = "format=simple&url=".webapi#http#encodeURI(body) + let payload = "format=simple&url=".webapi#http#encodeURI(url) let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {}) - let url = res.content - - if exists('g:rust_clip_command') - call system(g:rust_clip_command, url) + if res.status[0] ==# '2' + let url = res.content endif - redraw | echomsg 'Done: '.url + let footer = '' + if exists('g:rust_clip_command') + call system(g:rust_clip_command, url) + if !v:shell_error + let footer = ' (copied to clipboard)' + endif + endif + redraw | echomsg 'Done: '.url.footer +endfunction + +" Run a test under the cursor or all tests {{{1 + +" Finds a test function name under the cursor. Returns empty string when a +" test function is not found. +function! s:SearchTestFunctionNameUnderCursor() abort + let cursor_line = line('.') + + " Find #[test] attribute + if search('#\[test]', 'bcW') is 0 + return '' + endif + + " Move to an opening brace of the test function + let test_func_line = search('^\s*fn\s\+\h\w*\s*(.\+{$', 'eW') + if test_func_line is 0 + return '' + endif + + " Search the end of test function (closing brace) to ensure that the + " cursor position is within function definition + normal! % + if line('.') < cursor_line + return '' + endif + + return matchstr(getline(test_func_line), '^\s*fn\s\+\zs\h\w*') +endfunction + +function! rust#Test(all, options) abort + let pwd = expand('%:p:h') + if findfile('Cargo.toml', pwd . ';') ==# '' + return rust#Run(1, '--test ' . a:options) + endif + + let pwd = shellescape(pwd) + + if a:all + execute '!cd ' . pwd . ' && cargo test ' . a:options + return + endif + + let saved = getpos('.') + try + let func_name = s:SearchTestFunctionNameUnderCursor() + if func_name ==# '' + echohl ErrorMsg + echo 'No test function was found under the cursor. Please add ! to command if you want to run all tests' + echohl None + return + endif + execute '!cd ' . pwd . ' && cargo test ' . func_name . ' ' . a:options + finally + call setpos('.', saved) + endtry endfunction " }}}1 diff --git a/autoload/rust/debugging.vim b/autoload/rust/debugging.vim index 352556d..ff88e00 100644 --- a/autoload/rust/debugging.vim +++ b/autoload/rust/debugging.vim @@ -18,6 +18,7 @@ let s:global_variable_list = [ \ 'rust_last_rustc_args', \ 'rust_original_delimitMate_excluded_regions', \ 'rust_playpen_url', + \ 'rust_prev_delimitMate_quotes', \ 'rust_recent_nearest_cargo_tol', \ 'rust_recent_root_cargo_toml', \ 'rust_recommended_style', diff --git a/autoload/rust/delimitmate.vim b/autoload/rust/delimitmate.vim new file mode 100644 index 0000000..e99cc87 --- /dev/null +++ b/autoload/rust/delimitmate.vim @@ -0,0 +1,48 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 + +let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate' + +" For this buffer, when delimitMate issues the `User delimitMate_map` +" event in the autocommand system, add the above-defined extra excluded +" regions to delimitMate's state, if they have not already been added. +function! rust#delimitmate#onMap() abort + if &filetype !=# 'rust' + return + endif + + if get(b:, "delimitMate_quotes") + let b:rust_prev_delimitMate_quotes = b:delimitMate_quotes + endif + let b:delimitMate_quotes = "\" `" + + if match(delimitMate#Get("excluded_regions"), + \ s:delimitMate_extra_excluded_regions) == -1 + call delimitMate#Set("excluded_regions", + \delimitMate#Get("excluded_regions").s:delimitMate_extra_excluded_regions) + endif +endfunction + +" For this buffer, when delimitMate issues the `User delimitMate_unmap` +" event in the autocommand system, delete the above-defined extra excluded +" regions from delimitMate's state (the deletion being idempotent and +" having no effect if the extra excluded regions are not present in the +" targeted part of delimitMate's state). +function! rust#delimitmate#onUnmap() abort + if &filetype !=# 'rust' + return + endif + + if get(b:, "rust_prev_delimitMate_quotes") + let b:delimitMate_quotes = b:rust_prev_delimitMate_quotes + endif + + call delimitMate#Set("excluded_regions", substitute( + \ delimitMate#Get("excluded_regions"), + \ '\C\V' . s:delimitMate_extra_excluded_regions, + \ '', 'g')) +endfunction + +" vim: set et sw=4 sts=4 ts=8: + + +endif diff --git a/autoload/rustfmt.vim b/autoload/rustfmt.vim index c033517..916736c 100644 --- a/autoload/rustfmt.vim +++ b/autoload/rustfmt.vim @@ -63,6 +63,20 @@ function! s:RustfmtWriteMode() endif endfunction +function! s:RustfmtConfig() + let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';') + if l:rustfmt_toml !=# '' + return '--config-path '.l:rustfmt_toml + endif + + let l:_rustfmt_toml = findfile('.rustfmt.toml', expand('%:p:h') . ';') + if l:_rustfmt_toml !=# '' + return '--config-path '.l:_rustfmt_toml + endif + + return '' +endfunction + function! s:RustfmtCommandRange(filename, line1, line2) if g:rustfmt_file_lines == 0 echo "--file-lines is not supported in the installed `rustfmt` executable" @@ -71,6 +85,7 @@ function! s:RustfmtCommandRange(filename, line1, line2) let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]} let l:write_mode = s:RustfmtWriteMode() + let l:rustfmt_config = s:RustfmtConfig() " FIXME: When --file-lines gets to be stable, enhance this version range checking " accordingly. @@ -78,34 +93,73 @@ function! s:RustfmtCommandRange(filename, line1, line2) \ (s:rustfmt_unstable_features && (s:rustfmt_version < '1.')) \ ? '--unstable-features' : '' - let l:cmd = printf("%s %s %s %s --file-lines '[%s]' %s", g:rustfmt_command, - \ l:write_mode, g:rustfmt_options, - \ l:unstable_features, json_encode(l:arg), shellescape(a:filename)) + let l:cmd = printf("%s %s %s %s %s --file-lines '[%s]' %s", g:rustfmt_command, + \ l:write_mode, g:rustfmt_options, + \ l:unstable_features, l:rustfmt_config, + \ json_encode(l:arg), shellescape(a:filename)) return l:cmd endfunction -function! s:RustfmtCommand(filename) - let l:write_mode = s:RustfmtWriteMode() - return g:rustfmt_command . " ". l:write_mode . " " . g:rustfmt_options . " " . shellescape(a:filename) +function! s:RustfmtCommand() + if g:rustfmt_emit_files + let l:write_mode = "--emit=stdout" + else + let l:write_mode = "--write-mode=display" + endif + " rustfmt will pick on the right config on its own due to the + " current directory change. + return g:rustfmt_command . " ". l:write_mode . " " . g:rustfmt_options +endfunction + +function! s:DeleteLines(start, end) abort + silent! execute a:start . ',' . a:end . 'delete _' endfunction function! s:RunRustfmt(command, tmpname, fail_silently) mkview! - if exists("*systemlist") - let out = systemlist(a:command) + let l:stderr_tmpname = tempname() + let l:command = a:command . ' 2> ' . l:stderr_tmpname + + if a:tmpname ==# '' + " Rustfmt in stdin/stdout mode + + " chdir to the directory of the file + let l:has_lcd = haslocaldir() + let l:prev_cd = getcwd() + execute 'lchdir! '.expand('%:h') + + let l:buffer = getline(1, '$') + if exists("*systemlist") + silent let out = systemlist(l:command, l:buffer) + else + silent let out = split(system(l:command, l:buffer), '\r\?\n') + endif else - let out = split(system(a:command), '\r\?\n') + if exists("*systemlist") + silent let out = systemlist(l:command) + else + silent let out = split(system(l:command), '\r\?\n') + endif endif - if v:shell_error == 0 || v:shell_error == 3 + let l:stderr = readfile(l:stderr_tmpname) + + call delete(l:stderr_tmpname) + + if v:shell_error == 0 " remove undo point caused via BufWritePre try | silent undojoin | catch | endtry - " take the tmpfile's content, this is better than rename - " because it preserves file modes. - let l:content = readfile(a:tmpname) - 1,$d _ + if a:tmpname ==# '' + let l:content = l:out + else + " take the tmpfile's content, this is better than rename + " because it preserves file modes. + let l:content = readfile(a:tmpname) + endif + + call s:DeleteLines(len(l:content), line('$')) call setline(1, l:content) " only clear location list if it was previously filled to prevent @@ -117,61 +171,69 @@ function! s:RunRustfmt(command, tmpname, fail_silently) endif elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0 " otherwise get the errors and put them in the location list - let errors = [] + let l:errors = [] - let prev_line = "" - for line in out + let l:prev_line = "" + for l:line in l:stderr " error: expected one of `;` or `as`, found `extern` " --> src/main.rs:2:1 - let tokens = matchlist(line, '^\s-->\s\(.\{-}\):\(\d\+\):\(\d\+\)$') + let tokens = matchlist(l:line, '^\s\+-->\s\(.\{-}\):\(\d\+\):\(\d\+\)$') if !empty(tokens) - call add(errors, {"filename": @%, + call add(l:errors, {"filename": @%, \"lnum": tokens[2], \"col": tokens[3], - \"text": prev_line}) + \"text": l:prev_line}) endif - let prev_line = line + let l:prev_line = l:line endfor - if empty(errors) - % | " Couldn't detect rustfmt error format, output errors - endif - - if !empty(errors) - call setloclist(0, errors, 'r') + if !empty(l:errors) + call setloclist(0, l:errors, 'r') echohl Error | echomsg "rustfmt returned error" | echohl None + else + echo "rust.vim: was not able to parse rustfmt messages. Here is the raw output:" + echo "\n" + for l:line in l:stderr + echo l:line + endfor endif let s:got_fmt_error = 1 lwindow endif - call delete(a:tmpname) + " Restore the current directory if needed + if a:tmpname ==# '' + if l:has_lcd + execute 'lchdir! '.l:prev_cd + else + execute 'chdir! '.l:prev_cd + endif + endif silent! loadview endfunction -function! s:rustfmtSaveToTmp() +function! rustfmt#FormatRange(line1, line2) let l:tmpname = tempname() call writefile(getline(1, '$'), l:tmpname) - return l:tmpname -endfunction - -function! rustfmt#FormatRange(line1, line2) - let l:tmpname = s:rustfmtSaveToTmp() let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2) call s:RunRustfmt(command, l:tmpname, 0) + call delete(l:tmpname) endfunction function! rustfmt#Format() - let l:tmpname = s:rustfmtSaveToTmp() - let command = s:RustfmtCommand(l:tmpname) - call s:RunRustfmt(command, l:tmpname, 0) + call s:RunRustfmt(s:RustfmtCommand(), '', 0) +endfunction + +function! rustfmt#Cmd() + " Mainly for debugging + return s:RustfmtCommand() endfunction function! rustfmt#PreWrite() if rust#GetConfigVar('rustfmt_autosave_if_config_present', 0) - if findfile('rustfmt.toml', '.;') !=# '' + if findfile('rustfmt.toml', '.;') !=# '' || findfile('.rustfmt.toml', '.;') !=# '' let b:rustfmt_autosave = 1 let b:rustfmt_autosave_because_of_config = 1 endif @@ -181,9 +243,7 @@ function! rustfmt#PreWrite() return endif - let l:tmpname = s:rustfmtSaveToTmp() - let command = s:RustfmtCommand(l:tmpname) - call s:RunRustfmt(command, l:tmpname, 1) + call s:RunRustfmt(s:RustfmtCommand(), '', 1) endfunction diff --git a/compiler/cargo.vim b/compiler/cargo.vim index 10147e0..f70ca90 100644 --- a/compiler/cargo.vim +++ b/compiler/cargo.vim @@ -12,8 +12,10 @@ endif runtime compiler/rustc.vim let current_compiler = "cargo" +" vint: -ProhibitAbbreviationOption let s:save_cpo = &cpo set cpo&vim +" vint: +ProhibitAbbreviationOption if exists(':CompilerSet') != 2 command -nargs=* CompilerSet setlocal @@ -41,8 +43,10 @@ CompilerSet errorformat+= \%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#, \%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c +" vint: -ProhibitAbbreviationOption let &cpo = s:save_cpo unlet s:save_cpo +" vint: +ProhibitAbbreviationOption " vim: set et sw=4 sts=4 ts=8: diff --git a/compiler/nix-build.vim b/compiler/nix-build.vim new file mode 100644 index 0000000..bd8791f --- /dev/null +++ b/compiler/nix-build.vim @@ -0,0 +1,15 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1 + +if exists('current_compiler') + finish +endif +let current_compiler = 'nix-build' + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet errorformat=error:\ %m\ at\ %f:%l:%c,builder\ for\ \'%m\'\ failed\ with\ exit\ code\ %n,fixed-output\ derivation\ produced\ path\ \'%s\'\ with\ %m +CompilerSet makeprg=nix-build + +endif diff --git a/compiler/rspec.vim b/compiler/rspec.vim index b990bd4..a8a10e1 100644 --- a/compiler/rspec.vim +++ b/compiler/rspec.vim @@ -26,6 +26,7 @@ CompilerSet errorformat= \%E%f:%l:in\ `%*[^']':\ %m, \%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#, \%E\ \ \ \ \ Failure/Error:\ %m, + \%E\ \ \ \ \ Failure/Error:, \%C\ \ \ \ \ %m, \%C%\\s%#, \%-G%.%# diff --git a/compiler/rustc.vim b/compiler/rustc.vim index 23390fd..bbb1318 100644 --- a/compiler/rustc.vim +++ b/compiler/rustc.vim @@ -11,8 +11,10 @@ if exists("current_compiler") endif let current_compiler = "rustc" -let s:cpo_save = &cpo +" vint: -ProhibitAbbreviationOption +let s:save_cpo = &cpo set cpo&vim +" vint: +ProhibitAbbreviationOption if exists(":CompilerSet") != 2 command -nargs=* CompilerSet setlocal @@ -45,8 +47,10 @@ CompilerSet errorformat+= \%-G%*[\ ]^%*[~], \%-G%*[\ ]... -let &cpo = s:cpo_save -unlet s:cpo_save +" vint: -ProhibitAbbreviationOption +let &cpo = s:save_cpo +unlet s:save_cpo +" vint: +ProhibitAbbreviationOption " vim: set et sw=4 sts=4 ts=8: diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 580946f..20d4a1a 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -209,6 +209,7 @@ endif if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1 augroup filetypedetect " crystal, from crystal.vim in rhysd/vim-crystal +" vint: -ProhibitAutocmdWithNoGroup autocmd BufNewFile,BufReadPost *.cr setlocal filetype=crystal autocmd BufNewFile,BufReadPost Projectfile setlocal filetype=crystal autocmd BufNewFile,BufReadPost *.ecr setlocal filetype=eruby @@ -370,6 +371,25 @@ au BufReadPost *.s call s:gofiletype_post() au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl +" Set the filetype if the first non-comment and non-blank line starts with +" 'module '. +au BufNewFile,BufRead go.mod call s:gomod() + +fun! s:gomod() + for l:i in range(1, line('$')) + let l:l = getline(l:i) + if l:l ==# '' || l:l[:1] ==# '//' + continue + endif + + if l:l =~# '^module .\+' + set filetype=gomod + endif + + break + endfor +endfun + " vim: sw=2 ts=2 et augroup end endif @@ -623,13 +643,14 @@ au BufRead,BufNewFile nginx*.conf set ft=nginx au BufRead,BufNewFile *nginx.conf set ft=nginx au BufRead,BufNewFile */etc/nginx/* set ft=nginx au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx +au BufRead,BufNewFile */nginx/*.conf set ft=nginx augroup end endif if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1 augroup filetypedetect " nim, from nim.vim in zah/nim.vim:_BASIC -au BufNewFile,BufRead *.nim,*.nims set filetype=nim +au BufNewFile,BufRead *.nim,*.nims,*.nimble set filetype=nim augroup end endif @@ -944,8 +965,10 @@ endif if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 augroup filetypedetect " rust, from rust.vim in rust-lang/rust.vim -au BufRead,BufNewFile *.rs set filetype=rust -au BufRead,BufNewFile Cargo.toml if &filetype == "" | set filetype=cfg | endif +" vint: -ProhibitAutocmdWithNoGroup + +autocmd BufRead,BufNewFile *.rs set filetype=rust +autocmd BufRead,BufNewFile Cargo.toml if &filetype == "" | set filetype=cfg | endif " vim: set et sw=4 sts=4 ts=8: augroup end @@ -1067,7 +1090,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1 augroup filetypedetect " toml, from toml.vim in cespare/vim-toml " Go dep and Rust use several TOML config files that are not named with .toml. -autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config,Pipfile set filetype=toml +autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config,*/.cargo/credentials,Pipfile set filetype=toml augroup end endif diff --git a/ftplugin/crystal.vim b/ftplugin/crystal.vim index 6ef907b..58ce525 100644 --- a/ftplugin/crystal.vim +++ b/ftplugin/crystal.vim @@ -51,6 +51,7 @@ command! -buffer -nargs=? CrystalSpecSwitch call crystal_lang#switch_spec_file(< command! -buffer -nargs=? CrystalSpecRunAll call crystal_lang#run_all_spec() command! -buffer -nargs=? CrystalSpecRunCurrent call crystal_lang#run_current_spec() command! -buffer -nargs=* -bar CrystalFormat call crystal_lang#format(, 0) +command! -buffer -nargs=* CrystalExpand echo crystal_lang#expand(expand('%'), getpos('.'), ).output nnoremap (crystal-jump-to-definition) :CrystalDef nnoremap (crystal-show-context) :CrystalContext diff --git a/ftplugin/git.vim b/ftplugin/git.vim index 38b9493..e5c34b4 100644 --- a/ftplugin/git.vim +++ b/ftplugin/git.vim @@ -12,7 +12,7 @@ endif let b:did_ftplugin = 1 if !exists('b:git_dir') - if expand('%:p') =~# '[\/]\.git[\/]modules[\/]' + if expand('%:p') =~# '[\/]\.git[\/]modules[\/]\|:[\/][\/]\|^\a\a\+:' " Stay out of the way elseif expand('%:p') =~# '[\/]\.git[\/]worktrees' let b:git_dir = matchstr(expand('%:p'),'.*\.git[\/]worktrees[\/][^\/]\+\>') diff --git a/ftplugin/julia.vim b/ftplugin/julia.vim index 2d1bcb4..caddaba 100644 --- a/ftplugin/julia.vim +++ b/ftplugin/julia.vim @@ -19,11 +19,12 @@ setlocal comments=:# setlocal commentstring=#=%s=# setlocal cinoptions+=#1 setlocal define=^\\s*macro\\> +setlocal fo-=t fo+=croql let b:julia_vim_loaded = 1 let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<" - \ . " define< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< omnifunc<" + \ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< omnifunc<" \ . " | unlet! b:julia_vim_loaded" " MatchIt plugin support @@ -93,6 +94,14 @@ if has("gui_win32") let b:undo_ftplugin = b:undo_ftplugin . " | unlet! b:browsefilter" endif +" Lookup documents +nnoremap (JuliaDocPrompt) :call julia#doc#prompt() +command! -nargs=1 -buffer -complete=customlist,julia#doc#complete JuliaDoc call julia#doc#open() +command! -nargs=1 -buffer JuliaDocKeywordprg call julia#doc#keywordprg() +setlocal keywordprg=:JuliaDocKeywordprg +let b:undo_ftplugin .= " | setlocal keywordprg<" +let b:undo_ftplugin .= " | delcommand JuliaDoc | delcommand JuliaDocKeywordprg" + let &cpo = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/juliadoc.vim b/ftplugin/juliadoc.vim new file mode 100644 index 0000000..0544ff8 --- /dev/null +++ b/ftplugin/juliadoc.vim @@ -0,0 +1,34 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1 + +" Vim filetype plugin file +" Language: Julia document + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpo = &cpo +set cpo-=C + +setlocal conceallevel=2 +setlocal concealcursor=nc +setlocal wrap + +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +endif +let b:undo_ftplugin .= 'setlocal conceallevel< concealcursor< wrap<' + +" Lookup documents +nnoremap (JuliaDocPrompt) :call julia#doc#prompt() +command! -nargs=1 -buffer -complete=customlist,julia#doc#complete JuliaDoc call julia#doc#open() +command! -nargs=1 -buffer JuliaDocKeywordprg call julia#doc#keywordprg() +setlocal keywordprg=:JuliaDocKeywordprg +let b:undo_ftplugin .= " | setlocal keywordprg<" +let b:undo_ftplugin .= " | delcommand JuliaDoc | delcommand JuliaDocKeywordprg" + +let &cpo = s:save_cpo +unlet s:save_cpo + +endif diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim index acf4d71..ead86d1 100644 --- a/ftplugin/rust.vim +++ b/ftplugin/rust.vim @@ -12,8 +12,10 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 +" vint: -ProhibitAbbreviationOption let s:save_cpo = &cpo set cpo&vim +" vint: +ProhibitAbbreviationOption augroup rust.vim autocmd! @@ -69,32 +71,13 @@ augroup rust.vim let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions endif - let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate' + autocmd User delimitMate_map :call rust#delimitmate#onMap() + autocmd User delimitMate_unmap :call rust#delimitmate#onUnmap() + endif - " For this buffer, when delimitMate issues the `User delimitMate_map` - " event in the autocommand system, add the above-defined extra excluded - " regions to delimitMate's state, if they have not already been added. - autocmd User - \ if expand('') ==# 'delimitMate_map' && match( - \ delimitMate#Get("excluded_regions"), - \ s:delimitMate_extra_excluded_regions) == -1 - \| let b:delimitMate_excluded_regions = - \ delimitMate#Get("excluded_regions") - \ . s:delimitMate_extra_excluded_regions - \|endif - - " For this buffer, when delimitMate issues the `User delimitMate_unmap` - " event in the autocommand system, delete the above-defined extra excluded - " regions from delimitMate's state (the deletion being idempotent and - " having no effect if the extra excluded regions are not present in the - " targeted part of delimitMate's state). - autocmd User - \ if expand('') ==# 'delimitMate_unmap' - \| let b:delimitMate_excluded_regions = substitute( - \ delimitMate#Get("excluded_regions"), - \ '\C\V' . s:delimitMate_extra_excluded_regions, - \ '', 'g') - \|endif + " Integration with auto-pairs (https://github.com/jiangmiao/auto-pairs) + if exists("g:AutoPairsLoaded") && !get(g:, 'rust_keep_autopairs_default', 0) + let b:AutoPairs = {'(':')', '[':']', '{':'}','"':'"', '`':'`'} endif if has("folding") && get(g:, 'rust_fold', 0) @@ -154,6 +137,9 @@ augroup rust.vim " See |:RustInfoToFile| for docs command! -bar -nargs=1 RustInfoToFile call rust#debugging#InfoToFile() + " See |:RustTest| for docs + command! -buffer -nargs=* -bang RustTest call rust#Test(0, ) + if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args") let b:rust_last_rustc_args = [] let b:rust_last_args = [] @@ -192,23 +178,25 @@ augroup rust.vim \|xunmap ]] \|ounmap [[ \|ounmap ]] - \|set matchpairs-=<:> + \|setlocal matchpairs-=<:> \|unlet b:match_skip \" " }}}1 " Code formatting on save - autocmd BufWritePre *.rs silent! call rustfmt#PreWrite() + autocmd BufWritePre silent! call rustfmt#PreWrite() augroup END -set matchpairs+=<:> +setlocal matchpairs+=<:> " For matchit.vim (rustArrow stops `Fn() -> X` messing things up) let b:match_skip = 's:comment\|string\|rustArrow' +" vint: -ProhibitAbbreviationOption let &cpo = s:save_cpo unlet s:save_cpo +" vint: +ProhibitAbbreviationOption " vim: set et sw=4 sts=4 ts=8: diff --git a/ftplugin/rust/tagbar.vim b/ftplugin/rust/tagbar.vim index 5c95f35..d30dd7d 100644 --- a/ftplugin/rust/tagbar.vim +++ b/ftplugin/rust/tagbar.vim @@ -7,30 +7,36 @@ if !exists(':Tagbar') finish endif +" vint: -ProhibitAbbreviationOption let s:save_cpo = &cpo set cpo&vim +" vint: +ProhibitAbbreviationOption -let g:tagbar_type_rust = { - \ 'ctagstype' : 'rust', - \ 'kinds' : [ - \'T:types', - \'f:functions', - \'g:enumerations', - \'s:structures', - \'m:modules', - \'c:constants', - \'t:traits', - \'i:trait implementations', - \ ] - \ } +if !exists('g:tagbar_type_rust') + let g:tagbar_type_rust = { + \ 'ctagstype' : 'rust', + \ 'kinds' : [ + \'T:types', + \'f:functions', + \'g:enumerations', + \'s:structures', + \'m:modules', + \'c:constants', + \'t:traits', + \'i:trait implementations', + \ ] + \ } +endif " In case you've updated/customized your ~/.ctags and prefer to use it. if !get(g:, 'rust_use_custom_ctags_defs', 0) let g:tagbar_type_rust.deffile = expand(':p:h:h:h') . '/ctags/rust.ctags' endif +" vint: -ProhibitAbbreviationOption let &cpo = s:save_cpo unlet s:save_cpo +" vint: +ProhibitAbbreviationOption " vim: set et sw=4 sts=4 ts=8: diff --git a/ftplugin/slim.vim b/ftplugin/slim.vim index 99ebeeb..8de98c8 100644 --- a/ftplugin/slim.vim +++ b/ftplugin/slim.vim @@ -3,9 +3,25 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1 if exists("b:did_ftplugin") finish endif + +" Define some defaults in case the included ftplugins don't set them. +let s:undo_ftplugin = "" + +" Override our defaults if these were set by an included ftplugin. +if exists("b:undo_ftplugin") + let s:undo_ftplugin = b:undo_ftplugin + unlet b:undo_ftplugin +endif + +runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl isk<" +" Combine the new set of values with those previously included. +if exists("b:undo_ftplugin") + let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin +endif + +let b:undo_ftplugin = "setl isk<" . " | " . s:undo_ftplugin setlocal iskeyword+=- setlocal commentstring=/%s diff --git a/ftplugin/terraform.vim b/ftplugin/terraform.vim new file mode 100644 index 0000000..ce64637 --- /dev/null +++ b/ftplugin/terraform.vim @@ -0,0 +1,73 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1 + +" terraform.vim - basic vim/terraform integration +" Maintainer: HashiVim + +if exists("g:loaded_terraform") || v:version < 700 || &cp || !executable('terraform') + finish +endif +let g:loaded_terraform = 1 + +if !exists("g:terraform_fmt_on_save") + let g:terraform_fmt_on_save = 0 +endif + +function! s:commands(A, L, P) + return join([ + \ "apply", + \ "console", + \ "destroy", + \ "env", + \ "fmt", + \ "get", + \ "graph", + \ "import", + \ "init", + \ "output", + \ "plan", + \ "providers", + \ "push", + \ "refresh", + \ "show", + \ "taint", + \ "untaint", + \ "validate", + \ "version", + \ "workspace", + \ "debug", + \ "force-unlock", + \ "state" + \ ], "\n") +endfunction + +" Adapted from vim-hclfmt: +" https://github.com/fatih/vim-hclfmt/blob/master/autoload/fmt.vim +function! terraform#fmt() + let l:curw = winsaveview() + let l:tmpfile = tempname() + call writefile(getline(1, "$"), l:tmpfile) + let output = system("terraform fmt -write " . l:tmpfile) + if v:shell_error == 0 + try | silent undojoin | catch | endtry + call rename(l:tmpfile, resolve(expand("%"))) + silent edit! + let &syntax = &syntax + else + echo output + call delete(l:tmpfile) + endif + call winrestview(l:curw) +endfunction + +augroup terraform + autocmd! + autocmd VimEnter * + \ command! -nargs=+ -complete=custom,s:commands Terraform execute '!terraform '.. ' -no-color' + autocmd VimEnter * command! -nargs=0 TerraformFmt call terraform#fmt() + if get(g:, "terraform_fmt_on_save", 1) + autocmd BufWritePre *.tf call terraform#fmt() + autocmd BufWritePre *.tfvars call terraform#fmt() + endif +augroup END + +endif diff --git a/ftplugin/vue.vim b/ftplugin/vue.vim index 959dca4..2f57d65 100644 --- a/ftplugin/vue.vim +++ b/ftplugin/vue.vim @@ -22,7 +22,7 @@ endif " Run only ESLint for Vue files by default. " linters specifically for Vue can still be loaded. -let b:ale_linter_aliases = ['vue', 'javascript'] -let b:ale_linters = ['eslint'] +let b:ale_linter_aliases = get(get(g:, 'ale_linter_aliases', {}), 'vue', ['vue', 'javascript']) +let b:ale_linters = get(get(g:, 'ale_linters', {}), 'vue', ['eslint', 'vls']) endif diff --git a/indent/crystal.vim b/indent/crystal.vim index fad2822..9fd6c1f 100644 --- a/indent/crystal.vim +++ b/indent/crystal.vim @@ -129,17 +129,17 @@ let s:access_modifier_regex = '\C^\s*\%(public\|protected\|private\)\s*\%(#.*\)\ " Check if the character at lnum:col is inside a string, comment, or is ascii. function s:IsInStringOrComment(lnum, col) - return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_strcom + return synIDattr(synID(a:lnum, a:col, 1), 'name') =~# s:syng_strcom endfunction " Check if the character at lnum:col is inside a string. function s:IsInString(lnum, col) - return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_string + return synIDattr(synID(a:lnum, a:col, 1), 'name') =~# s:syng_string endfunction " Check if the character at lnum:col is inside a string or documentation. function s:IsInStringOrDocumentation(lnum, col) - return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_stringdoc + return synIDattr(synID(a:lnum, a:col, 1), 'name') =~# s:syng_stringdoc endfunction " Check if the character at lnum:col is inside a string delimiter diff --git a/indent/cython.vim b/indent/cython.vim index c6777c0..b44839d 100644 --- a/indent/cython.vim +++ b/indent/cython.vim @@ -36,6 +36,10 @@ if !exists('g:python_pep8_indent_multiline_string') let g:python_pep8_indent_multiline_string = 0 endif +if !exists('g:python_pep8_indent_hang_closing') + let g:python_pep8_indent_hang_closing = 0 +endif + let s:block_rules = { \ '^\s*elif\>': ['if', 'elif'], \ '^\s*except\>': ['try', 'except'], @@ -59,7 +63,7 @@ let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>' " jedi* refers to syntax definitions from jedi-vim for call signatures, which " are inserted temporarily into the buffer. let s:skip_special_chars = 'synIDattr(synID(line("."), col("."), 0), "name") ' . - \ '=~? "\\vstring|comment|jedi\\S"' + \ '=~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"' let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' . \ '=~? "\\vcomment|jedi\\S"' @@ -90,14 +94,6 @@ else endfunction endif -function! s:pair_sort(x, y) - if a:x[0] == a:y[0] - return a:x[1] == a:y[1] ? 0 : a:x[1] > a:y[1] ? 1 : -1 - else - return a:x[0] > a:y[0] ? 1 : -1 - endif -endfunction - " Find backwards the closest open parenthesis/bracket/brace. function! s:find_opening_paren(...) " optional arguments: line and column (defaults to 1) to search around @@ -144,27 +140,21 @@ endfunction " Find possible indent(s) of the block starter that matches the current line. function! s:find_start_of_block(lnum, types, multiple) let r = [] - let types = copy(a:types) let re = '\V\^\s\*\('.join(a:types, '\|').'\)\>' let lnum = a:lnum let last_indent = indent(lnum) + 1 while lnum > 0 && last_indent > 0 let indent = indent(lnum) if indent < last_indent - for type in types - let re = '\v^\s*'.type.'>' - if getline(lnum) =~# re - if !a:multiple - return [indent] - endif - if index(r, indent) == -1 - let r += [indent] - endif - " Remove any handled type, e.g. 'if'. - call remove(types, index(types, type)) + if getline(lnum) =~# re + if !a:multiple + return [indent] endif - endfor - let last_indent = indent(lnum) + if index(r, indent) == -1 + let r += [indent] + endif + let last_indent = indent + endif endif let lnum = prevnonblank(lnum - 1) endwhile @@ -205,8 +195,11 @@ function! s:indent_like_opening_paren(lnum) \ s:skip_after_opening_paren, paren_lnum, paren_col+1) let starts_with_closing_paren = getline(a:lnum) =~# '^\s*[])}]' + let hang_closing = get(b:, 'python_pep8_indent_hang_closing', + \ get(g:, 'python_pep8_indent_hang_closing', 0)) + if nothing_after_opening_paren - if starts_with_closing_paren + if starts_with_closing_paren && !hang_closing let res = base else let res = base + s:sw() @@ -220,10 +213,13 @@ function! s:indent_like_opening_paren(lnum) " indent further to distinguish the continuation line " from the next logical line. if text =~# b:control_statement && res == base + s:sw() - return base + s:sw() * 2 - else - return res + " But only if not inside parens itself (Flake's E127). + let [paren_lnum, _] = s:find_opening_paren(paren_lnum) + if paren_lnum <= 0 + return res + s:sw() + endif endif + return res endfunction " Match indent of first block of this type. @@ -337,11 +333,11 @@ endfunction " Is the syntax at lnum (and optionally cnum) a python string? function! s:is_python_string(lnum, ...) let line = getline(a:lnum) - let linelen = len(line) - if linelen < 1 - let linelen = 1 + if a:0 + let cols = type(a:1) != type([]) ? [a:1] : a:1 + else + let cols = range(1, max([1, len(line)])) endif - let cols = a:0 ? type(a:1) != type([]) ? [a:1] : a:1 : range(1, linelen) for cnum in cols if match(map(synstack(a:lnum, cnum), \ "synIDattr(v:val, 'name')"), 'python\S*String') == -1 @@ -361,7 +357,7 @@ function! GetPythonPEPIndent(lnum) let prevline = getline(a:lnum-1) " Multilinestrings: continous, docstring or starting. - if s:is_python_string(a:lnum-1, len(prevline)) + if s:is_python_string(a:lnum-1, max([1, len(prevline)])) \ && (s:is_python_string(a:lnum, 1) \ || match(line, '^\%("""\|''''''\)') != -1) @@ -379,8 +375,8 @@ function! GetPythonPEPIndent(lnum) endif if s:is_python_string(a:lnum-1) - " Previous line is (completely) a string. - return indent(a:lnum-1) + " Previous line is (completely) a string: keep current indent. + return -1 endif if match(prevline, '^\s*\%("""\|''''''\)') != -1 diff --git a/indent/dart.vim b/indent/dart.vim index 601abbb..8d685df 100644 --- a/indent/dart.vim +++ b/indent/dart.vim @@ -6,7 +6,7 @@ endif let b:did_indent = 1 setlocal cindent -setlocal cinoptions+=j1,J1 +setlocal cinoptions+=j1,J1,(2s,u2s,U1,m1,+2s setlocal indentexpr=DartIndent() diff --git a/indent/go.vim b/indent/go.vim index fd973e4..887fb58 100644 --- a/indent/go.vim +++ b/indent/go.vim @@ -26,17 +26,6 @@ if exists("*GoIndent") finish endif -" use shiftwidth function only if it's available -if exists('*shiftwidth') - func s:sw() - return shiftwidth() - endfunc -else - func s:sw() - return &sw - endfunc -endif - function! GoIndent(lnum) let prevlnum = prevnonblank(a:lnum-1) if prevlnum == 0 @@ -51,19 +40,23 @@ function! GoIndent(lnum) let ind = previ + if prevl =~ ' = `[^`]*$' + " previous line started a multi-line raw string + return 0 + endif if prevl =~ '[({]\s*$' " previous line opened a block - let ind += s:sw() + let ind += shiftwidth() endif if prevl =~# '^\s*\(case .*\|default\):$' " previous line is part of a switch statement - let ind += s:sw() + let ind += shiftwidth() endif " TODO: handle if the previous line is a label. if thisl =~ '^\s*[)}]' " this line closed a block - let ind -= s:sw() + let ind -= shiftwidth() endif " Colons are tricky. @@ -71,7 +64,7 @@ function! GoIndent(lnum) " We ignore trying to deal with jump labels because (a) they're rare, and " (b) they're hard to disambiguate from a composite literal key. if thisl =~# '^\s*\(case .*\|default\):$' - let ind -= s:sw() + let ind -= shiftwidth() endif return ind diff --git a/indent/julia.vim b/indent/julia.vim index 6382ec2..fd5557c 100644 --- a/indent/julia.vim +++ b/indent/julia.vim @@ -50,8 +50,9 @@ function GetJuliaNestingStruct(lnum, ...) let e = a:0 > 1 ? a:2 : -1 let blocks_stack = [] let num_closed_blocks = 0 + let tt = get(b:, 'julia_syntax_version', 10) == 6 ? '\|\%(\%(abstract\|primitive\)\s\+\)\@', s, e) + let fb = JuliaMatch(a:lnum, line, '@\@', s, e) let fe = JuliaMatch(a:lnum, line, '@\@', s, e) if fb < 0 && fe < 0 @@ -133,7 +134,7 @@ function GetJuliaNestingStruct(lnum, ...) continue endif - let i = JuliaMatch(a:lnum, line, '@\@', s) + let i = JuliaMatch(a:lnum, line, '@\@', s) if i >= 0 && i == fb if match(line, '\C\<\%(mutable\|abstract\|primitive\)', i) != -1 let s = i+11 diff --git a/indent/markdown.vim b/indent/markdown.vim index fa2b460..7ae4202 100644 --- a/indent/markdown.vim +++ b/indent/markdown.vim @@ -7,15 +7,15 @@ setlocal indentexpr=GetMarkdownIndent() setlocal nolisp setlocal autoindent -" Automatically insert bullets -setlocal formatoptions+=r -" Do not automatically insert bullets when auto-wrapping with text-width -setlocal formatoptions-=c -" Accept various markers as bullets -setlocal comments=b:*,b:+,b:- - " Automatically continue blockquote on line break -setlocal comments+=b:> +setlocal formatoptions+=r +setlocal comments=b:> +if get(g:, "vim_markdown_auto_insert_bullets", 1) + " Do not automatically insert bullets when auto-wrapping with text-width + setlocal formatoptions-=c + " Accept various markers as bullets + setlocal comments+=b:*,b:+,b:- +endif " Only define the function once if exists("*GetMarkdownIndent") | finish | endif diff --git a/indent/nix.vim b/indent/nix.vim index 2910cbd..b31ae42 100644 --- a/indent/nix.vim +++ b/indent/nix.vim @@ -11,7 +11,7 @@ endif let b:did_indent = 1 setlocal indentexpr=GetNixIndent() -setlocal indentkeys+=0=then,0=else,0=inherit,* +setlocal indentkeys+=0=then,0=else,0=inherit,0=in,* if exists("*GetNixIndent") finish @@ -21,8 +21,8 @@ let s:cpo_save = &cpo set cpo&vim let s:skip_syntax = '\%(Comment\|String\)$' -let s:binding_open = '\%(\\|{\)' -let s:binding_close = '\%(\\|}\)' +let s:binding_open = '\%(\\)' +let s:binding_close = '\%(\\)' let s:block_open = '\%({\|[\)' let s:block_close = '\%(}\|]\)' @@ -54,14 +54,6 @@ function! GetNixIndent() return indent(bslnum) endif - if last_line =~ ';$' - let bslnum = searchpair(s:binding_open, '', s:binding_close, 'bnW', - \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "StringSpecial$"') - if bslnum != 0 - let ind = indent(bslnum) + &sw - endif - endif - if last_line =~ s:block_open . '\s*$' let ind += &sw endif @@ -78,7 +70,7 @@ function! GetNixIndent() let ind += &sw endif - if getline(v:lnum - 1) =~ '^\': ['if', 'elif'], \ '^\s*except\>': ['try', 'except'], @@ -59,7 +63,7 @@ let s:stop_statement = '^\s*\(break\|continue\|raise\|return\|pass\)\>' " jedi* refers to syntax definitions from jedi-vim for call signatures, which " are inserted temporarily into the buffer. let s:skip_special_chars = 'synIDattr(synID(line("."), col("."), 0), "name") ' . - \ '=~? "\\vstring|comment|jedi\\S"' + \ '=~? "\\vstring|comment|^pythonbytes%(contents)=$|jedi\\S"' let s:skip_after_opening_paren = 'synIDattr(synID(line("."), col("."), 0), "name") ' . \ '=~? "\\vcomment|jedi\\S"' @@ -90,14 +94,6 @@ else endfunction endif -function! s:pair_sort(x, y) - if a:x[0] == a:y[0] - return a:x[1] == a:y[1] ? 0 : a:x[1] > a:y[1] ? 1 : -1 - else - return a:x[0] > a:y[0] ? 1 : -1 - endif -endfunction - " Find backwards the closest open parenthesis/bracket/brace. function! s:find_opening_paren(...) " optional arguments: line and column (defaults to 1) to search around @@ -144,27 +140,21 @@ endfunction " Find possible indent(s) of the block starter that matches the current line. function! s:find_start_of_block(lnum, types, multiple) let r = [] - let types = copy(a:types) let re = '\V\^\s\*\('.join(a:types, '\|').'\)\>' let lnum = a:lnum let last_indent = indent(lnum) + 1 while lnum > 0 && last_indent > 0 let indent = indent(lnum) if indent < last_indent - for type in types - let re = '\v^\s*'.type.'>' - if getline(lnum) =~# re - if !a:multiple - return [indent] - endif - if index(r, indent) == -1 - let r += [indent] - endif - " Remove any handled type, e.g. 'if'. - call remove(types, index(types, type)) + if getline(lnum) =~# re + if !a:multiple + return [indent] endif - endfor - let last_indent = indent(lnum) + if index(r, indent) == -1 + let r += [indent] + endif + let last_indent = indent + endif endif let lnum = prevnonblank(lnum - 1) endwhile @@ -205,8 +195,11 @@ function! s:indent_like_opening_paren(lnum) \ s:skip_after_opening_paren, paren_lnum, paren_col+1) let starts_with_closing_paren = getline(a:lnum) =~# '^\s*[])}]' + let hang_closing = get(b:, 'python_pep8_indent_hang_closing', + \ get(g:, 'python_pep8_indent_hang_closing', 0)) + if nothing_after_opening_paren - if starts_with_closing_paren + if starts_with_closing_paren && !hang_closing let res = base else let res = base + s:sw() @@ -220,10 +213,13 @@ function! s:indent_like_opening_paren(lnum) " indent further to distinguish the continuation line " from the next logical line. if text =~# b:control_statement && res == base + s:sw() - return base + s:sw() * 2 - else - return res + " But only if not inside parens itself (Flake's E127). + let [paren_lnum, _] = s:find_opening_paren(paren_lnum) + if paren_lnum <= 0 + return res + s:sw() + endif endif + return res endfunction " Match indent of first block of this type. @@ -337,11 +333,11 @@ endfunction " Is the syntax at lnum (and optionally cnum) a python string? function! s:is_python_string(lnum, ...) let line = getline(a:lnum) - let linelen = len(line) - if linelen < 1 - let linelen = 1 + if a:0 + let cols = type(a:1) != type([]) ? [a:1] : a:1 + else + let cols = range(1, max([1, len(line)])) endif - let cols = a:0 ? type(a:1) != type([]) ? [a:1] : a:1 : range(1, linelen) for cnum in cols if match(map(synstack(a:lnum, cnum), \ "synIDattr(v:val, 'name')"), 'python\S*String') == -1 @@ -361,7 +357,7 @@ function! GetPythonPEPIndent(lnum) let prevline = getline(a:lnum-1) " Multilinestrings: continous, docstring or starting. - if s:is_python_string(a:lnum-1, len(prevline)) + if s:is_python_string(a:lnum-1, max([1, len(prevline)])) \ && (s:is_python_string(a:lnum, 1) \ || match(line, '^\%("""\|''''''\)') != -1) @@ -379,8 +375,8 @@ function! GetPythonPEPIndent(lnum) endif if s:is_python_string(a:lnum-1) - " Previous line is (completely) a string. - return indent(a:lnum-1) + " Previous line is (completely) a string: keep current indent. + return -1 endif if match(prevline, '^\s*\%("""\|''''''\)') != -1 diff --git a/indent/ruby.vim b/indent/ruby.vim index 3617a92..78d10d7 100644 --- a/indent/ruby.vim +++ b/indent/ruby.vim @@ -69,7 +69,7 @@ let s:skip_expr = let s:ruby_indent_keywords = \ '^\s*\zs\<\%(module\|class\|if\|for' . \ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue' . - \ '\|\%(public\|protected\|private\)\=\s*def\):\@!\>' . + \ '\|\%(\K\k*[!?]\?\)\=\s*def\):\@!\>' . \ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' . \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' @@ -83,7 +83,7 @@ let s:ruby_deindent_keywords = let s:end_start_regex = \ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' . \ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' . - \ '\|\%(public\|protected\|private\)\=\s*def\):\@!\>' . + \ '\|\%(\K\k*[!?]\?\)\=\s*def\):\@!\>' . \ '\|\%(^\|[^.:@$]\)\@<=\' " Regex that defines the middle-match for the 'end' keyword. @@ -195,8 +195,29 @@ function! GetRubyIndent(...) abort " 2.3. Work on the previous line. {{{2 " ------------------------------- + + " Special case: we don't need the real s:PrevNonBlankNonString for an empty + " line inside a string. And that call can be quite expensive in that + " particular situation. let indent_callback_names = [ \ 's:EmptyInsideString', + \ ] + + for callback_name in indent_callback_names +" Decho "Running: ".callback_name + let indent = call(function(callback_name), [indent_info]) + + if indent >= 0 +" Decho "Match: ".callback_name." indent=".indent." info=".string(indent_info) + return indent + endif + endfor + + " Previous line number + let indent_info.plnum = s:PrevNonBlankNonString(indent_info.clnum - 1) + let indent_info.pline = getline(indent_info.plnum) + + let indent_callback_names = [ \ 's:StartOfFile', \ 's:AfterAccessModifier', \ 's:ContinuedLine', @@ -208,10 +229,6 @@ function! GetRubyIndent(...) abort \ 's:AfterIndentKeyword', \ ] - " Previous line number - let indent_info.plnum = s:PrevNonBlankNonString(indent_info.clnum - 1) - let indent_info.pline = getline(indent_info.plnum) - for callback_name in indent_callback_names " Decho "Running: ".callback_name let indent = call(function(callback_name), [indent_info]) @@ -389,12 +406,17 @@ function! s:LeadingOperator(cline_info) abort endfunction function! s:EmptyInsideString(pline_info) abort - " If the line is empty and inside a string (plnum would not be the real - " prevnonblank in that case), use the previous line's indent + " If the line is empty and inside a string (the previous line is a string, + " too), use the previous line's indent let info = a:pline_info - if info.cline =~ '^\s*$' && info.plnum != prevnonblank(info.clnum - 1) - return indent(prevnonblank(info.clnum)) + let plnum = prevnonblank(info.clnum - 1) + let pline = getline(plnum) + + if info.cline =~ '^\s*$' + \ && s:IsInStringOrComment(plnum, 1) + \ && s:IsInStringOrComment(plnum, strlen(pline)) + return indent(plnum) endif return -1 endfunction diff --git a/indent/rust.vim b/indent/rust.vim index fa4dfb5..abf8087 100644 --- a/indent/rust.vim +++ b/indent/rust.vim @@ -31,8 +31,10 @@ if exists("*GetRustIndent") finish endif +" vint: -ProhibitAbbreviationOption let s:save_cpo = &cpo set cpo&vim +" vint: +ProhibitAbbreviationOption " Come here when loading the script the first time. @@ -46,12 +48,12 @@ function! s:get_line_trimmed(lnum) " If the last character in the line is a comment, do a binary search for " the start of the comment. synID() is slow, a linear search would take " too long on a long line. - if synIDattr(synID(a:lnum, line_len, 1), "name") =~ 'Comment\|Todo' + if synIDattr(synID(a:lnum, line_len, 1), "name") =~? 'Comment\|Todo' let min = 1 let max = line_len while min < max let col = (min + max) / 2 - if synIDattr(synID(a:lnum, col, 1), "name") =~ 'Comment\|Todo' + if synIDattr(synID(a:lnum, col, 1), "name") =~? 'Comment\|Todo' let max = col else let min = col + 1 @@ -71,7 +73,7 @@ function! s:is_string_comment(lnum, col) if has('syntax_items') for id in synstack(a:lnum, a:col) let synname = synIDattr(id, "name") - if synname == "rustString" || synname =~ "^rustComment" + if synname ==# "rustString" || synname =~# "^rustComment" return 1 endif endfor @@ -90,13 +92,13 @@ function GetRustIndent(lnum) if has('syntax_items') let synname = synIDattr(synID(a:lnum, 1, 1), "name") - if synname == "rustString" + if synname ==# "rustString" " If the start of the line is in a string, don't change the indent return -1 - elseif synname =~ '\(Comment\|Todo\)' - \ && line !~ '^\s*/\*' " not /* opening line - if synname =~ "CommentML" " multi-line - if line !~ '^\s*\*' && getline(a:lnum - 1) =~ '^\s*/\*' + elseif synname =~? '\(Comment\|Todo\)' + \ && line !~# '^\s*/\*' " not /* opening line + if synname =~? "CommentML" " multi-line + if line !~# '^\s*\*' && getline(a:lnum - 1) =~# '^\s*/\*' " This is (hopefully) the line after a /*, and it has no " leader, so the correct indentation is that of the " previous line. @@ -123,22 +125,22 @@ function GetRustIndent(lnum) " Search backwards for the previous non-empty line. let prevlinenum = prevnonblank(a:lnum - 1) let prevline = s:get_line_trimmed(prevlinenum) - while prevlinenum > 1 && prevline !~ '[^[:blank:]]' + while prevlinenum > 1 && prevline !~# '[^[:blank:]]' let prevlinenum = prevnonblank(prevlinenum - 1) let prevline = s:get_line_trimmed(prevlinenum) endwhile " Handle where clauses nicely: subsequent values should line up nicely. - if prevline[len(prevline) - 1] == "," + if prevline[len(prevline) - 1] ==# "," \ && prevline =~# '^\s*where\s' return indent(prevlinenum) + 6 endif - if prevline[len(prevline) - 1] == "," - \ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]' - \ && prevline !~ '^\s*fn\s' - \ && prevline !~ '([^()]\+,$' - \ && s:get_line_trimmed(a:lnum) !~ '^\s*\S\+\s*=>' + if prevline[len(prevline) - 1] ==# "," + \ && s:get_line_trimmed(a:lnum) !~# '^\s*[\[\]{}]' + \ && prevline !~# '^\s*fn\s' + \ && prevline !~# '([^()]\+,$' + \ && s:get_line_trimmed(a:lnum) !~# '^\s*\S\+\s*=>' " Oh ho! The previous line ended in a comma! I bet cindent will try to " take this too far... For now, let's normally use the previous line's " indent. @@ -197,7 +199,7 @@ function GetRustIndent(lnum) else " At the module scope, inside square brackets only "if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum - if line =~ "^\\s*]" + if line =~# "^\\s*]" " It's the closing line, dedent it return 0 else @@ -211,8 +213,10 @@ function GetRustIndent(lnum) return cindent(a:lnum) endfunction +" vint: -ProhibitAbbreviationOption let &cpo = s:save_cpo unlet s:save_cpo +" vint: +ProhibitAbbreviationOption " vim: set et sw=4 sts=4 ts=8: diff --git a/syntax/Jenkinsfile.vim b/syntax/Jenkinsfile.vim index efd00a4..e034676 100644 --- a/syntax/Jenkinsfile.vim +++ b/syntax/Jenkinsfile.vim @@ -5,11 +5,11 @@ syn keyword jenkinsfileBuiltInVariable currentBuild syn keyword jenkinsfileSection pipeline agent stages steps -syn keyword jenkinsfileDirective environment options parameters triggers stage tools input when +syn keyword jenkinsfileDirective environment options parameters triggers stage tools input when libraries syn keyword jenkinsfileOption contained buildDiscarder disableConcurrentBuilds overrideIndexTriggers skipDefaultCheckout nextgroup=jenkinsfileOptionParams syn keyword jenkinsfileOption contained skipStagesAfterUnstable checkoutToSubdirectory timeout retry timestamps nextgroup=jenkinsfileOptionParams -syn region jenkinsfileOptionParams contained start="(" end=")" transparent contains=@groovyTop +syn region jenkinsfileOptionParams contained start='(' end=')' transparent contains=@groovyTop syn match jenkinsfileOptionO /[a-zA-Z]\+([^)]*)/ contains=jenkinsfileOption,jenkinsfileOptionParams transparent containedin=groovyParenT1 syn keyword jenkinsfileCoreStep checkout @@ -24,9 +24,9 @@ syn keyword jenkinsfileCoreStep step syn keyword jenkinsfileCoreStep tool " TODO: These should probably be broken out. -syn keyword jenkinsfileCoreStep post always changed failure success unstable aborted +syn keyword jenkinsfileCoreStep post always changed failure success unstable aborted -syn region jenkinsFileDockerConfigBlock contained start="{" end="}" contains=groovyString,jenkinsfileDockerKeyword transparent +syn region jenkinsFileDockerConfigBlock contained start='{' end='}' contains=groovyString,jenkinsfileDockerKeyword transparent syn keyword jenkinsFileDockerKeyword contained image args dockerfile additionalBuildArgs syn keyword jenkinsfilePipelineStep Applitools ArtifactoryGradleBuild Consul MavenDescriptorStep OneSky VersionNumber @@ -123,6 +123,8 @@ hi link jenkinsfilePipelineStep Include hi link jenkinsfileBuiltInVariable Identifier hi link jenkinsFileDockerKeyword jenkinsfilePipelineStep -let b:current_syntax = "Jenkinsfile" +let b:current_syntax = 'Jenkinsfile' + +" vim:set et sw=0 ts=2 ft=vim tw=78: endif diff --git a/syntax/carp.vim b/syntax/carp.vim index a3a86ad..6d3ae6d 100644 --- a/syntax/carp.vim +++ b/syntax/carp.vim @@ -19,7 +19,7 @@ else endif syn keyword carpSyntax def defn let do if while ref address set! the -syn keyword carpSyntax defmacro defdynamic quote cons list array +syn keyword carpSyntax defmacro defdynamic quote cons list array fn syn keyword carpSyntax expand deftype register system-include register-type syn keyword carpSyntax defmodule copy use module defalias definterface eval syn keyword carpSyntax expand instantiate type info help quit env build run @@ -64,6 +64,7 @@ syn cluster carpQuotedOrNormal contains=carpDelimiter syn region carpQuotedStruc start="@("rs=s+2 end=")"re=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal contained syn region carpQuotedStruc start="&("rs=s+2 end=")"re=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal contained syn region carpQuotedStruc start="("rs=s+1 end=")"re=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal contained +syn region carpQuotedStruc start="{"rs=s+1 end="}"re=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal contained syn region carpQuotedStruc start="\["rs=s+1 end="\]"re=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal contained syn cluster carpQuotedStuff add=carpQuotedStruc @@ -73,6 +74,7 @@ syn region carpStruc matchgroup=Delimiter start="&("rs=s+2 matchgroup=Delimiter syn region carpStruc matchgroup=Delimiter start="&"rs=s+1 end=![ \t()\[\]";]!me=e-1 contains=@carpNormal syn region carpStruc matchgroup=Delimiter start="@"rs=s+1 end=![ \t()\[\]";]!me=e-1 contains=@carpNormal syn region carpStruc matchgroup=Delimiter start="("rs=s+1 matchgroup=Delimiter end=")"re=e-1 contains=@carpNormal +syn region carpStruc matchgroup=Delimiter start="{"rs=s+1 matchgroup=Delimiter end="}"re=e-1 contains=@carpNormal syn region carpStruc matchgroup=Delimiter start="\["rs=s+1 matchgroup=Delimiter end="\]"re=e-1 contains=@carpNormal syn region carpString start=/\%(\\\)\@\|<=\|\%(<\|\>\|>=\|=\@\|\*\*\|\.\.\.\|\.\.\|::" - syn match crystalOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=" + syn match crystalOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=\|//" syn region crystalBracketOperator matchgroup=crystalOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@crystalNotTop endif @@ -31,11 +31,11 @@ endif syn match crystalStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display syn match crystalStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display -syn region crystalInterpolation matchgroup=crystalInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@crystalNotTop -syn match crystalInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=crystalInterpolationDelimiter,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable,crystalPredefinedVariable -syn match crystalInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained -syn match crystalInterpolation "#\$\%(-\w\|\W\)" display contained contains=crystalInterpolationDelimiter,crystalPredefinedVariable,crystalInvalidVariable -syn match crystalInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained +syn region crystalInterpolation matchgroup=crystalInterpolationDelim start="#{" end="}" contained contains=ALLBUT,@crystalNotTop +syn match crystalInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=crystalInterpolationDelim,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable,crystalPredefinedVariable +syn match crystalInterpolationDelim "#\ze\%(\$\|@@\=\)\w\+" display contained +syn match crystalInterpolation "#\$\%(-\w\|\W\)" display contained contains=crystalInterpolationDelim,crystalPredefinedVariable,crystalInvalidVariable +syn match crystalInterpolationDelim "#\ze\$\%(-\w\|\W\)" display contained syn region crystalNoInterpolation start="\\#{" end="}" contained syn match crystalNoInterpolation "\\#{" display contained syn match crystalNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained @@ -232,11 +232,13 @@ if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive') syn region crystalArrayLiteral matchgroup=crystalArrayDelimiter start="\%(\w\|[\]})]\)\@" end="\" contains=ALLBUT,@crystalNotTop fold - syn region crystalCaseExpression matchgroup=crystalConditional start="\" end="\" contains=ALLBUT,@crystalNotTop fold + syn region crystalBlockExpression matchgroup=crystalControl start="\" end="\" contains=ALLBUT,@crystalNotTop fold + syn region crystalCaseExpression matchgroup=crystalConditional start="\" end="\" contains=ALLBUT,@crystalNotTop fold + syn region crystalSelectExpression matchgroup=crystalConditional start="\" end="\" contains=ALLBUT,@crystalNotTop fold syn region crystalConditionalExpression matchgroup=crystalConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" end="\%(\%(\%(\.\@" contains=ALLBUT,@crystalNotTop fold - syn match crystalConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=crystalCaseExpression + syn match crystalConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=crystalCaseExpression + syn match crystalConditional "\<\%(when\|else\)\>[?!]\@!" contained containedin=crystalSelectExpression syn match crystalConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=crystalConditionalExpression syn match crystalExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=crystalBlockExpression @@ -313,78 +315,73 @@ syn match crystalKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE syn match crystalKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE -hi def link crystalClass crystalDefine -hi def link crystalModule crystalDefine -hi def link crystalStruct crystalDefine +hi def link crystalClass crystalDefine +hi def link crystalModule crystalDefine +hi def link crystalStruct crystalDefine hi def link crystalLib crystalDefine -hi def link crystalMacro crystalDefine +hi def link crystalMacro crystalDefine hi def link crystalEnum crystalDefine hi def link crystalMethodExceptional crystalDefine -hi def link crystalDefine Define +hi def link crystalDefine Define hi def link crystalFunction Function hi def link crystalConditional Conditional hi def link crystalConditionalModifier crystalConditional hi def link crystalExceptional crystalConditional -hi def link crystalRepeat Repeat -hi def link crystalRepeatModifier crystalRepeat +hi def link crystalRepeat Repeat +hi def link crystalRepeatModifier crystalRepeat hi def link crystalOptionalDo crystalRepeat -hi def link crystalControl Statement -hi def link crystalInclude Include -hi def link crystalRecord Statement -hi def link crystalInteger Number +hi def link crystalControl Statement +hi def link crystalInclude Include +hi def link crystalRecord Statement +hi def link crystalInteger Number hi def link crystalASCIICode Character -hi def link crystalFloat Float -hi def link crystalBoolean Boolean +hi def link crystalFloat Float +hi def link crystalBoolean Boolean hi def link crystalException Exception if !exists('g:crystal_no_identifiers') hi def link crystalIdentifier Identifier else hi def link crystalIdentifier NONE endif -hi def link crystalClassVariable crystalIdentifier +hi def link crystalClassVariable crystalIdentifier hi def link crystalConstant Type -hi def link crystalGlobalVariable crystalIdentifier -hi def link crystalBlockParameter crystalIdentifier +hi def link crystalGlobalVariable crystalIdentifier +hi def link crystalBlockParameter crystalIdentifier hi def link crystalInstanceVariable crystalIdentifier hi def link crystalFreshVariable crystalIdentifier hi def link crystalPredefinedIdentifier crystalIdentifier hi def link crystalPredefinedConstant crystalPredefinedIdentifier hi def link crystalPredefinedVariable crystalPredefinedIdentifier -hi def link crystalSymbol Constant -hi def link crystalKeyword Keyword +hi def link crystalSymbol Constant +hi def link crystalKeyword Keyword hi def link crystalOperator Operator -hi def link crystalAccess Statement +hi def link crystalAccess Statement hi def link crystalAttribute Statement -hi def link crystalPseudoVariable Constant +hi def link crystalPseudoVariable Constant hi def link crystalCharLiteral Character - -hi def link crystalComment Comment +hi def link crystalComment Comment hi def link crystalTodo Todo - hi def link crystalStringEscape Special -hi def link crystalInterpolationDelimiter Delimiter -hi def link crystalNoInterpolation crystalString +hi def link crystalInterpolationDelim Delimiter +hi def link crystalNoInterpolation crystalString hi def link crystalSharpBang PreProc -hi def link crystalRegexpDelimiter crystalStringDelimiter -hi def link crystalSymbolDelimiter crystalStringDelimiter -hi def link crystalStringDelimiter Delimiter -hi def link crystalHeredoc crystalString -hi def link crystalString String +hi def link crystalRegexpDelimiter crystalStringDelimiter +hi def link crystalSymbolDelimiter crystalStringDelimiter +hi def link crystalStringDelimiter Delimiter +hi def link crystalString String +hi def link crystalHeredoc crystalString hi def link crystalRegexpEscape crystalRegexpSpecial hi def link crystalRegexpQuantifier crystalRegexpSpecial hi def link crystalRegexpAnchor crystalRegexpSpecial hi def link crystalRegexpDot crystalRegexpCharClass -hi def link crystalRegexpCharClass crystalRegexpSpecial -hi def link crystalRegexpSpecial Special -hi def link crystalRegexpComment Comment -hi def link crystalRegexp crystalString - -hi def link crystalLinkAttr PreProc - +hi def link crystalRegexpCharClass crystalRegexpSpecial +hi def link crystalRegexpSpecial Special +hi def link crystalRegexpComment Comment +hi def link crystalRegexp crystalString hi def link crystalMacro PreProc - -hi def link crystalInvalidVariable Error -hi def link crystalError Error +hi def link crystalLinkAttr crystalMacro +hi def link crystalError Error +hi def link crystalInvalidVariable crystalError hi def link crystalSpaceError crystalError let b:current_syntax = 'crystal' diff --git a/syntax/gitcommit.vim b/syntax/gitcommit.vim index 8746a75..1a1c360 100644 --- a/syntax/gitcommit.vim +++ b/syntax/gitcommit.vim @@ -20,7 +20,7 @@ endif syn include @gitcommitDiff syntax/diff.vim syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|#\)\@=/ fold contains=@gitcommitDiff -syn match gitcommitSummary "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell +syn match gitcommitSummary ".*\%<50v" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell syn match gitcommitOverflow ".*" contained contains=@Spell syn match gitcommitBlank "^[^#].*" contained contains=@Spell diff --git a/syntax/go.vim b/syntax/go.vim index c3c26ed..b5bd13e 100644 --- a/syntax/go.vim +++ b/syntax/go.vim @@ -49,12 +49,12 @@ hi def link goFloats Type hi def link goComplexes Type " Predefined functions and values -syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/ -syn match goBuiltins /\<\v(make|new|panic|print|println|real|recover)\ze\(/ +syn keyword goBuiltins append cap close complex copy delete imag len +syn keyword goBuiltins make new panic print println real recover syn keyword goBoolean true false syn keyword goPredefinedIdentifiers nil iota -hi def link goBuiltins Keyword +hi def link goBuiltins Identifier hi def link goBoolean Boolean hi def link goPredefinedIdentifiers goBoolean @@ -150,14 +150,14 @@ endif " var, const if go#config#FoldEnable('varconst') syn region goVar start='var (' end='^\s*)$' transparent fold - \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments + \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator syn region goConst start='const (' end='^\s*)$' transparent fold - \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments + \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator else syn region goVar start='var (' end='^\s*)$' transparent - \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments + \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator syn region goConst start='const (' end='^\s*)$' transparent - \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments + \ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar,goArgumentName,goArgumentType,goSimpleArguments,goPointerOperator endif " Single-line var, const, and import. @@ -216,6 +216,7 @@ endif " Extra types commonly seen if go#config#HighlightExtraTypes() syn match goExtraType /\/ + syn match goExtraType /\/ syn match goExtraType /\/ syn match goExtraType /\/ syn match goExtraType /\/ diff --git a/syntax/gomod.vim b/syntax/gomod.vim new file mode 100644 index 0000000..51cdfb7 --- /dev/null +++ b/syntax/gomod.vim @@ -0,0 +1,50 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 + +" gomod.vim: Vim syntax file for go.mod file +" +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +syntax case match + +" match keywords +syntax keyword gomodModule module +syntax keyword gomodRequire require +syntax keyword gomodExclude exclude +syntax keyword gomodReplace replace + +" require, exclude and replace can be also grouped into block +syntax region gomodRequire start='require (' end=')' transparent contains=gomodRequire,gomodVersion +syntax region gomodExclude start='exclude (' end=')' transparent contains=gomodExclude,gomodVersion +syntax region gomodReplace start='replace (' end=')' transparent contains=gomodReplace,gomodVersion + +" set highlights +highlight default link gomodModule Keyword +highlight default link gomodRequire Keyword +highlight default link gomodExclude Keyword +highlight default link gomodReplace Keyword + +" comments are always in form of // ... +syntax region gomodComment start="//" end="$" contains=@Spell +highlight default link gomodComment Comment + +" make sure quoted import paths are higlighted +syntax region gomodString start=+"+ skip=+\\\\\|\\"+ end=+"+ +highlight default link gomodString String + +" replace operator is in the form of '=>' +syntax match gomodReplaceOperator "\v\=\>" +highlight default link gomodReplaceOperator Operator + + +" highlight semver, note that this is very simple. But it works for now +syntax match gomodVersion "v\d\+\.\d\+\.\d\+" +syntax match gomodVersion "v\d\+\.\d\+\.\d\+-\S*" +syntax match gomodVersion "v\d\+\.\d\+\.\d\++incompatible" +highlight default link gomodVersion Identifier + +let b:current_syntax = "gomod" + +endif diff --git a/syntax/javascript.vim b/syntax/javascript.vim index d1480e7..621f5da 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -53,7 +53,7 @@ syntax keyword jsFrom contained from skipwhite skipempty nextgroup syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAsterisk,jsModuleGroup,jsFlowTypeKeyword " Strings, Templates, Numbers -syntax region jsString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend +syntax region jsString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ end=+$+ contains=jsSpecial,@Spell extend syntax region jsTemplateString start=+`+ skip=+\\`+ end=+`+ contains=jsTemplateExpression,jsSpecial,@Spell extend syntax match jsTaggedTemplate /\<\K\k*\ze`/ nextgroup=jsTemplateString syntax match jsNumber /\c\<\%(\d\+\%(e[+-]\=\d\+\)\=\|0b[01]\+\|0o\o\+\|0x\x\+\)\>/ @@ -150,8 +150,8 @@ syntax region jsTryCatchBlock contained matchgroup=jsTryCatchBraces s syntax region jsFinallyBlock contained matchgroup=jsFinallyBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock,jsSwitchCase extend fold syntax region jsRepeatBlock contained matchgroup=jsRepeatBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold -syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression,jsComment extend fold -syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression,jsDestructuringBlock,jsDestructuringArray,jsComment extend fold +syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression,jsComment nextgroup=jsFlowDefinition extend fold +syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression,jsDestructuringBlock,jsDestructuringArray,jsComment nextgroup=jsFlowDefinition extend fold syntax region jsObject contained matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectShorthandProp,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsDecorator,jsAsyncKeyword extend fold syntax region jsBlock matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsSpreadExpression extend fold syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment,jsFlowTypeKeyword skipwhite skipempty nextgroup=jsFrom fold diff --git a/syntax/julia.vim b/syntax/julia.vim index 8d7d7b4..585aa05 100644 --- a/syntax/julia.vim +++ b/syntax/julia.vim @@ -32,15 +32,15 @@ if !exists("b:julia_syntax_highlight_deprecated") let b:julia_syntax_highlight_deprecated = get(g:, "julia_syntax_highlight_deprecated", 0) endif -if b:julia_syntax_version =~? '\<\%(curr\%(ent\)\?\|release\|6\|0\.6\)\>' +if b:julia_syntax_version =~? '\<\%(curr\%(ent\)\?\|release\|7\|0\.7\|10\|1.0\)\>' + let b:julia_syntax_version = 10 +elseif b:julia_syntax_version =~? '\<\%(next\|devel\|11\|1\.1\)\>' + let b:julia_syntax_version = 11 +elseif b:julia_syntax_version =~? '\<\%(prev\%(ious\)\?\|legacy\|6\|0\.6\)\>' let b:julia_syntax_version = 6 -elseif b:julia_syntax_version =~? '\<\%(next\|devel\|7\|0\.7\)\>' - let b:julia_syntax_version = 7 -elseif b:julia_syntax_version =~? '\<\%(prev\%(ious\)\?\|legacy\|5\|0\.5\)\>' - let b:julia_syntax_version = 5 else echohl WarningMsg | echomsg "Unrecognized or unsupported julia syntax version: " . b:julia_syntax_version | echohl None - let b:julia_syntax_version = 6 + let b:julia_syntax_version = 10 endif let s:julia_spellcheck_strings = get(g:, "julia_spellcheck_strings", 0) @@ -96,39 +96,29 @@ syntax cluster juliaExprsPrintf contains=@juliaExpressions,@juliaPrintfItems syntax cluster juliaParItems contains=juliaParBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar syntax cluster juliaKeywordItems contains=juliaKeyword,juliaInfixKeyword,juliaRepKeyword,juliaTypedef -if b:julia_syntax_version == 5 - syntax cluster juliaBlocksItems contains=@juliaBlocksItemsAll +syntax cluster juliaBlocksItems contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock +if b:julia_syntax_version == 6 + syntax cluster juliaTypesItems contains=@juliaTypesItemsAll,@juliaTypesItems06 else - syntax cluster juliaBlocksItems contains=@juliaBlocksItemsAll,@juliaBlocksItems0607 -endif -syntax cluster juliaBlocksItemsAll contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock -syntax cluster juliaBlocksItems0607 contains=juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock -if b:julia_syntax_version == 5 - syntax cluster juliaTypesItems contains=@juliaTypesItemsAll,@juliaTypesItems05,@juliaTypesItems0506 -elseif b:julia_syntax_version == 6 - syntax cluster juliaTypesItems contains=@juliaTypesItemsAll,@juliaTypesItems05,@juliaTypesItems0506,@juliaTypesItems0607 -else - syntax cluster juliaTypesItems contains=@juliaTypesItemsAll,@juliaTypesItems05,@juliaTypesItems0506,@juliaTypesItems0607,@juliaTypesItems07 + syntax cluster juliaTypesItems contains=@juliaTypesItemsAll,@juliaTypesItems06,@juliaTypesItems1011 endif syntax cluster juliaTypesItemsAll contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther -syntax cluster juliaTypesItems05 contains=juliaBaseTypeIter05,juliaBaseTypeRange05 -syntax cluster juliaTypesItems0506 contains=juliaBaseTypeNum0506,juliaBaseTypeRange0506,juliaBaseTypeDict0506,juliaBaseTypeSet0506 -syntax cluster juliaTypesItems0607 contains=juliaBaseTypeBasic0607,juliaBaseTypeArray0607,juliaBaseTypeSet0607,juliaBaseTypeProcess0607,juliaBaseTypeRange0607,juliaBaseTypeTime0607 -syntax cluster juliaTypesItems07 contains=juliaBaseTypeBasic07,juliaBaseTypeNum07,juliaBaseTypeError07,juliaBaseTypeIter07,juliaBaseTypeRange07,juliaBaseTypeArray07,juliaBaseTypeDict07,juliaBaseTypeSet07,juliaBaseTypeC07,juliaBaseTypeDisplay07,juliaBaseTypeIO07 +syntax cluster juliaTypesItems06 contains=juliaBaseTypeNum06,juliaBaseTypeRange06,juliaBaseTypeDict06,juliaBaseTypeSet06 +syntax cluster juliaTypesItems1011 contains=juliaBaseTypeBasic1011,juliaBaseTypeNum1011,juliaBaseTypeError1011,juliaBaseTypeIter1011,juliaBaseTypeRange1011,juliaBaseTypeArray1011,juliaBaseTypeDict1011,juliaBaseTypeSet1011,juliaBaseTypeC1011,juliaBaseTypeDisplay1011,juliaBaseTypeIO1011,juliaBaseTypeString1011 syntax cluster juliaConstItemsAll contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric -syntax cluster juliaConstItems0506 contains=juliaConstNum0506,juliaConstIO0506 -syntax cluster juliaConstItems07 contains=juliaConstGeneric07,juliaPossibleEuler,juliaConstEnv07,juliaConstIO07 -if b:julia_syntax_version <= 6 - syntax cluster juliaConstItems contains=@juliaConstItemsAll,@juliaConstItems0506 +syntax cluster juliaConstItems06 contains=juliaConstNum06,juliaConstIO06 +syntax cluster juliaConstItems1011 contains=juliaConstGeneric1011,juliaPossibleEuler,juliaConstEnv1011,juliaConstIO1011 +if b:julia_syntax_version == 6 + syntax cluster juliaConstItems contains=@juliaConstItemsAll,@juliaConstItems06 else - syntax cluster juliaConstItems contains=@juliaConstItemsAll,@juliaConstItems0506,@juliaConstItems07 + syntax cluster juliaConstItems contains=@juliaConstItemsAll,@juliaConstItems06,@juliaConstItems1011 endif syntax cluster juliaMacroItems contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra syntax cluster juliaSymbolItems contains=juliaPossibleSymbol syntax cluster juliaNumberItems contains=juliaNumbers -syntax cluster juliaStringItems contains=juliaChar,juliaString,juliabString,juliasString,juliavString,juliaipString,juliabigString,juliaMIMEString,juliaShellString,juliaDocString,juliaRegEx +syntax cluster juliaStringItems contains=juliaChar,juliaString,juliaStringPrefixed,juliabString,juliasString,juliavString,juliaipString,juliabigString,juliaMIMEString,juliarawString,juliatextString,juliahtmlString,juliaint128String,juliaShellString,juliaDocString,juliaRegEx syntax cluster juliaPrintfItems contains=juliaPrintfParBlock,juliaPrintfString syntax cluster juliaOperatorItems contains=juliaOperator,juliaRangeOperator,juliaCTransOperator,juliaTernaryRegion,juliaColon,juliaSemicolon,juliaComma syntax cluster juliaCommentItems contains=juliaCommentL,juliaCommentM @@ -166,16 +156,8 @@ syntax region juliaParBlockInRange matchgroup=juliaParDelim contained start="(" syntax region juliaSqBraBlock matchgroup=juliaParDelim start="\[" end="\]" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeEnd,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS syntax region juliaCurBraBlock matchgroup=juliaParDelim start="{" end="}" contains=@juliaExpressions -if b:julia_syntax_version >= 6 - let s:keywords = '\<\%(return\|local\|global\|import\%(all\)\?\|export\|using\|const\|where\)\>' - let s:infixkeywords = '\<\%(in\|isa\)\>' -else - let s:keywords = '\<\%(return\|local\|global\|import\%(all\)\?\|export\|using\|const\)\>' - let s:infixkeywords = '\<\%(in\)\>' -endif - -exec 'syntax match juliaKeyword display "' . s:keywords . '"' -exec 'syntax match juliaInfixKeyword display "\%(=\s*\)\@" +syntax match juliaInfixKeyword display "\%(=\s*\)\@\S\@!\%(\s*=\)\@!" syntax match juliaRepKeyword display "\<\%(break\|continue\)\>" syntax region juliaConditionalBlock matchgroup=juliaConditional start="\" end="\" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold syntax region juliaConditionalEIBlock matchgroup=juliaConditional transparent contained start="\" end="\<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock @@ -186,8 +168,10 @@ syntax region juliaBeginBlock matchgroup=juliaBlKeyword start="\" end= syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold -syntax region juliaTypeBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold -syntax region juliaImmutableBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold +if b:julia_syntax_version <= 10 + syntax region juliaTypeBlock matchgroup=juliaBlKeyword06 start="\" end="\" contains=@juliaExpressions fold + syntax region juliaImmutableBlock matchgroup=juliaBlKeyword06 start="\" end="\" contains=@juliaExpressions fold +endif syntax region juliaStructBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold syntax region juliaLetBlock matchgroup=juliaBlKeyword start="\" end="\" contains=@juliaExpressions fold @@ -206,39 +190,34 @@ syntax match juliaComprehensionIf contained "\" exec 'syntax match juliaOuter contained "\"' -syntax match juliaBaseTypeBasic display "\<\%(Tuple\|NTuple\|Symbol\|\%(Intrinsic\)\?Function\|Union\|Type\%(Name\|Constructor\|Var\)\?\|Any\|ANY\|Vararg\|Top\|None\|Nothing\|Ptr\|Void\|Exception\|Module\|Box\|Expr\|LambdaStaticData\|\%(Data\|Union\)Type\|\%(LineNumber\|Label\|Goto\|Quote\|Top\|Symbol\|Getfield\)Node\|\%(Weak\|Global\)\?Ref\|Associative\|Method\(Table\)\?\|GetfieldNode\|Nullable\|Pair\|Val\|TypeMap\%(Level\|Entry\)\)\>" -syntax match juliaBaseTypeBasic0607 display "\<\%(UnionAll\|CodeInfo\)\>" -syntax match juliaBaseTypeBasic07 display "\<\%(Some\|Missing\)\>" +syntax match juliaBaseTypeBasic display "\<\%(Tuple\|NTuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\)\>" +syntax match juliaBaseTypeBasic06 display "\<\%(Void\|\%(Label\|Goto\)Node\|Associative\|MethodTable\|Nullable\|TypeMap\%(Level\|Entry\)\|CodeInfo\)\>" +syntax match juliaBaseTypeBasic1011 display "\<\%(Nothing\|Some\|Missing\)\>" syntax match juliaBaseTypeNum display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|Irrational\|Enum\|BigInt\|BigFloat\|MathConst\)\>" -syntax match juliaBaseTypeNum0506 display "\" -syntax match juliaBaseTypeNum07 display "\<\%(AbstractIrrational\|ComplexF\%(16\|32\|64\)\)\>" +syntax match juliaBaseTypeNum06 display "\" +syntax match juliaBaseTypeNum1011 display "\<\%(AbstractIrrational\|ComplexF\%(16\|32\|64\)\)\>" syntax match juliaBaseTypeC display "\<\%(FileOffset\|C\%(u\?\%(char\|short\|int\|long\(long\)\?\|w\?string\)\|float\|double\|\%(ptrdiff\|s\?size\|wchar\|off\|u\?intmax\)_t\)\)\>" -syntax match juliaBaseTypeC07 display "\" +syntax match juliaBaseTypeC1011 display "\" syntax match juliaBaseTypeError display "\<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Argument\|Key\|Load\|Method\|Inexact\|OutOfMemory\|Init\|Assertion\|Unicode\|ReadOnlyMemory\)Error\|\%(Interrupt\|Error\|ProcessExited\|Captured\|Composite\|InvalidState\|Null\|Remote\)Exception\|DimensionMismatch\|SegmentationFault\)\>" -syntax match juliaBaseTypeError07 display "\<\%(StringIndexError\|MissingException\)\>" +syntax match juliaBaseTypeError1011 display "\<\%(StringIndexError\|MissingException\)\>" syntax match juliaBaseTypeIter display "\<\%(EachLine\|Enumerate\|Cartesian\%(Index\|Range\)\|LinSpace\)\>" -syntax match juliaBaseTypeIter05 display "\<\%(Zip\|Filter\)\>" -syntax match juliaBaseTypeIter07 display "\" +syntax match juliaBaseTypeIter1011 display "\" syntax match juliaBaseTypeString display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\)\?String\>" -syntax match juliaBaseTypeArray display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|SparseVector\|VecElement\)\>" -syntax match juliaBaseTypeArray0607 display "\<\%(Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|RowVector\)\>" -syntax match juliaBaseTypeArray07 display "\<\%(BroadcastStyle\|Adjoint\|Transpose\|LinearIndices\)\>" +syntax match juliaBaseTypeString1011 display "\" +syntax match juliaBaseTypeArray display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|SparseVector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|RowVector\)\>" +syntax match juliaBaseTypeArray1011 display "\<\%(Broadcast\|Adjoint\|Transpose\|LinearIndices\)\>" syntax match juliaBaseTypeDict display "\<\%(WeakKey\)\?Dict\>" -syntax match juliaBaseTypeDict0506 display "\" -syntax match juliaBaseTypeDict07 display "\" -syntax match juliaBaseTypeSet display "\" -syntax match juliaBaseTypeSet0506 display "\" -syntax match juliaBaseTypeSet0607 display "\" -syntax match juliaBaseTypeSet07 display "\<\%(\%(Bit\|Key\)Set\|AbstractDict\)\>" +syntax match juliaBaseTypeDict06 display "\" +syntax match juliaBaseTypeDict1011 display "\" +syntax match juliaBaseTypeSet display "\<\%(Set\|AbstractSet\)\>" +syntax match juliaBaseTypeSet06 display "\" +syntax match juliaBaseTypeSet1011 display "\<\%(BitSet\|AbstractDict\)\>" syntax match juliaBaseTypeIO display "\<\%(IO\%(Stream\|Buffer\|Context\)\?\|RawFD\|StatStruct\|FileMonitor\|PollingFileWatcher\|Timer\|Base64\%(Decode\|Encode\)Pipe\|\%(UDP\|TCP\)Socket\|\%(Abstract\)\?Channel\|BufferStream\|ReentrantLock\)\>" -syntax match juliaBaseTypeIO07 display "\" -syntax match juliaBaseTypeProcess display "\<\%(ProcessGroup\|Pipe\|Cmd\)\>" -syntax match juliaBaseTypeProcess0607 display "\" -syntax match juliaBaseTypeRange display "\<\%(Dims\|RangeIndex\|\%(Ordinal\|Step\|\%(Abstract\)\?Unit\)Range\|Colon\)\>" -syntax match juliaBaseTypeRange05 display "\" -syntax match juliaBaseTypeRange0506 display "\" -syntax match juliaBaseTypeRange0607 display "\<\%(ExponentialBackOff\|StepRangeLen\)\>" -syntax match juliaBaseTypeRange07 display "\<\(Abstract\|Lin\)Range\>" +syntax match juliaBaseTypeIO1011 display "\" +syntax match juliaBaseTypeProcess display "\<\%(Pipe\|Cmd\|PipeBuffer\)\>" +syntax match juliaBaseTypeRange display "\<\%(Dims\|RangeIndex\|\%(Ordinal\|Step\|\%(Abstract\)\?Unit\)Range\|Colon\|ExponentialBackOff\|StepRangeLen\)\>" +syntax match juliaBaseTypeRange06 display "\" +syntax match juliaBaseTypeRange1011 display "\<\(Abstract\|Lin\)Range\>" syntax match juliaBaseTypeRegex display "\" syntax match juliaBaseTypeFact display "\" syntax match juliaBaseTypeSort display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>" @@ -246,13 +225,12 @@ syntax match juliaBaseTypeRound display "\" syntax match juliaBaseTypeRandom display "\<\%(AbstractRNG\|MersenneTwister\|RandomDevice\)\>" syntax match juliaBaseTypeDisplay display "\<\%(Text\(Display\)\?\|Display\|MIME\|HTML\)\>" -syntax match juliaBaseTypeDisplay07 display "\" -syntax match juliaBaseTypeTime display "\<\%(Date\%(Time\)\?\)\>" -syntax match juliaBaseTypeTime0607 display "\" +syntax match juliaBaseTypeDisplay1011 display "\" +syntax match juliaBaseTypeTime display "\<\%(Date\%(Time\)\?\|DateFormat\)\>" syntax match juliaBaseTypeOther display "\<\%(RemoteRef\|Task\|Condition\|VersionNumber\|IPv[46]\|SerializationState\|WorkerConfig\|Future\|RemoteChannel\|IPAddr\|Stack\%(Trace\|Frame\)\|\(Caching\|Worker\)Pool\|AbstractSerializer\)\>" syntax match juliaConstNum display "\%(\<\%(\%(NaN\|Inf\)\%(16\|32\|64\)\?\|pi\|π\)\>\)" -syntax match juliaConstNum0506 display "\%(\<\%(eu\?\|eulergamma\|γ\|catalan\|φ\|golden\)\>\)" +syntax match juliaConstNum06 display "\%(\<\%(eu\?\|eulergamma\|γ\|catalan\|φ\|golden\)\>\)" " Note: recognition of ℯ, which Vim does not consider a valid identifier, is " complicated. We detect possible uses by just looking for the character (for " performance) and then check that it's actually used by its own. @@ -262,12 +240,12 @@ syntax match juliaPossibleEuler "ℯ" contains=juliaEuler exec 'syntax match juliaEuler contained "\%(\%(^\|[' . s:nonidS_chars . ']\|' . s:operators . '\)\%([.0-9eEf_]*\d\)\?\)\@'.s:d(80).'<=ℯ\ze\%($\|[' . s:nonidS_chars . ']\|' . s:operators . '\)"' syntax match juliaConstBool display "\<\%(true\|false\)\>" syntax match juliaConstEnv display "\<\%(ARGS\|ENV\|OS_NAME\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|JULIA_HOME\|PROGRAM_FILE\)\>" -syntax match juliaConstEnv07 display "\" -syntax match juliaConstIO0506 display "\<\%(STD\%(OUT\|IN\|ERR\)\|DevNull\)\>" -syntax match juliaConstIO07 display "\<\%(std\%(out\|in\|err\)\|devnull\)\>" +syntax match juliaConstEnv1011 display "\" +syntax match juliaConstIO06 display "\<\%(STD\%(OUT\|IN\|ERR\)\|DevNull\)\>" +syntax match juliaConstIO1011 display "\<\%(std\%(out\|in\|err\)\|devnull\)\>" syntax match juliaConstC display "\<\%(WORD_SIZE\|C_NULL\)\>" syntax match juliaConstGeneric display "\<\%(nothing\|Main\)\>" -syntax match juliaConstGeneric07 display "\" +syntax match juliaConstGeneric1011 display "\<\%(undef\|missing\)\>" syntax match juliaPossibleMacro transparent "@" contains=juliaMacroCall,juliaMacroCallP,juliaPrintfMacro @@ -335,13 +313,20 @@ syntax match juliaChar display "'\\U\x\{1,8\}'" contains=juliaUniCharLarge exec 'syntax match juliaCTransOperator "[[:space:]}' . s:nonid_chars . s:uniop_chars . s:binop_chars . '!?]\@'.s:d(1).'= 7 ? 'Keyword' : 'NONE') +exec 'hi! def link juliaOuter ' . (b:julia_syntax_version >= 10 ? 'Keyword' : 'NONE') hi def link juliaBaseTypeBasic Type hi def link juliaBaseTypeNum Type hi def link juliaBaseTypeC Type @@ -448,21 +437,13 @@ hi def link juliaBaseTypeRandom Type hi def link juliaBaseTypeDisplay Type hi def link juliaBaseTypeTime Type hi def link juliaBaseTypeOther Type -for t in ["Basic", "Array", "Set", "Range", "Time", "Process"] - let h = b:julia_syntax_version >= 6 ? "Type" : "NONE" - exec "hi! def link juliaBaseType" . t . "0607 " . h -endfor -for t in ["Iter", "Range"] - let h = b:julia_syntax_version == 5 ? "Type" : b:julia_syntax_version == 6 ? "juliaDeprecated" : "NONE" - exec "hi! def link juliaBaseType" . t . "05 " . h -endfor for t in ["Num", "Range", "Dict", "Set"] - let h = b:julia_syntax_version <= 6 ? "Type" : "juliaDeprecated" - exec "hi! def link juliaBaseType" . t . "0506 " . h + let h = b:julia_syntax_version == 6 ? "Type" : b:julia_syntax_version == 10 ? "juliaDeprecated" : "NONE" + exec "hi! def link juliaBaseType" . t . "06 " . h endfor -for t in ["Range", "Dict", "Set", "Basic", "C", "Array", "Iter", "Display", "IO", "Num", "Error"] - let h = b:julia_syntax_version >= 7 ? "Type" : "NONE" - exec "hi! def link juliaBaseType" . t . "07 " . h +for t in ["Range", "Dict", "Set", "Basic", "C", "Array", "Iter", "Display", "IO", "Num", "Error", "String"] + let h = b:julia_syntax_version >= 10 ? "Type" : "NONE" + exec "hi! def link juliaBaseType" . t . "1011 " . h endfor " NOTE: deprecated constants are not highlighted as such. For once, @@ -470,9 +451,9 @@ endfor " Plus, one-letter variables like `e` and `γ` can be used with other " meanings. hi def link juliaConstNum Constant -let h = b:julia_syntax_version <= 6 ? "Constant" : "NONE" -exec "hi! def link juliaConstNum0506 " . h -let h = b:julia_syntax_version >= 7 ? "Constant" : "NONE" +let h = b:julia_syntax_version == 6 ? "Constant" : "NONE" +exec "hi! def link juliaConstNum06 " . h +let h = b:julia_syntax_version >= 10 ? "Constant" : "NONE" exec "hi! def link juliaEuler " . h hi def link juliaConstEnv Constant @@ -483,11 +464,11 @@ hi def link juliaRangeEnd Constant hi def link juliaConstBool Boolean for t in ["Generic", "IO", "Env"] - let h = b:julia_syntax_version >= 7 ? "Constant" : "NONE" - exec "hi! def link juliaConst" . t . "07 " . h + let h = b:julia_syntax_version >= 10 ? "Constant" : "NONE" + exec "hi! def link juliaConst" . t . "1011 " . h endfor -let h = b:julia_syntax_version < 7 ? "Constant" : "juliaDeprecated" -exec "hi! def link juliaConstIO0506 " . h +let h = b:julia_syntax_version == 6 ? "Constant" : b:julia_syntax_version == 10 ? "juliaDeprecated" : "NONE" +exec "hi! def link juliaConstIO06 " . h hi def link juliaComprehensionFor Keyword hi def link juliaComprehensionIf Keyword @@ -509,6 +490,7 @@ hi def link juliaComplexUnit Constant hi def link juliaChar Character hi def link juliaString String +hi def link juliaStringPrefixed String hi def link juliabString String hi def link juliasString String hi def link juliavString String @@ -516,6 +498,10 @@ hi def link juliarString String hi def link juliaipString String hi def link juliabigString String hi def link juliaMIMEString String +hi def link juliarawString String +hi def link juliatestString String +hi def link juliahtmlString String +hi def link juliaint128String String hi def link juliaPrintfString String hi def link juliaShellString String hi def link juliaDocString String @@ -530,6 +516,8 @@ hi def link juliaOctalEscapeChar SpecialChar hi def link juliaHexEscapeChar SpecialChar hi def link juliaUniCharSmall SpecialChar hi def link juliaUniCharLarge SpecialChar +hi def link juliaDoubleBackslash SpecialChar +hi def link juliaEscapedQuote SpecialChar hi def link juliaPrintfFmt SpecialChar diff --git a/syntax/juliadoc.vim b/syntax/juliadoc.vim new file mode 100644 index 0000000..d886518 --- /dev/null +++ b/syntax/juliadoc.vim @@ -0,0 +1,69 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1 + +" Vim syntax file for julia document view +scriptencoding utf-8 + +if exists('b:current_syntax') + finish +endif + +syntax sync fromstart + +syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="`" end="`" concealends display oneline +syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="``" end="``" concealends display oneline contains=juliadocCodeLatex +syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="^\s*```.*$" end='^\s*```' concealends +syntax region juliadocH1 matchgroup=juliadocHeadingDelimiter start="##\@!" end="$" concealends display oneline +syntax region juliadocH2 matchgroup=juliadocHeadingDelimiter start="###\@!" end="$" concealends display oneline +syntax region juliadocH3 matchgroup=juliadocHeadingDelimiter start="####\@!" end="$" concealends display oneline +syntax region juliadocH4 matchgroup=juliadocHeadingDelimiter start="#####\@!" end="$" concealends display oneline +syntax region juliadocH5 matchgroup=juliadocHeadingDelimiter start="######\@!" end="$" concealends display oneline +syntax region juliadocH6 matchgroup=juliadocHeadingDelimiter start="#######\@!" end="$" concealends display oneline +syntax match juliadocLink "\[\^\@!.\{-1,}\](.\{-1,})" contains=juliadocLinkBody,juliadocLinkUrl display keepend +syntax region juliadocLinkBody matchgroup=juliadocLinkDelimiter start="\[" end="\]" concealends display contained oneline +syntax match juliadocLinkUrl "(\zs@ref\s\+.\{-1,}\ze)" contains=juliadocLinkUrlConceal display keepend +syntax match juliadocLinkUrlConceal "@ref\s\+" conceal display contained +syntax match juliadocCrossref "\[`.\{-1,}`\](@ref)" contains=juliadocCrossrefBody display keepend +syntax region juliadocCrossrefBody matchgroup=juliadocCrossrefDelimiter start="\[`" end="`\](@ref)" concealends display contained oneline +syntax region juliadocMath matchgroup=juliadocMathDelimiter start="\$" end="\$" concealends display oneline +syntax match juliadocListing "^\s*\zs\%([-+*]\|\d\+[.)]\)\ze\s" display +syntax match juliadocFootnote "^\s*\[\^[[:alnum:]]\+\]:\s*" display contains=juliadocFootnoteBody keepend +syntax region juliadocFootnoteBody matchgroup=juliadocFootnoteDelimiter start="^\s*\zs\[\^" end="\]" concealends display contained oneline +syntax match juliadocFootnoteRef "\s\[\^[[:alnum:]]\+\]" display contains=juliadocFootnoteRefBody,juliadocFootnoteRefConceal keepend +syntax match juliadocFootnoteRefBody "[[:alnum:]]\+" display contained +syntax match juliadocFootnoteRefConceal "\^" conceal display contained +syntax region juliadocBlockquote matchgroup=juliadocBlockquoteDelimiter start="^\s*>\s" end="$" concealends display oneline +syntax match juliadocRules "^-\{3,}" display +syntax region juliadocAdmonitions matchgroup=juliadocAdmonitionsDelimiter start="^\s*!!!" end="$" concealends display contains=juliadocAdmonitionsType,juliadocAdmonitionsTitle oneline keepend +syntax match juliadocAdmonitionsType "\c\%(danger\|warning\|info\|note\|tip\)\>" display contained +syntax region juliadocAdmonitionsTitle matchgroup=juliadocAdmonitionsTitleDelimiter start='"' end='"' display contained oneline + +if &encoding ==# 'utf-8' + for [s:from, s:to] in items(julia_latex_symbols#get_dict()) + execute printf('syntax match juliadocCodeLatex "\\%s" conceal cchar=%s display contained', escape(s:from, '~"\.^$[]*'), s:to) + endfor +endif + +highlight default link juliadocCode String +highlight default link juliadocCodeLatex String +highlight default link juliadocH1 Title +highlight default link juliadocH2 Title +highlight default link juliadocH3 Title +highlight default link juliadocH4 Title +highlight default link juliadocH5 Title +highlight default link juliadocH6 Title +highlight default link juliadocLinkBody Identifier +highlight default link juliadocLinkUrl Underlined +highlight default link juliadocCrossref Underlined +highlight default link juliadocCrossrefBody Underlined +highlight default link juliadocMath Special +highlight default link juliadocListing PreProc +highlight default link juliadocFootnoteBody PreProc +highlight default link juliadocFootnoteRefBody PreProc +highlight default link juliadocBlockquote Comment +highlight default link juliadocRules PreProc +highlight default link juliadocAdmonitionsType Todo +highlight default link juliadocAdmonitionsTitle Title + +let b:current_syntax = "juliadoc" + +endif diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 79af3af..43c12f7 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -84,25 +84,25 @@ syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained "HTML headings -syn region htmlH1 start="^\s*#" end="$" contains=mkdLink,mkdInlineURL,@Spell -syn region htmlH2 start="^\s*##" end="$" contains=mkdLink,mkdInlineURL,@Spell -syn region htmlH3 start="^\s*###" end="$" contains=mkdLink,mkdInlineURL,@Spell -syn region htmlH4 start="^\s*####" end="$" contains=mkdLink,mkdInlineURL,@Spell -syn region htmlH5 start="^\s*#####" end="$" contains=mkdLink,mkdInlineURL,@Spell -syn region htmlH6 start="^\s*######" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH1 matchgroup=mkdHeading start="^\s*#" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH2 matchgroup=mkdHeading start="^\s*##" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH3 matchgroup=mkdHeading start="^\s*###" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH4 matchgroup=mkdHeading start="^\s*####" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH5 matchgroup=mkdHeading start="^\s*#####" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH6 matchgroup=mkdHeading start="^\s*######" end="$" contains=mkdLink,mkdInlineURL,@Spell syn match htmlH1 /^.\+\n=\+$/ contains=mkdLink,mkdInlineURL,@Spell syn match htmlH2 /^.\+\n-\+$/ contains=mkdLink,mkdInlineURL,@Spell "define Markdown groups syn match mkdLineBreak / \+$/ syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell -syn region mkdCode start=/\(\([^\\]\|^\)\\\)\@]*\\\@" end="" -syn region mkdCode start="]*\\\@" end="" +execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@]*\\\@" end=""' . s:concealends +execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="]*\\\@" end=""' . s:concealends syn region mkdFootnote start="\[^" end="\]" syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/ syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ @@ -117,7 +117,7 @@ syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_\(_\|\s\)*$/ " YAML frontmatter if get(g:, 'vim_markdown_frontmatter', 0) syn include @yamlTop syntax/yaml.vim - syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^---$" contains=@yamlTop keepend + syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^\(---\|...\)$" contains=@yamlTop keepend unlet! b:current_syntax endif @@ -152,6 +152,7 @@ syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic, "highlighting for Markdown groups HtmlHiLink mkdString String HtmlHiLink mkdCode String +HtmlHiLink mkdCodeDelimiter String HtmlHiLink mkdCodeStart String HtmlHiLink mkdCodeEnd String HtmlHiLink mkdFootnote Comment diff --git a/syntax/mustache.vim b/syntax/mustache.vim index ebedaee..89cb59b 100644 --- a/syntax/mustache.vim +++ b/syntax/mustache.vim @@ -43,7 +43,7 @@ endif syntax match mustacheError '}}}\?' syntax match mustacheInsideError '{{[{$#<>=!\/]\?' -syntax region mustacheInside start=/{{/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer +syntax region mustacheInside start=/{{[^!]/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,@htmlMustacheContainer syntax region mustacheSection start='{{[$#^/]'lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer syntax region mustachePartial start=/{{[<>]/lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer @@ -52,8 +52,8 @@ syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@h syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection -syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer -syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=mustacheInside,@htmlMustacheContainer +syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=TOP,mustacheInside,@htmlMustacheContainer +syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=TOP,mustacheInside,@htmlMustacheContainer syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside syntax region mustacheDQString start=/"/ skip=/\\"/ end=/"/ contained containedin=mustacheInside diff --git a/syntax/nix.vim b/syntax/nix.vim index d0dc57c..f67aa4c 100644 --- a/syntax/nix.vim +++ b/syntax/nix.vim @@ -36,12 +36,15 @@ syn region nixComment start=+/\*+ end=+\*/+ contains=nixTodo,@Spell syn region nixInterpolation matchgroup=nixInterpolationDelimiter start="\${" end="}" contained contains=@nixExpr,nixInterpolationParam -syn match nixSimpleStringSpecial /\\./ contained +syn match nixSimpleStringSpecial /\\\%([nrt"\\$]\|$\)/ contained syn match nixStringSpecial /''['$]/ contained -syn match nixStringSpecial /''\\./ contained +syn match nixStringSpecial /''\\[nrt]/ contained -syn region nixSimpleString matchgroup=nixStringDelimiter start=+"+ skip=+\\"+ end=+"+ contains=nixInterpolation,nixSimpleStringSpecial -syn region nixString matchgroup=nixStringDelimiter start=+''+ skip=+''['$\\]+ end=+''+ contains=nixInterpolation,nixStringSpecial +syn match nixInvalidSimpleStringEscape /\\[^nrt"\\$]/ contained +syn match nixInvalidStringEscape /''\\[^nrt]/ contained + +syn region nixSimpleString matchgroup=nixStringDelimiter start=+"+ skip=+\\"+ end=+"+ contains=nixInterpolation,nixSimpleStringSpecial,nixInvalidSimpleStringEscape +syn region nixString matchgroup=nixStringDelimiter start=+''+ skip=+''['$\\]+ end=+''+ contains=nixInterpolation,nixStringSpecial,nixInvalidStringEscape syn match nixFunctionCall "[a-zA-Z_][a-zA-Z0-9_'-]*" @@ -53,7 +56,7 @@ syn match nixSearchPathRef "<[a-zA-Z0-9._+-]\+\%(\/[a-zA-Z0-9._+-]\+\)*>" contai syn match nixURI "[a-zA-Z][a-zA-Z0-9.+-]*:[a-zA-Z0-9%/?:@&=$,_.!~*'+-]\+" syn match nixAttributeDot "\." contained -syn match nixAttribute "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%([^a-zA-Z0-9_'-.]\|$\)" contained +syn match nixAttribute "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%([^a-zA-Z0-9_'.-]\|$\)" contained syn region nixAttributeAssignment start="=" end="\ze;" contained contains=@nixExpr syn region nixAttributeDefinition start=/\ze[a-zA-Z_"$]/ end=";" contained contains=nixComment,nixAttribute,nixInterpolation,nixSimpleString,nixAttributeDot,nixAttributeAssignment @@ -149,41 +152,43 @@ syn keyword nixNamespacedBuiltin contained syn match nixBuiltin "builtins\.[a-zA-Z']\+"he=s+9 contains=nixComment,nixNamespacedBuiltin -hi def link nixArgOperator Operator -hi def link nixArgumentDefinition Identifier -hi def link nixArgumentEllipsis Operator -hi def link nixAssertKeyword Keyword -hi def link nixAttribute Identifier -hi def link nixAttributeDot Operator -hi def link nixBoolean Boolean -hi def link nixBuiltin Special -hi def link nixComment Comment -hi def link nixConditional Conditional -hi def link nixHomePath Include -hi def link nixIfExprKeyword Keyword -hi def link nixInherit Keyword -hi def link nixInteger Integer -hi def link nixInterpolation Macro -hi def link nixInterpolationDelimiter Delimiter -hi def link nixInterpolationParam Macro -hi def link nixLetExprKeyword Keyword -hi def link nixNamespacedBuiltin Special -hi def link nixNull Constant -hi def link nixOperator Operator -hi def link nixPath Include -hi def link nixPathDelimiter Delimiter -hi def link nixRecKeyword Keyword -hi def link nixSearchPath Include -hi def link nixSimpleBuiltin Keyword -hi def link nixSimpleFunctionArgument Identifier -hi def link nixSimpleString String -hi def link nixSimpleStringSpecial SpecialChar -hi def link nixString String -hi def link nixStringDelimiter Delimiter -hi def link nixStringSpecial Special -hi def link nixTodo Todo -hi def link nixURI Include -hi def link nixWithExprKeyword Keyword +hi def link nixArgOperator Operator +hi def link nixArgumentDefinition Identifier +hi def link nixArgumentEllipsis Operator +hi def link nixAssertKeyword Keyword +hi def link nixAttribute Identifier +hi def link nixAttributeDot Operator +hi def link nixBoolean Boolean +hi def link nixBuiltin Special +hi def link nixComment Comment +hi def link nixConditional Conditional +hi def link nixHomePath Include +hi def link nixIfExprKeyword Keyword +hi def link nixInherit Keyword +hi def link nixInteger Integer +hi def link nixInterpolation Macro +hi def link nixInterpolationDelimiter Delimiter +hi def link nixInterpolationParam Macro +hi def link nixInvalidSimpleStringEscape Error +hi def link nixInvalidStringEscape Error +hi def link nixLetExprKeyword Keyword +hi def link nixNamespacedBuiltin Special +hi def link nixNull Constant +hi def link nixOperator Operator +hi def link nixPath Include +hi def link nixPathDelimiter Delimiter +hi def link nixRecKeyword Keyword +hi def link nixSearchPath Include +hi def link nixSimpleBuiltin Keyword +hi def link nixSimpleFunctionArgument Identifier +hi def link nixSimpleString String +hi def link nixSimpleStringSpecial SpecialChar +hi def link nixString String +hi def link nixStringDelimiter Delimiter +hi def link nixStringSpecial Special +hi def link nixTodo Todo +hi def link nixURI Include +hi def link nixWithExprKeyword Keyword " This could lead up to slow syntax highlighting for large files, but usually " large files such as all-packages.nix are one large attribute set, so if we'd diff --git a/syntax/pug.vim b/syntax/pug.vim index bd3f874..31dcaec 100644 --- a/syntax/pug.vim +++ b/syntax/pug.vim @@ -57,7 +57,7 @@ syn match pugPlainChar "\\" contained syn region pugInterpolation matchgroup=pugInterpolationDelimiter start="[#!]{" end="}" contains=@htmlJavascript syn match pugInterpolationEscape "\\\@\|0[xX][0-9a-fA-F]\+\>" diff --git a/syntax/rust.vim b/syntax/rust.vim index 90e5b6b..3188d34 100644 --- a/syntax/rust.vim +++ b/syntax/rust.vim @@ -206,11 +206,6 @@ syn region rustCommentBlockNest matchgroup=rustCommentBlock star syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained transparent -if exists("b:current_syntax_embed") -syn match rustCommentLine "^//" -syn match rustCommentLineDoc "^//\%(//\@!\|!\)" -endif - " FIXME: this is a really ugly and not fully correct implementation. Most " importantly, a case like ``/* */*`` should have the final ``*`` not being in " a comment, but in practice at present it leaves comments open two levels @@ -235,12 +230,18 @@ if !exists("b:current_syntax_embed") syntax include @RustCodeInComment :p:h/rust.vim unlet b:current_syntax_embed + " Currently regions marked as ``` will not get + " highlighted at all. In the future, we can do as vim-markdown does and + " highlight with the other syntax. But for now, let's make sure we find + " the closing block marker, because the rules below won't catch it. + syn region rustCommentLinesDocNonRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\).\+$' end='^\z1$' keepend contains=rustCommentLineDoc + " We borrow the rules from rust’s src/librustdoc/html/markdown.rs, so that " we only highlight as Rust what it would perceive as Rust (almost; it’s " possible to trick it if you try hard, and indented code blocks aren’t " supported because Markdown is a menace to parse and only mad dogs and " Englishmen would try to handle that case correctly in this syntax file). - syn region rustCommentLinesDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment + syn region rustCommentLinesDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\s*//[!/]\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentLineDocLeader syn region rustCommentBlockDocRustCode matchgroup=rustCommentDocCodeFence start='^\z(\%(\s*\*\)\?\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|rust\|test_harness\|compile_fail\|E\d\{4}\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,rustCommentBlockDocStar " Strictly, this may or may not be correct; this code, for example, would " mishighlight: @@ -254,6 +255,7 @@ if !exists("b:current_syntax_embed") " " … but I don’t care. Balance of probability, and all that. syn match rustCommentBlockDocStar /^\s*\*\s\?/ contained + syn match rustCommentLineDocLeader "^\s*//\%(//\@!\|!\)" contained endif " Default highlighting {{{1 @@ -308,6 +310,7 @@ hi def link rustFuncCall Function hi def link rustShebang Comment hi def link rustCommentLine Comment hi def link rustCommentLineDoc SpecialComment +hi def link rustCommentLineDocLeader rustCommentLineDoc hi def link rustCommentLineDocError Error hi def link rustCommentBlock rustCommentLine hi def link rustCommentBlockDoc rustCommentLineDoc diff --git a/syntax/swift.vim b/syntax/swift.vim index 9244887..7379d25 100644 --- a/syntax/swift.vim +++ b/syntax/swift.vim @@ -195,6 +195,7 @@ syntax keyword swiftAttributes \ @IBDesignable \ @IBInspectable \ @IBOutlet + \ @inlinable \ @noescape \ @nonobjc \ @noreturn @@ -204,6 +205,7 @@ syntax keyword swiftAttributes \ @objc \ @testable \ @UIApplicationMain + \ @usableFromInline \ @warn_unused_result syntax keyword swiftConditionStatement #available diff --git a/syntax/toml.vim b/syntax/toml.vim index 1decc5f..671f145 100644 --- a/syntax/toml.vim +++ b/syntax/toml.vim @@ -27,12 +27,16 @@ syn region tomlString oneline start=/'/ end=/'/ syn region tomlString start=/'''/ end=/'''/ hi def link tomlString String -syn match tomlInteger /\<[+-]\=[0-9]\(_\=\d\)*\>/ display -syn match tomlInteger /\<[+-]\=\(inf\|nan\)\>/ display +syn match tomlInteger /[+-]\=\<[1-9]\(_\=\d\)*\>/ display +syn match tomlInteger /[+-]\=\<0\>/ display +syn match tomlInteger /[+-]\=\<0x[[:xdigit:]]\(_\=[[:xdigit:]]\)*\>/ display +syn match tomlInteger /[+-]\=\<0o[0-7]\(_\=[0-7]\)*\>/ display +syn match tomlInteger /[+-]\=\<0b[01]\(_\=[01]\)*\>/ display +syn match tomlInteger /[+-]\=\<\(inf\|nan\)\>/ display hi def link tomlInteger Number -syn match tomlFloat /\<[+-]\=[0-9]\(_\=\d\)*\.\d\+\>/ display -syn match tomlFloat /\<[+-]\=[0-9]\(_\=\d\)*\(\.[0-9]\(_\=\d\)*\)\=[eE][+-]\=[0-9]\(_\=\d\)*\>/ display +syn match tomlFloat /[+-]\=\<\d\(_\=\d\)*\.\d\+\>/ display +syn match tomlFloat /[+-]\=\<\d\(_\=\d\)*\(\.\d\(_\=\d\)*\)\=[eE][+-]\=\d\(_\=\d\)*\>/ display hi def link tomlFloat Float syn match tomlBoolean /\<\%(true\|false\)\>/ display diff --git a/syntax/typescript.vim b/syntax/typescript.vim index 0a2d298..b8f3180 100644 --- a/syntax/typescript.vim +++ b/syntax/typescript.vim @@ -58,7 +58,7 @@ endif "" JSDoc end syntax case match "" Syntax in the typescript code"{{{ -syn match typescriptSpecial "\\\d\d\d\|\\." +syn match typescriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}" contained containedin=typescriptStringD,typescriptStringS,typescriptStringB display syn region typescriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typescriptSpecial,@htmlPreproc extend syn region typescriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typescriptSpecial,@htmlPreproc extend syn region typescriptStringB start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=typescriptInterpolation,typescriptSpecial,@htmlPreproc extend @@ -87,28 +87,31 @@ syntax keyword typescriptPrototype contained prototype "}}} " DOM, Browser and Ajax Support {{{ """""""""""""""""""""""" -syntax keyword typescriptBrowserObjects window navigator screen history location - -syntax keyword typescriptDOMObjects document event HTMLElement Anchor Area Base Body Button Form Frame Frameset Image Link Meta Option Select Style Table TableCell TableRow Textarea -syntax keyword typescriptDOMMethods contained createTextNode createElement insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported hasAttributes getAttribute setAttribute removeAttribute getAttributeNode setAttributeNode removeAttributeNode getElementsByTagName hasAttribute getElementById adoptNode close compareDocumentPosition createAttribute createCDATASection createComment createDocumentFragment createElementNS createEvent createExpression createNSResolver createProcessingInstruction createRange createTreeWalker elementFromPoint evaluate getBoxObjectFor getElementsByClassName getSelection getUserData hasFocus importNode -syntax keyword typescriptDOMProperties contained nodeName nodeValue nodeType parentNode childNodes firstChild lastChild previousSibling nextSibling attributes ownerDocument namespaceURI prefix localName tagName - -syntax keyword typescriptAjaxObjects XMLHttpRequest -syntax keyword typescriptAjaxProperties contained readyState responseText responseXML statusText -syntax keyword typescriptAjaxMethods contained onreadystatechange abort getAllResponseHeaders getResponseHeader open send setRequestHeader - -syntax keyword typescriptPropietaryObjects ActiveXObject -syntax keyword typescriptPropietaryMethods contained attachEvent detachEvent cancelBubble returnValue - -syntax keyword typescriptHtmlElemProperties contained className clientHeight clientLeft clientTop clientWidth dir href id innerHTML lang length offsetHeight offsetLeft offsetParent offsetTop offsetWidth scrollHeight scrollLeft scrollTop scrollWidth style tabIndex target title - -syntax keyword typescriptEventListenerKeywords contained blur click focus mouseover mouseout load item - -syntax keyword typescriptEventListenerMethods contained scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation +if get(g:, 'typescript_ignore_browserwords', 0) + syntax keyword typescriptBrowserObjects window navigator screen history location + + syntax keyword typescriptDOMObjects document event HTMLElement Anchor Area Base Body Button Form Frame Frameset Image Link Meta Option Select Style Table TableCell TableRow Textarea + syntax keyword typescriptDOMMethods contained createTextNode createElement insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported hasAttributes getAttribute setAttribute removeAttribute getAttributeNode setAttributeNode removeAttributeNode getElementsByTagName hasAttribute getElementById adoptNode close compareDocumentPosition createAttribute createCDATASection createComment createDocumentFragment createElementNS createEvent createExpression createNSResolver createProcessingInstruction createRange createTreeWalker elementFromPoint evaluate getBoxObjectFor getElementsByClassName getSelection getUserData hasFocus importNode + syntax keyword typescriptDOMProperties contained nodeName nodeValue nodeType parentNode childNodes firstChild lastChild previousSibling nextSibling attributes ownerDocument namespaceURI prefix localName tagName + + syntax keyword typescriptAjaxObjects XMLHttpRequest + syntax keyword typescriptAjaxProperties contained readyState responseText responseXML statusText + syntax keyword typescriptAjaxMethods contained onreadystatechange abort getAllResponseHeaders getResponseHeader open send setRequestHeader + + syntax keyword typescriptPropietaryObjects ActiveXObject + syntax keyword typescriptPropietaryMethods contained attachEvent detachEvent cancelBubble returnValue + + syntax keyword typescriptHtmlElemProperties contained className clientHeight clientLeft clientTop clientWidth dir href id innerHTML lang length offsetHeight offsetLeft offsetParent offsetTop offsetWidth scrollHeight scrollLeft scrollTop scrollWidth style tabIndex target title + + syntax keyword typescriptEventListenerKeywords contained blur click focus mouseover mouseout load item + + syntax keyword typescriptEventListenerMethods contained scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation +endif " }}} "" Programm Keywords"{{{ syntax keyword typescriptSource import export from as -syntax keyword typescriptIdentifier arguments this let var void const +syntax keyword typescriptIdentifier arguments this void +syntax keyword typescriptStorageClass let var const syntax keyword typescriptOperator delete new instanceof typeof syntax keyword typescriptBoolean true false syntax keyword typescriptNull null undefined @@ -137,7 +140,7 @@ syntax keyword typescriptReserved constructor declare as interface module abstra syn match typescriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite "}}} " DOM2 Objects"{{{ - syntax keyword typescriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number symbol never object + syntax keyword typescriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number symbol never object unknown syntax keyword typescriptExceptions DOMException "}}} " DOM2 CONSTANT"{{{ @@ -187,7 +190,7 @@ syntax match typescriptDotNotation "\.style\." nextgroup=typescriptCssStyles "" Code blocks -syntax cluster typescriptAll contains=typescriptComment,typescriptLineComment,typescriptDocComment,typescriptStringD,typescriptStringS,typescriptStringB,typescriptRegexpString,typescriptNumber,typescriptFloat,typescriptDecorators,typescriptLabel,typescriptSource,typescriptType,typescriptOperator,typescriptBoolean,typescriptNull,typescriptFuncKeyword,typescriptConditional,typescriptGlobal,typescriptRepeat,typescriptBranch,typescriptStatement,typescriptGlobalObjects,typescriptMessage,typescriptIdentifier,typescriptExceptions,typescriptReserved,typescriptDeprecated,typescriptDomErrNo,typescriptDomNodeConsts,typescriptHtmlEvents,typescriptDotNotation,typescriptBrowserObjects,typescriptDOMObjects,typescriptAjaxObjects,typescriptPropietaryObjects,typescriptDOMMethods,typescriptHtmlElemProperties,typescriptDOMProperties,typescriptEventListenerKeywords,typescriptEventListenerMethods,typescriptAjaxProperties,typescriptAjaxMethods,typescriptFuncArg +syntax cluster typescriptAll contains=typescriptComment,typescriptLineComment,typescriptDocComment,typescriptStringD,typescriptStringS,typescriptStringB,typescriptRegexpString,typescriptNumber,typescriptFloat,typescriptDecorators,typescriptLabel,typescriptSource,typescriptType,typescriptOperator,typescriptBoolean,typescriptNull,typescriptFuncKeyword,typescriptConditional,typescriptGlobal,typescriptRepeat,typescriptBranch,typescriptStatement,typescriptGlobalObjects,typescriptMessage,typescriptIdentifier,typescriptStorageClass,typescriptExceptions,typescriptReserved,typescriptDeprecated,typescriptDomErrNo,typescriptDomNodeConsts,typescriptHtmlEvents,typescriptDotNotation,typescriptBrowserObjects,typescriptDOMObjects,typescriptAjaxObjects,typescriptPropietaryObjects,typescriptDOMMethods,typescriptHtmlElemProperties,typescriptDOMProperties,typescriptEventListenerKeywords,typescriptEventListenerMethods,typescriptAjaxProperties,typescriptAjaxMethods,typescriptFuncArg if main_syntax == "typescript" syntax sync clear @@ -263,6 +266,7 @@ if version >= 508 || !exists("did_typescript_syn_inits") HiLink typescriptConditional Conditional HiLink typescriptBranch Conditional HiLink typescriptIdentifier Identifier + HiLink typescriptStorageClass StorageClass HiLink typescriptRepeat Repeat HiLink typescriptStatement Statement HiLink typescriptFuncKeyword Function diff --git a/syntax/vifm.vim b/syntax/vifm.vim index 1ae9da1..b0ce0a3 100644 --- a/syntax/vifm.vim +++ b/syntax/vifm.vim @@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1 " vifm syntax file " Maintainer: xaizek -" Last Change: July 4, 2018 +" Last Change: September 22, 2018 " Inspired By: Vim syntax file by Dr. Charles E. Campbell, Jr. if exists('b:current_syntax') @@ -19,11 +19,12 @@ syntax keyword vifmCommand contained alink apropos bmark bmarks bmgo change \ chmod chown clone compare cope[n] co[py] cq[uit] d[elete] delbmarks \ delm[arks] di[splay] dirs e[dit] el[se] empty en[dif] exi[t] file fin[d] \ fini[sh] go[to] gr[ep] h[elp] histnext his[tory] histprev jobs locate ls - \ lstrash marks mes[sages] mkdir m[ove] noh[lsearch] on[ly] popd pushd pu[t] - \ pw[d] qa[ll] q[uit] redr[aw] reg[isters] rename restart restore rlink - \ screen sh[ell] siblnext siblprev sor[t] sp[lit] s[ubstitute] tabc[lose] - \ tabm[ove] tabname tabnew touch tr trashes tree sync undol[ist] ve[rsion] - \ vie[w] vifm vs[plit] winc[md] w[rite] wq wqa[ll] xa[ll] x[it] y[ank] + \ lstrash marks media mes[sages] mkdir m[ove] noh[lsearch] on[ly] popd pushd + \ pu[t] pw[d] qa[ll] q[uit] redr[aw] reg[isters] regular rename restart + \ restore rlink screen sh[ell] siblnext siblprev sor[t] sp[lit] s[ubstitute] + \ tabc[lose] tabm[ove] tabname tabnew touch tr trashes tree sync undol[ist] + \ ve[rsion] vie[w] vifm vs[plit] winc[md] w[rite] wq wqa[ll] xa[ll] x[it] + \ y[ank] \ nextgroup=vifmArgs " commands that might be prepended to a command without changing everything else @@ -128,7 +129,7 @@ syntax keyword vifmOption contained aproposprg autochpos caseoptions cdpath cd \ deleteprg dotdirs dotfiles dirsize fastrun fillchars fcs findprg \ followlinks fusehome gdefault grepprg histcursor history hi hlsearch hls \ iec ignorecase ic iooptions incsearch is laststatus lines locateprg ls - \ lsoptions lsview milleroptions millerview mintimeoutlen number nu + \ lsoptions lsview mediaprg milleroptions millerview mintimeoutlen number nu \ numberwidth nuw previewprg quickview relativenumber rnu rulerformat ruf \ runexec scrollbind scb scrolloff so sort sortgroups sortorder sortnumbers \ shell sh shortmess shm showtabline stal sizefmt slowfs smartcase scs @@ -383,11 +384,12 @@ syntax match vifmEnvVar contained /\$[0-9a-zA-Z_]\+/ syntax match vifmNumber contained /\d\+/ " Optional map arguments right after command name -syntax match vifmMapArgList '\(\s*\)*' contained nextgroup=vifmMapLhs +syntax match vifmMapArgList '\(<\(silent\|wait\)>\s*\)*' contained + \ nextgroup=vifmMapLhs " Ange-bracket notation syntax case ignore -syntax match vifmNotation '<\(esc\|cr\|space\|del\|nop\|\(s-\)\?tab\|home\|end\|left\|right\|up\|down\|bs\|delete\|insert\|pageup\|pagedown\|\([acms]-\)\?f\d\{1,2\}\|c-s-[a-z[\]^_]\|s-c-[a-z[\]^_]\|c-[a-z[\]^_]\|[am]-c-[a-z]\|c-[am]-[a-z]\|[am]-[a-z]\)>' +syntax match vifmNotation '<\(esc\|cr\|space\|del\|nop\|\(s-\)\?tab\|home\|end\|left\|right\|up\|down\|bs\|delete\|insert\|pageup\|pagedown\|\([acms]-\)\?f\d\{1,2\}\|c-s-[a-z[\]^_]\|s-c-[a-z[\]^_]\|c-[a-z[\]^_@]\|[am]-c-[a-z]\|c-[am]-[a-z]\|[am]-[a-z]\)>' syntax case match " Whole line comment