mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 12:03:53 -05:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cea0d08a06 | ||
|
|
43085dc02f | ||
|
|
4d8423c962 | ||
|
|
e204a7223b | ||
|
|
7a0f2d974f | ||
|
|
15aeea662e |
@@ -10,7 +10,7 @@ A collection of language packs for Vim.
|
||||
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||
|
||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->146<!--/Package Count--> packages it consists of.
|
||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->147<!--/Package Count--> packages it consists of.
|
||||
- Solid syntax and indentation support (other features skipped). Only the best language packs.
|
||||
- All unnecessary files are ignored (like enormous documentation from php support).
|
||||
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
||||
@@ -119,7 +119,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [log](https://github.com/MTDL9/vim-log-highlighting) (syntax)
|
||||
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
||||
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin)
|
||||
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent)
|
||||
- [markdown](https://github.com/gabrielelana/vim-markdown) (syntax, autoload, ftplugin)
|
||||
- [mathematica](https://github.com/voldikss/vim-mma) (syntax, ftplugin)
|
||||
- [mdx](https://github.com/jxnblk/vim-mdx-js) (syntax)
|
||||
- [meson](https://github.com/mesonbuild/meson) (syntax, indent, ftplugin)
|
||||
@@ -178,7 +178,8 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [tptp](https://github.com/c-cube/vim-tptp) (syntax)
|
||||
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
|
||||
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (syntax, indent, compiler, ftplugin)
|
||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent)
|
||||
- [v](https://github.com/ollykel/v-vim) (syntax, indent, ftplugin)
|
||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin)
|
||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax)
|
||||
- [vifm](https://github.com/vifm/vifm.vim) (syntax, autoload, ftplugin)
|
||||
@@ -204,7 +205,7 @@ Please make sure you have `syntax on` in your `.vimrc`, otherwise syntax files a
|
||||
Individual language packs can be disabled by setting `g:polyglot_disabled` as follows:
|
||||
|
||||
```viml
|
||||
" ~/.vimrc
|
||||
" ~/.vimrc, declare this variable before polyglot is loaded
|
||||
let g:polyglot_disabled = ['css']
|
||||
```
|
||||
|
||||
|
||||
5
after/ftplugin/javascriptreact.vim
Normal file
5
after/ftplugin/javascriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/javascript.vim
|
||||
|
||||
endif
|
||||
5
after/ftplugin/typescriptreact.vim
Normal file
5
after/ftplugin/typescriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/typescript.vim
|
||||
|
||||
endif
|
||||
@@ -21,7 +21,7 @@ if exists('s:did_indent')
|
||||
endif
|
||||
|
||||
setlocal indentexpr=GetJsxIndent()
|
||||
setlocal indentkeys=0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||
|
||||
function! GetJsxIndent()
|
||||
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
|
||||
|
||||
5
after/indent/javascriptreact.vim
Normal file
5
after/indent/javascriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/javascript.vim
|
||||
|
||||
endif
|
||||
@@ -26,7 +26,7 @@ if exists('s:did_indent')
|
||||
endif
|
||||
|
||||
setlocal indentexpr=GetJsxIndent()
|
||||
setlocal indentkeys=0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||
|
||||
function! GetJsxIndent()
|
||||
return jsx_pretty#indent#get(function('GetTypescriptIndent'))
|
||||
|
||||
5
after/indent/typescriptreact.vim
Normal file
5
after/indent/typescriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/typescript.vim
|
||||
|
||||
endif
|
||||
5
after/syntax/javascriptreact.vim
Normal file
5
after/syntax/javascriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/javascript.vim
|
||||
|
||||
endif
|
||||
@@ -20,7 +20,7 @@ syntax region jsxTag
|
||||
\ matchgroup=NONE
|
||||
\ end=+\%(/\_s*>\)\@=+
|
||||
\ contained
|
||||
\ contains=jsxOpenTag,jsxAttrib,jsxEscapeJs,jsxSpreadOperator,jsComment,@javascriptComments,javaScriptLineComment,javaScriptComment,typescriptLineComment,typescriptComment
|
||||
\ contains=jsxOpenTag,jsxAttrib,jsxExpressionBlock,jsxSpreadOperator,jsComment,@javascriptComments,javaScriptLineComment,javaScriptComment,typescriptLineComment,typescriptComment
|
||||
\ keepend
|
||||
\ extend
|
||||
\ skipwhite
|
||||
@@ -39,7 +39,7 @@ syntax region jsxElement
|
||||
\ start=+<\_s*\%(>\|\${\|\z(\<[-:._$A-Za-z0-9]\+\>\)\)+
|
||||
\ end=+/\_s*>+
|
||||
\ end=+<\_s*/\_s*\z1\_s*>+
|
||||
\ contains=jsxElement,jsxTag,jsxEscapeJs,jsxComment,jsxCloseTag,@Spell
|
||||
\ contains=jsxElement,jsxTag,jsxExpressionBlock,jsxComment,jsxCloseTag,@Spell
|
||||
\ keepend
|
||||
\ extend
|
||||
\ contained
|
||||
@@ -66,7 +66,7 @@ exe 'syntax region jsxOpenTag
|
||||
|
||||
" <tag key={this.props.key}>
|
||||
" ~~~~~~~~~~~~~~~~
|
||||
syntax region jsxEscapeJs
|
||||
syntax region jsxExpressionBlock
|
||||
\ matchgroup=jsxBraces
|
||||
\ start=+{+
|
||||
\ end=+}+
|
||||
@@ -84,7 +84,7 @@ syntax match jsxNamespace +:+ contained
|
||||
|
||||
" <tag id="sample">
|
||||
" ~
|
||||
syntax match jsxEqual +=+ contained skipwhite skipempty nextgroup=jsxString,jsxEscapeJs,jsxRegion
|
||||
syntax match jsxEqual +=+ contained skipwhite skipempty nextgroup=jsxString,jsxExpressionBlock,jsxRegion
|
||||
|
||||
" <tag />
|
||||
" ~~
|
||||
@@ -154,10 +154,10 @@ if s:enable_tagged_jsx
|
||||
\ end=+`+
|
||||
\ extend
|
||||
\ contained
|
||||
\ contains=jsxElement,jsxEscapeJs
|
||||
\ contains=jsxElement,jsxExpressionBlock
|
||||
\ transparent
|
||||
|
||||
syntax region jsxEscapeJs
|
||||
syntax region jsxExpressionBlock
|
||||
\ matchgroup=jsxBraces
|
||||
\ start=+\${+
|
||||
\ end=+}+
|
||||
@@ -171,14 +171,14 @@ if s:enable_tagged_jsx
|
||||
\ matchgroup=NONE
|
||||
\ end=+}\@1<=+
|
||||
\ contained
|
||||
\ contains=jsxEscapeJs
|
||||
\ contains=jsxExpressionBlock
|
||||
\ skipwhite
|
||||
\ skipempty
|
||||
\ nextgroup=jsxAttrib,jsxSpreadOperator
|
||||
|
||||
syntax keyword jsxAttribKeyword class contained
|
||||
|
||||
syntax match jsxSpreadOperator +\.\.\.+ contained nextgroup=jsxEscapeJs skipwhite
|
||||
syntax match jsxSpreadOperator +\.\.\.+ contained nextgroup=jsxExpressionBlock skipwhite
|
||||
|
||||
syntax match jsxCloseTag +<//>+ contained
|
||||
|
||||
|
||||
28
after/syntax/tsx.vim
Normal file
28
after/syntax/tsx.vim
Normal file
@@ -0,0 +1,28 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
|
||||
" GraphQL Support
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
syn include @GraphQLSyntax syntax/graphql.vim
|
||||
if exists('s:current_syntax')
|
||||
let b:current_syntax = s:current_syntax
|
||||
endif
|
||||
|
||||
let s:tags = '\%(' . join(graphql#javascript_tags(), '\|') . '\)'
|
||||
|
||||
exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,typescriptTemplateSubstitution extend'
|
||||
exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString'
|
||||
|
||||
" Support expression interpolation ((${...})) inside template strings.
|
||||
syntax region graphqlTemplateExpression start=+${+ end=+}+ contained contains=typescriptTemplateSubstitution containedin=graphqlFold keepend
|
||||
|
||||
hi def link graphqlTemplateString typescriptTemplate
|
||||
hi def link graphqlTemplateExpression typescriptTemplateSubstitution
|
||||
|
||||
syn cluster typescriptExpression add=graphqlTaggedTemplate
|
||||
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
||||
|
||||
|
||||
endif
|
||||
@@ -30,6 +30,12 @@ endif
|
||||
" refine the typescript line comment
|
||||
syntax region typescriptLineComment start=+//+ end=/$/ contains=@Spell,typescriptCommentTodo,typescriptRef extend keepend
|
||||
|
||||
for syntax_name in ['tsxRegion', 'tsxFragment']
|
||||
if hlexists(syntax_name)
|
||||
exe 'syntax clear ' . syntax_name
|
||||
endif
|
||||
endfor
|
||||
|
||||
if !hlexists('typescriptTypeCast')
|
||||
" add a typescriptBlock group for typescript
|
||||
syntax region typescriptBlock
|
||||
|
||||
5
after/syntax/typescriptreact.vim
Normal file
5
after/syntax/typescriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/typescript.vim
|
||||
|
||||
endif
|
||||
@@ -5,7 +5,17 @@ function! cargo#Load()
|
||||
endfunction
|
||||
|
||||
function! cargo#cmd(args)
|
||||
execute "! cargo" a:args
|
||||
" Trim trailing spaces. This is necessary since :terminal command parses
|
||||
" trailing spaces as an empty argument.
|
||||
let args = substitute(a:args, '\s\+$', '', '')
|
||||
if has('terminal')
|
||||
let cmd = 'terminal'
|
||||
elseif has('nvim')
|
||||
let cmd = 'noautocmd new | terminal'
|
||||
else
|
||||
let cmd = '!'
|
||||
endif
|
||||
execute cmd 'cargo' args
|
||||
endfunction
|
||||
|
||||
function! s:nearest_cargo(...) abort
|
||||
|
||||
@@ -122,7 +122,7 @@ fu! csv#Init(start, end, ...) "{{{3
|
||||
" Enable vartabs for tab delimited files
|
||||
if b:delimiter=="\t" && has("vartabs")&& !exists("b:csv_fixed_width_cols")
|
||||
if get(b:, 'col_width', []) ==# []
|
||||
call csv#CalculateColumnWidth('')
|
||||
call csv#CalculateColumnWidth(line('$'))
|
||||
endif
|
||||
let &l:vts=join(b:col_width, ',')
|
||||
let g:csv_no_conceal=1
|
||||
@@ -574,7 +574,7 @@ fu! csv#MaxColumns(...) "{{{3
|
||||
return len(b:csv_fixed_width_cols)
|
||||
endif
|
||||
endfu
|
||||
fu! csv#ColWidth(colnr, ...) "{{{3
|
||||
fu! csv#ColWidth(colnr, row, silent) "{{{3
|
||||
" if a:1 is given, specifies the row, for which to calculate the width
|
||||
"
|
||||
" Return the width of a column
|
||||
@@ -586,14 +586,13 @@ fu! csv#ColWidth(colnr, ...) "{{{3
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
if !exists("b:csv_list")
|
||||
" only check first 10000 lines, to be faster
|
||||
let last = line('$')
|
||||
if exists("a:1") && !empty(a:1)
|
||||
let last = a:1
|
||||
endif
|
||||
let last = a:row
|
||||
if !get(b:, 'csv_arrange_use_all_rows', 0)
|
||||
if last > 10000
|
||||
let last = 10000
|
||||
call csv#Warn('File too large, only checking the first 10000 rows for the width')
|
||||
if !a:silent
|
||||
call csv#Warn('File too large, only checking the first 10000 rows for the width')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let b:csv_list=getline(skipfirst+1,last)
|
||||
@@ -750,7 +749,7 @@ fu! csv#UnArrangeCol(match) "{{{3
|
||||
" Strip leading white space, also trims empty recordcsv#
|
||||
return substitute(a:match, '\%(^ \+\)\|\%( \+\ze'.b:delimiter. '\?$\)', '', 'g')
|
||||
endfu
|
||||
fu! csv#CalculateColumnWidth(row) "{{{3
|
||||
fu! csv#CalculateColumnWidth(row, silent) "{{{3
|
||||
" Internal function, not called from external,
|
||||
" does not work with fixed width columns
|
||||
" row for the row for which to calculate the width
|
||||
@@ -763,7 +762,7 @@ fu! csv#CalculateColumnWidth(row) "{{{3
|
||||
endif
|
||||
let s:max_cols=csv#MaxColumns(line('.'))
|
||||
for i in range(1,s:max_cols)
|
||||
call add(b:col_width, csv#ColWidth(i, a:row))
|
||||
call add(b:col_width, csv#ColWidth(i, a:row, a:silent))
|
||||
endfor
|
||||
catch /csv:no_col/
|
||||
call csv#Warn("Error: getting Column numbers, aborting!")
|
||||
@@ -1053,7 +1052,7 @@ fu! csv#MoveCol(forward, line, ...) "{{{3
|
||||
let maxcol=csv#MaxColumns(line('.'))
|
||||
let cpos=getpos('.')[2]
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
let curwidth=CSVWidth()
|
||||
let curwidth=CSVWidth(1)
|
||||
call search(b:col, 'bc', line('.'))
|
||||
endif
|
||||
let spos=getpos('.')[2]
|
||||
@@ -1146,7 +1145,7 @@ fu! csv#MoveCol(forward, line, ...) "{{{3
|
||||
" leave the column (if the next column is shorter)
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
let a = getpos('.')
|
||||
if CSVWidth() == curwidth
|
||||
if CSVWidth(1) == curwidth
|
||||
let a[2]+= cpos-spos
|
||||
endif
|
||||
else
|
||||
@@ -1159,7 +1158,7 @@ fu! csv#MoveCol(forward, line, ...) "{{{3
|
||||
" Move to the correct screen column
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
let a = getpos('.')
|
||||
if CSVWidth() == curwidth
|
||||
if CSVWidth(1) == curwidth
|
||||
let a[2]+= cpos-spos
|
||||
endif
|
||||
else
|
||||
@@ -1835,7 +1834,7 @@ fu! csv#ProcessFieldValue(field) "{{{3
|
||||
|
||||
if a == b:delimiter
|
||||
try
|
||||
let a=repeat(' ', csv#ColWidth(col))
|
||||
let a=repeat(' ', csv#ColWidth(col, line('$'), 1))
|
||||
catch
|
||||
" no-op
|
||||
endtry
|
||||
@@ -2134,7 +2133,7 @@ fu! csv#NewRecord(line1, line2, count) "{{{3
|
||||
if !exists("b:col_width")
|
||||
" Best guess width
|
||||
if exists("b:csv_fixed_width_cols")
|
||||
let record .= printf("%*s", csv#ColWidth(item),
|
||||
let record .= printf("%*s", csv#ColWidth(item, line('$'), 1),
|
||||
\ b:delimiter)
|
||||
else
|
||||
let record .= printf("%20s", b:delimiter)
|
||||
@@ -3145,7 +3144,9 @@ fu! CSVCount(col, fmt, first, last, ...) "{{{3
|
||||
unlet! s:additional['distinct']
|
||||
return (empty(result) ? 0 : result)
|
||||
endfu
|
||||
fu! CSVWidth() "{{{3
|
||||
fu! CSVWidth(...) "{{{3
|
||||
" do not output any warning
|
||||
let silent = get(a:000, 0, 1)
|
||||
" does not work with fixed width columns
|
||||
if exists("b:csv_fixed_width_cols")
|
||||
let c = getline(1,'$')
|
||||
@@ -3164,7 +3165,7 @@ fu! CSVWidth() "{{{3
|
||||
" Add width for last column
|
||||
call add(width, max-y+1)
|
||||
else
|
||||
call csv#CalculateColumnWidth('')
|
||||
call csv#CalculateColumnWidth(line('$'), silent)
|
||||
let width=map(copy(b:col_width), 'v:val-1')
|
||||
endif
|
||||
return width
|
||||
|
||||
@@ -353,7 +353,7 @@ function! go#config#FmtCommand() abort
|
||||
endfunction
|
||||
|
||||
function! go#config#FmtOptions() abort
|
||||
return get(g:, "go_fmt_options", {})
|
||||
return get(b:, "go_fmt_options", get(g:, "go_fmt_options", {}))
|
||||
endfunction
|
||||
|
||||
function! go#config#FmtFailSilently() abort
|
||||
@@ -368,9 +368,9 @@ function! go#config#PlayOpenBrowser() abort
|
||||
return get(g:, "go_play_open_browser", 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#GorenameCommand() abort
|
||||
function! go#config#RenameCommand() abort
|
||||
" delegate to go#config#GorenameBin for backwards compatability.
|
||||
return get(g:, "go_gorename_command", go#config#GorenameBin())
|
||||
return get(g:, "go_rename_command", go#config#GorenameBin())
|
||||
endfunction
|
||||
|
||||
function! go#config#GorenameBin() abort
|
||||
@@ -520,6 +520,10 @@ function! go#config#GoplsUsePlaceholders() abort
|
||||
return get(g:, 'go_gopls_use_placeholders', 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsEnabled() abort
|
||||
return get(g:, 'go_gopls_enabled', 1)
|
||||
endfunction
|
||||
|
||||
" Set the default value. A value of "1" is a shortcut for this, for
|
||||
" compatibility reasons.
|
||||
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1
|
||||
|
||||
@@ -70,9 +70,9 @@ function s:is_jsx_element(syntax)
|
||||
return a:syntax =~? 'jsxElement'
|
||||
endfunction
|
||||
|
||||
" Whether the specified syntax group is the jsxEscapeJs
|
||||
function s:is_jsx_escape(syntax)
|
||||
return a:syntax =~? 'jsxEscapeJs'
|
||||
" Whether the specified syntax group is the jsxExpressionBlock
|
||||
function s:is_jsx_expression(syntax)
|
||||
return a:syntax =~? 'jsxExpressionBlock'
|
||||
endfunction
|
||||
|
||||
" Whether the specified syntax group is the jsxBraces
|
||||
@@ -191,7 +191,7 @@ endfunction
|
||||
" - jsxRegion
|
||||
" - jsxTaggedRegion
|
||||
" - jsxElement
|
||||
" - jsxEscapeJs
|
||||
" - jsxExpressionBlock
|
||||
" - Other
|
||||
function s:syntax_context(lnum)
|
||||
let start_col = s:start_col(a:lnum)
|
||||
@@ -201,9 +201,9 @@ function s:syntax_context(lnum)
|
||||
let i = 0
|
||||
|
||||
for syntax_name in reversed
|
||||
" If the current line is jsxEscapeJs and not starts with jsxBraces
|
||||
if s:is_jsx_escape(syntax_name)
|
||||
return 'jsxEscapeJs'
|
||||
" If the current line is jsxExpressionBlock and not starts with jsxBraces
|
||||
if s:is_jsx_expression(syntax_name)
|
||||
return 'jsxExpressionBlock'
|
||||
endif
|
||||
|
||||
if s:is_jsx_region(syntax_name)
|
||||
@@ -287,7 +287,7 @@ function! jsx_pretty#indent#get(js_indent)
|
||||
endif
|
||||
|
||||
return s:jsx_indent_element(v:lnum)
|
||||
elseif syntax_context == 'jsxEscapeJs'
|
||||
elseif syntax_context == 'jsxExpressionBlock'
|
||||
let prev_lnum = s:prev_lnum(v:lnum)
|
||||
let prev_line = s:trim(getline(prev_lnum))
|
||||
|
||||
|
||||
532
autoload/markdown.vim
Normal file
532
autoload/markdown.vim
Normal file
@@ -0,0 +1,532 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||
|
||||
|
||||
" {{{ FOLDING
|
||||
|
||||
function! markdown#FoldLevelOfLine(lnum)
|
||||
let currentline = getline(a:lnum)
|
||||
let nextline = getline(a:lnum + 1)
|
||||
|
||||
" an empty line is not going to change the indentation level
|
||||
if match(currentline, '^\s*$') >= 0
|
||||
return '='
|
||||
endif
|
||||
|
||||
" folding lists
|
||||
if s:SyntaxGroupOfLineIs(a:lnum, '^markdownListItem')
|
||||
if s:SyntaxGroupOfLineIs(a:lnum - 1, '^markdownListItem')
|
||||
return 'a1'
|
||||
endif
|
||||
if s:SyntaxGroupOfLineIs(a:lnum + 1, '^markdownListItem')
|
||||
return 's1'
|
||||
endif
|
||||
return '='
|
||||
endif
|
||||
|
||||
" we are not going to fold things inside list items, too hairy
|
||||
let is_inside_a_list_item = s:SyntaxGroupOfLineIs(a:lnum, '^markdownListItem')
|
||||
if is_inside_a_list_item
|
||||
return '='
|
||||
endif
|
||||
|
||||
" folding atx headers
|
||||
if match(currentline, '^#\{1,6}\s') >= 0
|
||||
let header_level = strlen(substitute(currentline, '^\(#\{1,6}\).*', '\1', ''))
|
||||
return '>' . header_level
|
||||
endif
|
||||
|
||||
" folding fenced code blocks
|
||||
let next_line_syntax_group = synIDattr(synID(a:lnum + 1, 1, 1), 'name')
|
||||
if match(currentline, '^\s*```') >= 0
|
||||
if next_line_syntax_group ==# 'markdownFencedCodeBlock'
|
||||
return 'a1'
|
||||
endif
|
||||
return 's1'
|
||||
endif
|
||||
|
||||
" folding code blocks
|
||||
let current_line_syntax_group = synIDattr(synID(a:lnum, 1, 1), 'name')
|
||||
let prev_line_syntax_group = synIDattr(synID(a:lnum - 1, 1, 1), 'name')
|
||||
if match(currentline, '^\s\{4,}') >= 0
|
||||
if current_line_syntax_group ==# 'markdownCodeBlock'
|
||||
if prev_line_syntax_group !=# 'markdownCodeBlock'
|
||||
return 'a1'
|
||||
endif
|
||||
if next_line_syntax_group !=# 'markdownCodeBlock'
|
||||
return 's1'
|
||||
endif
|
||||
endif
|
||||
return '='
|
||||
endif
|
||||
|
||||
" folding setex headers
|
||||
if (match(currentline, '^.*$') >= 0)
|
||||
if (match(nextline, '^=\+$') >= 0)
|
||||
return '>1'
|
||||
endif
|
||||
if (match(nextline, '^-\+$') >= 0)
|
||||
return '>2'
|
||||
endif
|
||||
endif
|
||||
|
||||
return '='
|
||||
endfunction
|
||||
|
||||
function! s:SyntaxGroupOfLineIs(lnum, pattern)
|
||||
let stack = synstack(a:lnum, a:cnum)
|
||||
if len(stack) > 0
|
||||
return synIDattr(stack[0], 'name') =~# a:pattern
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" }}}
|
||||
|
||||
" {{{ EDIT
|
||||
|
||||
function! markdown#EditBlock() range abort
|
||||
if exists('b:markdown_temporary_buffer') && b:markdown_temporary_buffer
|
||||
echo 'Sorry, you cannot edit a code block inside a temporary buffer'
|
||||
return
|
||||
endif
|
||||
" Github fenced code blocks like ```ruby
|
||||
let code_block = s:LocateFencedCodeBlock(a:firstline,
|
||||
\ '^\s*`\{3,}\(\w\+\)\%(\s.*$\|$\)',
|
||||
\ '^\s*`\{3,}\s*$'
|
||||
\ )
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
" Github fenced code blocks with metadata like ```{ruby, <WHATEVER>}
|
||||
let code_block = s:LocateFencedCodeBlock(a:firstline,
|
||||
\ '^\s*`\{3,}{\(\w\+\),[^}]\+}\%(\s.*$\|$\)',
|
||||
\ '^\s*`\{3,}\s*$'
|
||||
\ )
|
||||
endif
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
" Github fenced code blocks alternate style like ~~~ruby
|
||||
let code_block = s:LocateFencedCodeBlock(a:firstline,
|
||||
\ '^\s*\~\{3,}\(\w\+\)\%(\s.*$\|$\)',
|
||||
\ '^\s*\~\{3,}\s*$'
|
||||
\ )
|
||||
endif
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
" Liquid fenced code blocks {% highlight ruby %}
|
||||
" (since we support some liquid/jekyll tags, why not?)
|
||||
let code_block = s:LocateFencedCodeBlock(a:firstline,
|
||||
\ '^\s*{%\s*highlight\s\+\(\w\+\)\s*%}\%(\s.*$\|$\)',
|
||||
\ '^\s*{%\s*endhighlight\s*%}\%(\s.*$\|$\)'
|
||||
\ )
|
||||
endif
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
let code_block = s:LocateRangeBlock(a:firstline, a:lastline)
|
||||
endif
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
echo 'Sorry, I did not find any suitable code block to edit or create'
|
||||
return
|
||||
endif
|
||||
|
||||
let code_block['file_extension'] = '.' . code_block['language']
|
||||
if has_key(s:known_file_extensions, code_block['language'])
|
||||
let code_block['file_extension'] = s:known_file_extensions[code_block['language']]
|
||||
endif
|
||||
let code_block['file_path'] = tempname() . code_block['file_extension']
|
||||
let code_block['content'] = getline(code_block['from'], code_block['to'])
|
||||
let code_block['content'] = s:UnindentBlock(code_block['content'], code_block['indentation'])
|
||||
|
||||
call writefile(code_block['content'], code_block['file_path'])
|
||||
augroup MarkdownReplaceEditedBlock
|
||||
autocmd BufEnter <buffer> call s:ReplaceEditedBlock()
|
||||
augroup END
|
||||
|
||||
let b:code_block = code_block
|
||||
execute 'split ' . code_block['file_path']
|
||||
let b:markdown_temporary_buffer = 1
|
||||
autocmd BufLeave <buffer> wq
|
||||
endfunction
|
||||
|
||||
function! s:ReplaceEditedBlock()
|
||||
augroup MarkdownReplaceEditedBlock
|
||||
autocmd!
|
||||
augroup END
|
||||
augroup! MarkdownReplaceEditedBlock
|
||||
|
||||
if b:code_block['to'] - b:code_block['from'] >= 0
|
||||
execute b:code_block['from'] . ',' b:code_block['to'] . ' delete _'
|
||||
endif
|
||||
let content = readfile(b:code_block['file_path'])
|
||||
let content = s:IndentBlock(l:content, b:code_block['indentation'])
|
||||
let content = s:SurroundWithFencedCodeBlock(l:content, b:code_block)
|
||||
call append(b:code_block['from']-1, content)
|
||||
call setpos('.', b:code_block['back_to_position'])
|
||||
|
||||
execute 'silent bwipeout! ' . b:code_block['file_path']
|
||||
call delete(b:code_block['file_path'])
|
||||
unlet! b:code_block
|
||||
endfunction
|
||||
|
||||
function! s:UnindentBlock(content, indentation)
|
||||
return map(a:content, 'substitute(v:val, ''^' . a:indentation . ''', '''', ''g'')')
|
||||
endfunction
|
||||
|
||||
function! s:IndentBlock(content, indentation)
|
||||
return map(a:content, 'substitute(v:val, ''^'', ''' . a:indentation . ''', ''g'')')
|
||||
endfunction
|
||||
|
||||
function! s:SurroundWithFencedCodeBlock(code, editing)
|
||||
if !a:editing['surround'] | return a:code | endif
|
||||
if a:editing['language'] =~# 'markdown' | return a:code | endif
|
||||
let before =
|
||||
\ (a:editing['make_room_before'] ? [''] : []) +
|
||||
\ [a:editing['indentation'] . '```' . a:editing['language']]
|
||||
let after =
|
||||
\ [a:editing['indentation'] . '```'] +
|
||||
\ (a:editing['make_room_after'] ? [''] : [])
|
||||
return l:before + a:code + l:after
|
||||
endfunction
|
||||
|
||||
function! s:LocateRangeBlock(from, to)
|
||||
" TODO: extract initialize_code_block
|
||||
let code_block = {'from': 0, 'to': 0, 'language': 'txt', 'indentation': '', 'surround': 0}
|
||||
if a:to >= a:from
|
||||
let code_block['from'] = a:from
|
||||
let code_block['to'] = a:to
|
||||
let code_block['back_to_position'] = getpos('.')
|
||||
let code_block['language'] = 'markdown'
|
||||
|
||||
if a:from == a:to && getline(a:from) =~ '^\s*$'
|
||||
let code_block['surround'] = 1
|
||||
let code_block['make_room_before'] = getline(a:from - 1) !~ '^\s*$'
|
||||
let code_block['make_room_after'] = getline(a:to + 1) !~ '^\s*$'
|
||||
let code_block['language'] = input('filetype? (default: markdown) ', '', 'filetype')
|
||||
if code_block['language'] =~ '^\s*$'
|
||||
let code_block['language'] = 'markdown'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return code_block
|
||||
endfunction
|
||||
|
||||
function! s:LocateFencedCodeBlock(starting_from, upper_delimiter, lower_delimiter)
|
||||
" TODO: extract initialize_code_block
|
||||
let code_block = {'from': 0, 'to': 0, 'language': 'txt', 'indentation': '', 'surround': 0}
|
||||
let initial_position = getpos('.')
|
||||
let search_position = copy(initial_position)
|
||||
let search_position[1] = a:starting_from
|
||||
let search_position[2] = 0
|
||||
cal setpos('.', search_position)
|
||||
|
||||
let start_code_block_backward = search(a:upper_delimiter, 'cbnW')
|
||||
let end_code_block_backward = search(a:lower_delimiter, 'cbnW')
|
||||
let end_code_block_forward = search(a:lower_delimiter, 'cnW')
|
||||
|
||||
let found_code_block =
|
||||
\ start_code_block_backward > 0 &&
|
||||
\ end_code_block_forward > 0
|
||||
let between_two_code_blocks =
|
||||
\ start_code_block_backward < end_code_block_backward &&
|
||||
\ end_code_block_backward <= a:starting_from
|
||||
let starting_inside_code_block =
|
||||
\ found_code_block &&
|
||||
\ !between_two_code_blocks &&
|
||||
\ start_code_block_backward <= a:starting_from &&
|
||||
\ end_code_block_forward >= a:starting_from
|
||||
|
||||
if starting_inside_code_block
|
||||
let code_block['language'] = s:ExtractLanguage(start_code_block_backward, a:upper_delimiter)
|
||||
let code_block['indentation'] = s:ExtractIndentation(start_code_block_backward)
|
||||
let code_block['back_to_position'] = initial_position
|
||||
let code_block['back_to_position'][1] = start_code_block_backward
|
||||
let code_block['back_to_position'][2] = 0
|
||||
let code_block['from'] = start_code_block_backward + 1
|
||||
let code_block['to'] = end_code_block_forward - 1
|
||||
endif
|
||||
return code_block
|
||||
endfunction
|
||||
|
||||
function! s:ExtractLanguage(start_at, upper_delimiter)
|
||||
return substitute(getline(a:start_at), a:upper_delimiter, '\1', '')
|
||||
endfunction
|
||||
|
||||
function! s:ExtractIndentation(start_at)
|
||||
return substitute(getline(a:start_at), '\(^\s*\).\+$', '\1', '')
|
||||
endfunction
|
||||
|
||||
let s:known_file_extensions = {
|
||||
\ 'abap': '.abap',
|
||||
\ 'antlr': '.g4',
|
||||
\ 'asp': '.asp',
|
||||
\ 'ats': '.dats',
|
||||
\ 'actionscript': '.as',
|
||||
\ 'ada': '.adb',
|
||||
\ 'agda': '.agda',
|
||||
\ 'apacheconf': '.apacheconf',
|
||||
\ 'apex': '.cls',
|
||||
\ 'applescript': '.applescript',
|
||||
\ 'arc': '.arc',
|
||||
\ 'arduino': '.ino',
|
||||
\ 'asciidoc': '.asciidoc',
|
||||
\ 'assembly': '.asm',
|
||||
\ 'augeas': '.aug',
|
||||
\ 'autohotkey': '.ahk',
|
||||
\ 'autoit': '.au3',
|
||||
\ 'awk': '.awk',
|
||||
\ 'batchfile': '.bat',
|
||||
\ 'befunge': '.befunge',
|
||||
\ 'blitzbasic': '.bb',
|
||||
\ 'blitzmax': '.bmx',
|
||||
\ 'bluespec': '.bsv',
|
||||
\ 'boo': '.boo',
|
||||
\ 'brainfuck': '.b',
|
||||
\ 'brightscript': '.brs',
|
||||
\ 'bro': '.bro',
|
||||
\ 'c': '.c',
|
||||
\ 'c++': '.cpp',
|
||||
\ 'cpp': '.cpp',
|
||||
\ 'clips': '.clp',
|
||||
\ 'cmake': '.cmake',
|
||||
\ 'cobol': '.cob',
|
||||
\ 'css': '.css',
|
||||
\ 'ceylon': '.ceylon',
|
||||
\ 'chuck': '.ck',
|
||||
\ 'cirru': '.cirru',
|
||||
\ 'clean': '.icl',
|
||||
\ 'clojure': '.clj',
|
||||
\ 'coffeescript': '.coffee',
|
||||
\ 'coldfusion': '.cfm',
|
||||
\ 'coq': '.coq',
|
||||
\ 'creole': '.creole',
|
||||
\ 'crystal': '.cr',
|
||||
\ 'cucumber': '.feature',
|
||||
\ 'cuda': '.cu',
|
||||
\ 'cython': '.pyx',
|
||||
\ 'd': '.d',
|
||||
\ 'dm': '.dm',
|
||||
\ 'dot': '.dot',
|
||||
\ 'dart': '.dart',
|
||||
\ 'diff': '.diff',
|
||||
\ 'dylan': '.dylan',
|
||||
\ 'ecl': '.ecl',
|
||||
\ 'eiffel': '.e',
|
||||
\ 'elixir': '.ex',
|
||||
\ 'elm': '.elm',
|
||||
\ 'erlang': '.erl',
|
||||
\ 'flux': '.fx',
|
||||
\ 'fortran': '.f90',
|
||||
\ 'factor': '.factor',
|
||||
\ 'fancy': '.fy',
|
||||
\ 'fantom': '.fan',
|
||||
\ 'forth': '.fth',
|
||||
\ 'gas': '.s',
|
||||
\ 'glsl': '.glsl',
|
||||
\ 'genshi': '.kid',
|
||||
\ 'glyph': '.glf',
|
||||
\ 'go': '.go',
|
||||
\ 'gosu': '.gs',
|
||||
\ 'groff': '.man',
|
||||
\ 'groovy': '.groovy',
|
||||
\ 'html': '.html',
|
||||
\ 'http': '.http',
|
||||
\ 'haml': '.haml',
|
||||
\ 'handlebars': '.handlebars',
|
||||
\ 'harbour': '.hb',
|
||||
\ 'haskell': '.hs',
|
||||
\ 'haxe': '.hx',
|
||||
\ 'hy': '.hy',
|
||||
\ 'idl': '.pro',
|
||||
\ 'ini': '.ini',
|
||||
\ 'idris': '.idr',
|
||||
\ 'io': '.io',
|
||||
\ 'ioke': '.ik',
|
||||
\ 'j': '.ijs',
|
||||
\ 'json': '.json',
|
||||
\ 'json5': '.json5',
|
||||
\ 'jsonld': '.jsonld',
|
||||
\ 'jade': '.jade',
|
||||
\ 'java': '.java',
|
||||
\ 'javascript': '.js',
|
||||
\ 'julia': '.jl',
|
||||
\ 'krl': '.krl',
|
||||
\ 'kotlin': '.kt',
|
||||
\ 'lfe': '.lfe',
|
||||
\ 'llvm': '.ll',
|
||||
\ 'lasso': '.lasso',
|
||||
\ 'less': '.less',
|
||||
\ 'lilypond': '.ly',
|
||||
\ 'livescript': '.ls',
|
||||
\ 'logos': '.xm',
|
||||
\ 'logtalk': '.lgt',
|
||||
\ 'lua': '.lua',
|
||||
\ 'm': '.mumps',
|
||||
\ 'makefile': '.mak',
|
||||
\ 'mako': '.mako',
|
||||
\ 'markdown': '.md',
|
||||
\ 'mask': '.mask',
|
||||
\ 'matlab': '.matlab',
|
||||
\ 'max': '.maxpat',
|
||||
\ 'mediawiki': '.mediawiki',
|
||||
\ 'mirah': '.druby',
|
||||
\ 'monkey': '.monkey',
|
||||
\ 'moocode': '.moo',
|
||||
\ 'moonscript': '.moon',
|
||||
\ 'myghty': '.myt',
|
||||
\ 'nsis': '.nsi',
|
||||
\ 'nemerle': '.n',
|
||||
\ 'netlogo': '.nlogo',
|
||||
\ 'nginx': '.nginxconf',
|
||||
\ 'nimrod': '.nim',
|
||||
\ 'nu': '.nu',
|
||||
\ 'numpy': '.numpy',
|
||||
\ 'ocaml': '.ml',
|
||||
\ 'objdump': '.objdump',
|
||||
\ 'omgrofl': '.omgrofl',
|
||||
\ 'opa': '.opa',
|
||||
\ 'opencl': '.cl',
|
||||
\ 'org': '.org',
|
||||
\ 'oxygene': '.oxygene',
|
||||
\ 'pawn': '.pwn',
|
||||
\ 'php': '.php',
|
||||
\ 'parrot': '.parrot',
|
||||
\ 'pascal': '.pas',
|
||||
\ 'perl': '.pl',
|
||||
\ 'perl6': '.p6',
|
||||
\ 'pike': '.pike',
|
||||
\ 'pod': '.pod',
|
||||
\ 'pogoscript': '.pogo',
|
||||
\ 'postscript': '.ps',
|
||||
\ 'powershell': '.ps1',
|
||||
\ 'processing': '.pde',
|
||||
\ 'prolog': '.prolog',
|
||||
\ 'puppet': '.pp',
|
||||
\ 'python': '.py',
|
||||
\ 'qml': '.qml',
|
||||
\ 'r': '.r',
|
||||
\ 'rdoc': '.rdoc',
|
||||
\ 'realbasic': '.rbbas',
|
||||
\ 'rhtml': '.rhtml',
|
||||
\ 'rmarkdown': '.rmd',
|
||||
\ 'racket': '.rkt',
|
||||
\ 'rebol': '.rebol',
|
||||
\ 'redcode': '.cw',
|
||||
\ 'robotframework': '.robot',
|
||||
\ 'rouge': '.rg',
|
||||
\ 'ruby': '.rb',
|
||||
\ 'rust': '.rs',
|
||||
\ 'scss': '.scss',
|
||||
\ 'sql': '.sql',
|
||||
\ 'sage': '.sage',
|
||||
\ 'sass': '.sass',
|
||||
\ 'scala': '.scala',
|
||||
\ 'scaml': '.scaml',
|
||||
\ 'scheme': '.scm',
|
||||
\ 'scilab': '.sci',
|
||||
\ 'self': '.self',
|
||||
\ 'shell': '.sh',
|
||||
\ 'shen': '.shen',
|
||||
\ 'slash': '.sl',
|
||||
\ 'smalltalk': '.st',
|
||||
\ 'smarty': '.tpl',
|
||||
\ 'squirrel': '.nut',
|
||||
\ 'stylus': '.styl',
|
||||
\ 'supercollider': '.scd',
|
||||
\ 'toml': '.toml',
|
||||
\ 'txl': '.txl',
|
||||
\ 'tcl': '.tcl',
|
||||
\ 'tcsh': '.tcsh',
|
||||
\ 'tex': '.tex',
|
||||
\ 'tea': '.tea',
|
||||
\ 'textile': '.textile',
|
||||
\ 'turing': '.t',
|
||||
\ 'twig': '.twig',
|
||||
\ 'typescript': '.ts',
|
||||
\ 'unrealscript': '.uc',
|
||||
\ 'vhdl': '.vhdl',
|
||||
\ 'vala': '.vala',
|
||||
\ 'verilog': '.v',
|
||||
\ 'viml': '.vim',
|
||||
\ 'volt': '.volt',
|
||||
\ 'xc': '.xc',
|
||||
\ 'xml': '.xml',
|
||||
\ 'xproc': '.xpl',
|
||||
\ 'xquery': '.xquery',
|
||||
\ 'xs': '.xs',
|
||||
\ 'xslt': '.xslt',
|
||||
\ 'xtend': '.xtend',
|
||||
\ 'yaml': '.yml',
|
||||
\ 'ec': '.ec',
|
||||
\ 'edn': '.edn',
|
||||
\ 'fish': '.fish',
|
||||
\ 'mupad': '.mu',
|
||||
\ 'nesc': '.nc',
|
||||
\ 'ooc': '.ooc',
|
||||
\ 'restructuredtext': '.rst',
|
||||
\ 'wisp': '.wisp',
|
||||
\ 'xbase': '.prg',
|
||||
\ }
|
||||
|
||||
" }}}
|
||||
|
||||
" {{{ FORMAT
|
||||
function! markdown#FormatTable()
|
||||
let p = '^\s*|\s.*\s|\s*$'
|
||||
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
|
||||
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
|
||||
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
|
||||
let separator_line_number = search('^\s*|\s*-\{3,}', 'cbnW')
|
||||
|
||||
call s:ShrinkTableHeaderSeparator(separator_line_number)
|
||||
Tabularize/|/l1
|
||||
call s:ExpandTableHeaderSeparator(separator_line_number)
|
||||
normal! 0
|
||||
|
||||
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:ShrinkTableHeaderSeparator(separator_line_number)
|
||||
if a:separator_line_number > 0
|
||||
let separator_line = getline(a:separator_line_number)
|
||||
let separator_line = substitute(separator_line, '-\+', '---', 'g')
|
||||
call setline(a:separator_line_number, separator_line)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:ExpandTableHeaderSeparator(separator_line_number)
|
||||
if a:separator_line_number > 0
|
||||
let separator_line = getline(a:separator_line_number)
|
||||
let separator_line = substitute(
|
||||
\ separator_line,
|
||||
\ '|\([^|]*\)',
|
||||
\ '\="| " . repeat("-", strlen(submatch(1)) - 2) . " "',
|
||||
\ 'g')
|
||||
let separator_line = substitute(separator_line, '\s*$', '', '')
|
||||
call setline(a:separator_line_number, separator_line)
|
||||
endif
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
" {{{ SWITCH STATUS
|
||||
function! markdown#SwitchStatus()
|
||||
let current_line = getline('.')
|
||||
if match(current_line, '^\s*[*\-+] \[ \]') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*[*\-+]\) \[ \]', '\1 [x]', ''))
|
||||
return
|
||||
endif
|
||||
if match(current_line, '^\s*[*\-+] \[x\]') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*[*\-+]\) \[x\]', '\1', ''))
|
||||
return
|
||||
endif
|
||||
if match(current_line, '^\s*[*\-+] \(\[[x ]\]\)\@!') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*[*\-+]\)', '\1 [ ]', ''))
|
||||
return
|
||||
endif
|
||||
if match(current_line, '^\s*#\{1,5}\s') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*#\{1,5}\) \(.*$\)', '\1# \2', ''))
|
||||
return
|
||||
endif
|
||||
if match(current_line, '^\s*#\{6}\s') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*\)#\{6} \(.*$\)', '\1# \2', ''))
|
||||
return
|
||||
endif
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
endif
|
||||
@@ -1,6 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
" Author: Kevin Ballard
|
||||
" Description: Helper functions for Rust commands/mappings
|
||||
" Last Modified: May 27, 2014
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
@@ -510,16 +509,23 @@ function! s:SearchTestFunctionNameUnderCursor() abort
|
||||
return matchstr(getline(test_func_line), '\m\C^\s*fn\s\+\zs\h\w*')
|
||||
endfunction
|
||||
|
||||
function! rust#Test(all, options) abort
|
||||
function! rust#Test(mods, winsize, all, options) abort
|
||||
let manifest = findfile('Cargo.toml', expand('%:p:h') . ';')
|
||||
if manifest ==# ''
|
||||
return rust#Run(1, '--test ' . a:options)
|
||||
endif
|
||||
|
||||
" <count> defaults to 0, but we prefer an empty string
|
||||
let winsize = a:winsize ? a:winsize : ''
|
||||
|
||||
if has('terminal')
|
||||
let cmd = 'terminal '
|
||||
if has('patch-8.0.910')
|
||||
let cmd = printf('%s noautocmd %snew | terminal ++curwin ', a:mods, winsize)
|
||||
else
|
||||
let cmd = printf('%s terminal ', a:mods)
|
||||
endif
|
||||
elseif has('nvim')
|
||||
let cmd = 'noautocmd new | terminal '
|
||||
let cmd = printf('%s noautocmd %snew | terminal ', a:mods, winsize)
|
||||
else
|
||||
let cmd = '!'
|
||||
let manifest = shellescape(manifest)
|
||||
|
||||
@@ -746,6 +746,10 @@ let g:xmldata_html5 = {
|
||||
\ [],
|
||||
\ global_attributes
|
||||
\ ],
|
||||
\ 'slot': [
|
||||
\ [],
|
||||
\ extend(copy(global_attributes), {'name': []})
|
||||
\ ],
|
||||
\ 'small': [
|
||||
\ phrasing_elements,
|
||||
\ global_attributes
|
||||
|
||||
3
build
3
build
@@ -233,7 +233,7 @@ PACKS="
|
||||
log:MTDL9/vim-log-highlighting
|
||||
lua:tbastos/vim-lua
|
||||
mako:sophacles/vim-bundle-mako
|
||||
markdown:plasticboy/vim-markdown:_SYNTAX
|
||||
markdown:gabrielelana/vim-markdown
|
||||
mathematica:voldikss/vim-mma
|
||||
mdx:jxnblk/vim-mdx-js
|
||||
meson:mesonbuild/meson:_ALL:/data/syntax-highlighting/vim/
|
||||
@@ -292,6 +292,7 @@ PACKS="
|
||||
tptp:c-cube/vim-tptp
|
||||
twig:lumiliet/vim-twig
|
||||
typescript:HerringtonDarkholme/yats.vim
|
||||
v:ollykel/v-vim
|
||||
vala:arrufat/vala.vim
|
||||
vbnet:vim-scripts/vbnet.vim
|
||||
vcl:smerrill/vcl-vim-plugin
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -
|
||||
" Vim compiler file
|
||||
" Compiler: Cucumber
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2010 Aug 09
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
12
config.vim
12
config.vim
@@ -1,3 +1,15 @@
|
||||
if !exists('g:markdown_enable_spell_checking')
|
||||
let g:markdown_enable_spell_checking = 0
|
||||
end
|
||||
|
||||
if !exists('g:markdown_enable_input_abbreviations')
|
||||
let g:markdown_enable_input_abbreviations = 0
|
||||
end
|
||||
|
||||
if !exists('g:markdown_enable_mappings')
|
||||
let g:markdown_enable_mappings = 0
|
||||
end
|
||||
|
||||
" Enable jsx syntax by default
|
||||
if !exists('g:jsx_ext_required')
|
||||
let g:jsx_ext_required = 0
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
if !exists('g:markdown_enable_spell_checking')
|
||||
let g:markdown_enable_spell_checking = 0
|
||||
end
|
||||
|
||||
if !exists('g:markdown_enable_input_abbreviations')
|
||||
let g:markdown_enable_input_abbreviations = 0
|
||||
end
|
||||
|
||||
if !exists('g:markdown_enable_mappings')
|
||||
let g:markdown_enable_mappings = 0
|
||||
end
|
||||
|
||||
" Enable jsx syntax by default
|
||||
if !exists('g:jsx_ext_required')
|
||||
let g:jsx_ext_required = 0
|
||||
@@ -781,15 +793,8 @@ endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||
augroup filetypedetect
|
||||
" markdown, from markdown.vim in plasticboy/vim-markdown:_SYNTAX
|
||||
if !has('patch-7.4.480')
|
||||
" Before this patch, vim used modula2 for .md.
|
||||
au! filetypedetect BufRead,BufNewFile *.md
|
||||
endif
|
||||
|
||||
" markdown filetype file
|
||||
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} setfiletype markdown
|
||||
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} setfiletype markdown
|
||||
" markdown, from markdown.vim in gabrielelana/vim-markdown
|
||||
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown
|
||||
augroup end
|
||||
endif
|
||||
|
||||
@@ -1473,10 +1478,17 @@ autocmd BufNewFile,BufRead *.tsx setlocal filetype=typescriptreact
|
||||
augroup end
|
||||
endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'v') == -1
|
||||
augroup filetypedetect
|
||||
" v, from vlang.vim in ollykel/v-vim
|
||||
au BufNewFile,BufRead *.v set filetype=vlang
|
||||
au BufNewFile,BufRead *.v set syntax=vlang
|
||||
augroup end
|
||||
endif
|
||||
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
|
||||
augroup filetypedetect
|
||||
" vala, from vala.vim in arrufat/vala.vim
|
||||
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
||||
au BufRead,BufNewFile *.vala,*.vapi,*.valadoc setfiletype vala
|
||||
augroup end
|
||||
endif
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
|
||||
" Slow yaml highlighting workaround
|
||||
if exists('+regexpengine') && ('®expengine' == 0)
|
||||
setlocal regexpengine=1
|
||||
endif
|
||||
set isfname+=@-@
|
||||
set path+=./../templates,./../files,templates,files
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -
|
||||
" Vim filetype plugin
|
||||
" Language: Cucumber
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 Jun 01
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
|
||||
@@ -27,6 +27,7 @@ let &l:errorformat =
|
||||
|
||||
setlocal includeexpr=dart#resolveUri(v:fname)
|
||||
setlocal isfname+=:
|
||||
setlocal iskeyword+=$
|
||||
|
||||
let b:undo_ftplugin = 'setl et< fo< sw< sts< com< cms< inex< isf<'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim filetype plugin
|
||||
" Language: generic git output
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 May 30
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim filetype plugin
|
||||
" Language: git commit file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 May 30
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim filetype plugin
|
||||
" Language: git rebase --interactive
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2010 May 21
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
@@ -20,12 +20,15 @@ if !exists("b:undo_ftplugin")
|
||||
endif
|
||||
let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo< ml<"
|
||||
|
||||
function! s:choose(word)
|
||||
function! s:choose(word) abort
|
||||
s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e
|
||||
endfunction
|
||||
|
||||
function! s:cycle()
|
||||
call s:choose(get({'s':'edit','p':'squash','e':'reword','r':'fixup'},getline('.')[0],'pick'))
|
||||
function! s:cycle(count) abort
|
||||
let words = ['pick', 'edit', 'fixup', 'squash', 'reword', 'drop']
|
||||
let index = index(map(copy(words), 'v:val[0]'), getline('.')[0])
|
||||
let index = ((index < 0 ? 0 : index) + 10000 * len(words) + a:count) % len(words)
|
||||
call s:choose(words[index])
|
||||
endfunction
|
||||
|
||||
command! -buffer -bar -range Pick :<line1>,<line2>call s:choose('pick')
|
||||
@@ -34,16 +37,16 @@ command! -buffer -bar -range Edit :<line1>,<line2>call s:choose('edit')
|
||||
command! -buffer -bar -range Reword :<line1>,<line2>call s:choose('reword')
|
||||
command! -buffer -bar -range Fixup :<line1>,<line2>call s:choose('fixup')
|
||||
command! -buffer -bar -range Drop :<line1>,<line2>call s:choose('drop')
|
||||
command! -buffer -bar Cycle :call s:cycle()
|
||||
" The above are more useful when they are mapped; for example:
|
||||
"nnoremap <buffer> <silent> S :Cycle<CR>
|
||||
command! -buffer -count=1 -bar -bang Cycle call s:cycle(<bang>0 ? -<count> : <count>)
|
||||
|
||||
if exists("g:no_plugin_maps") || exists("g:no_gitrebase_maps")
|
||||
finish
|
||||
endif
|
||||
|
||||
nnoremap <buffer> <expr> K col('.') < 7 && expand('<Lt>cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K'
|
||||
nnoremap <buffer> <silent> <C-A> :<C-U><C-R>=v:count1<CR>Cycle<CR>
|
||||
nnoremap <buffer> <silent> <C-X> :<C-U><C-R>=v:count1<CR>Cycle!<CR>
|
||||
|
||||
let b:undo_ftplugin = b:undo_ftplugin . "|nunmap <buffer> K"
|
||||
let b:undo_ftplugin = b:undo_ftplugin . "|exe 'nunmap <buffer> K'|exe 'nunmap <buffer> <C-A>'|exe 'nunmap <buffer> <C-X>'"
|
||||
|
||||
endif
|
||||
|
||||
202
ftplugin/markdown.vim
Normal file
202
ftplugin/markdown.vim
Normal file
@@ -0,0 +1,202 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||
|
||||
if exists('b:did_ftplugin') | finish | endif
|
||||
|
||||
" {{{ CONFIGURATION
|
||||
|
||||
if !exists('g:markdown_flavor')
|
||||
let g:markdown_flavor = 'github'
|
||||
endif
|
||||
|
||||
if !exists('g:markdown_enable_folding')
|
||||
let g:markdown_enable_folding = 0
|
||||
endif
|
||||
|
||||
if !exists('g:markdown_enable_mappings')
|
||||
" make it compatible with previous configuration value
|
||||
if exists('g:markdown_include_default_mappings')
|
||||
let g:markdown_enable_mappings = g:markdown_include_default_mappings
|
||||
else
|
||||
let g:markdown_enable_mappings = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
if !exists('g:markdown_enable_insert_mode_mappings')
|
||||
" make it compatible with previous configuration value
|
||||
if exists('g:markdown_include_insert_mode_default_mappings')
|
||||
let g:markdown_enable_insert_mode_mappings = g:markdown_include_insert_mode_default_mappings
|
||||
else
|
||||
let g:markdown_enable_insert_mode_mappings = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
if !exists('g:markdown_enable_insert_mode_leader_mappings')
|
||||
let g:markdown_enable_insert_mode_leader_mappings = 0
|
||||
endif
|
||||
|
||||
if !exists('g:markdown_drop_empty_blockquotes')
|
||||
let g:markdown_drop_empty_blockquotes = 0
|
||||
endif
|
||||
|
||||
if !exists('g:markdown_mapping_switch_status')
|
||||
let g:markdown_mapping_switch_status = '<space>'
|
||||
endif
|
||||
|
||||
if !exists('g:markdown_enable_spell_checking')
|
||||
let g:markdown_enable_spell_checking = 1
|
||||
endif
|
||||
|
||||
if !exists('g:markdown_enable_input_abbreviations')
|
||||
let g:markdown_enable_input_abbreviations = 1
|
||||
endif
|
||||
|
||||
" }}}
|
||||
|
||||
|
||||
" {{{ OPTIONS
|
||||
|
||||
setlocal textwidth=0
|
||||
setlocal ts=2 sw=2 expandtab smarttab
|
||||
setlocal comments=b:*,b:-,b:+,n:>,se:``` commentstring=>\ %s
|
||||
setlocal formatoptions=tron
|
||||
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\\|^\\s*[+-\\*]\\s\\+
|
||||
setlocal nolisp
|
||||
setlocal autoindent
|
||||
|
||||
" Enable spelling and completion based on dictionary words
|
||||
if &spelllang !~# '^\s*$' && g:markdown_enable_spell_checking
|
||||
setlocal spell
|
||||
endif
|
||||
|
||||
" Custom dictionary for emoji
|
||||
execute 'setlocal dictionary+=' . shellescape(expand('<sfile>:p:h:h')) . '/dict/emoticons.dict'
|
||||
setlocal iskeyword+=:,+,-
|
||||
setlocal complete+=k
|
||||
|
||||
if g:markdown_enable_input_abbreviations
|
||||
" Replace common ascii emoticons with supported emoji
|
||||
iabbrev <buffer> :-) :smile:
|
||||
iabbrev <buffer> :-D :laughing:
|
||||
iabbrev <buffer> :-( :disappointed:
|
||||
|
||||
" Replace common punctuation
|
||||
iabbrev <buffer> ... …
|
||||
iabbrev <buffer> << «
|
||||
iabbrev <buffer> >> »
|
||||
endif
|
||||
|
||||
" Folding
|
||||
if g:markdown_enable_folding
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=markdown#FoldLevelOfLine(v:lnum)
|
||||
endif
|
||||
|
||||
" }}}
|
||||
|
||||
|
||||
" {{{ FUNCTIONS
|
||||
|
||||
function! s:JumpToHeader(forward, visual)
|
||||
let cnt = v:count1
|
||||
let save = @/
|
||||
let pattern = '\v^#{1,6}.*$|^.+\n%(\-+|\=+)$'
|
||||
if a:visual
|
||||
normal! gv
|
||||
endif
|
||||
if a:forward
|
||||
let motion = '/' . pattern
|
||||
else
|
||||
let motion = '?' . pattern
|
||||
endif
|
||||
while cnt > 0
|
||||
silent! execute motion
|
||||
let cnt = cnt - 1
|
||||
endwhile
|
||||
call histdel('/', -1)
|
||||
let @/ = save
|
||||
endfunction
|
||||
|
||||
function! s:Indent(indent)
|
||||
if getline('.') =~ '\v^\s*%([-*+]|\d\.)\s*$'
|
||||
if a:indent
|
||||
normal >>
|
||||
else
|
||||
normal <<
|
||||
endif
|
||||
call setline('.', substitute(getline('.'), '\([-*+]\|\d\.\)\s*$', '\1 ', ''))
|
||||
normal $
|
||||
elseif getline('.') =~ '\v^\s*(\s?\>)+\s*$'
|
||||
if a:indent
|
||||
call setline('.', substitute(getline('.'), '>\s*$', '>> ', ''))
|
||||
else
|
||||
call setline('.', substitute(getline('.'), '\s*>\s*$', ' ', ''))
|
||||
call setline('.', substitute(getline('.'), '^\s\+$', '', ''))
|
||||
endif
|
||||
normal $
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:IsAnEmptyListItem()
|
||||
return getline('.') =~ '\v^\s*%([-*+]|\d\.)\s*$'
|
||||
endfunction
|
||||
|
||||
function! s:IsAnEmptyQuote()
|
||||
return getline('.') =~ '\v^\s*(\s?\>)+\s*$'
|
||||
endfunction
|
||||
|
||||
" }}}
|
||||
|
||||
|
||||
" {{{ MAPPINGS
|
||||
|
||||
" Commands
|
||||
command! -nargs=0 -range MarkdownEditBlock :<line1>,<line2>call markdown#EditBlock()
|
||||
|
||||
if g:markdown_enable_mappings
|
||||
" Jumping around
|
||||
noremap <silent> <buffer> <script> ]] :<C-u>call <SID>JumpToHeader(1, 0)<CR>
|
||||
noremap <silent> <buffer> <script> [[ :<C-u>call <SID>JumpToHeader(0, 0)<CR>
|
||||
vnoremap <silent> <buffer> <script> ]] :<C-u>call <SID>JumpToHeader(1, 1)<CR>
|
||||
vnoremap <silent> <buffer> <script> [[ :<C-u>call <SID>JumpToHeader(0, 1)<CR>
|
||||
noremap <silent> <buffer> <script> ][ <nop>
|
||||
noremap <silent> <buffer> <script> [] <nop>
|
||||
|
||||
if g:markdown_enable_insert_mode_mappings
|
||||
" Indenting things
|
||||
inoremap <silent> <buffer> <script> <expr> <Tab>
|
||||
\ <SID>IsAnEmptyListItem() \|\| <SID>IsAnEmptyQuote() ? '<C-O>:call <SID>Indent(1)<CR>' : '<Tab>'
|
||||
inoremap <silent> <buffer> <script> <expr> <S-Tab>
|
||||
\ <SID>IsAnEmptyListItem() \|\| <SID>IsAnEmptyQuote() ? '<C-O>:call <SID>Indent(0)<CR>' : '<Tab>'
|
||||
|
||||
if g:markdown_drop_empty_blockquotes
|
||||
" Remove empty quote and list items when press <CR>
|
||||
inoremap <silent> <buffer> <script> <expr> <CR> <SID>IsAnEmptyQuote() \|\| <SID>IsAnEmptyListItem() ? '<C-O>:normal 0D<CR>' : '<CR>'
|
||||
else
|
||||
" Remove only empty list items when press <CR>
|
||||
inoremap <silent> <buffer> <script> <expr> <CR> <SID>IsAnEmptyListItem() ? '<C-O>:normal 0D<CR>' : '<CR>'
|
||||
endif
|
||||
|
||||
" Format tables
|
||||
inoremap <silent> <buffer> <Bar> <Bar><Esc>:call markdown#FormatTable()<CR>a
|
||||
endif
|
||||
|
||||
" Switch status of things
|
||||
execute 'nnoremap <silent> <buffer> ' . g:markdown_mapping_switch_status . ' :call markdown#SwitchStatus()<CR>'
|
||||
|
||||
" Leader mappings
|
||||
nnoremap <buffer> <Leader>e :MarkdownEditBlock<CR>
|
||||
vnoremap <buffer> <Leader>e :MarkdownEditBlock<CR>
|
||||
nnoremap <silent> <buffer> <Leader>ft :call markdown#FormatTable()<CR>
|
||||
|
||||
" Insert Mode mappings
|
||||
if g:markdown_enable_insert_mode_leader_mappings
|
||||
inoremap <buffer> <Leader>e <Esc>:MarkdownEditBlock<CR>
|
||||
inoremap <silent> <buffer> <Leader>ft <Esc>:call markdown#FormatTable()<CR>a
|
||||
endif
|
||||
endif
|
||||
|
||||
" }}}
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
endif
|
||||
@@ -3,7 +3,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
" Language: Rust
|
||||
" Description: Vim ftplugin for Rust
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Maintainer: Kevin Ballard <kevin@sb.org>
|
||||
" Last Change: June 08, 2016
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
@@ -139,7 +138,7 @@ command! -bar RustInfoToClipboard call rust#debugging#InfoToClipboard()
|
||||
command! -bar -nargs=1 RustInfoToFile call rust#debugging#InfoToFile(<f-args>)
|
||||
|
||||
" See |:RustTest| for docs
|
||||
command! -buffer -nargs=* -bang RustTest call rust#Test(<bang>0, <q-args>)
|
||||
command! -buffer -nargs=* -count -bang RustTest call rust#Test(<q-mods>, <count>, <bang>0, <q-args>)
|
||||
|
||||
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
|
||||
let b:rust_last_rustc_args = []
|
||||
|
||||
29
ftplugin/vala.vim
Normal file
29
ftplugin/vala.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
||||
|
||||
" Insert a CCode attribute for the symbol below the cursor
|
||||
" https://wiki.gnome.org/Projects/Vala/LegacyBindings
|
||||
function! CCode() abort
|
||||
normal yiwO[CCode (cname = "pa")]
|
||||
endfunction
|
||||
|
||||
" Set Vala Coding Style
|
||||
" https://wiki.gnome.org/Projects/Vala/Hacking#Coding_Style
|
||||
function! ValaCodingStyle() abort
|
||||
set ts=4 sts=4 sw=4 tw=0 wm=0
|
||||
endfunction
|
||||
|
||||
command! -buffer -bar CCode call CCode()
|
||||
command! -buffer -bar ValaCodingStyle call ValaCodingStyle()
|
||||
|
||||
if get(g:, 'vala_syntax_folding_enabled', 1)
|
||||
setlocal foldmethod=syntax
|
||||
endif
|
||||
|
||||
endif
|
||||
6
ftplugin/vlang.vim
Normal file
6
ftplugin/vlang.vim
Normal file
@@ -0,0 +1,6 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'v') == -1
|
||||
|
||||
setlocal commentstring=//\ %s
|
||||
setlocal makeprg=v\ %
|
||||
|
||||
endif
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -
|
||||
" Vim indent file
|
||||
" Language: Cucumber
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 May 30
|
||||
" Last Change: 2017 Jun 13
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
@@ -29,7 +29,7 @@ function! GetCucumberIndent()
|
||||
let line = getline(prevnonblank(v:lnum-1))
|
||||
let cline = getline(v:lnum)
|
||||
let nline = getline(nextnonblank(v:lnum+1))
|
||||
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
|
||||
let sw = exists('*shiftwidth') ? shiftwidth() : shiftwidth()
|
||||
let syn = s:syn(prevnonblank(v:lnum-1))
|
||||
let csyn = s:syn(v:lnum)
|
||||
let nsyn = s:syn(nextnonblank(v:lnum+1))
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim indent file
|
||||
" Language: git config file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 May 30
|
||||
" Last Change: 2017 Jun 13
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
@@ -22,7 +22,7 @@ if exists("*GetGitconfigIndent")
|
||||
endif
|
||||
|
||||
function! GetGitconfigIndent()
|
||||
let sw = exists('*shiftwidth') ? shiftwidth() : &sw
|
||||
let sw = shiftwidth()
|
||||
let line = getline(prevnonblank(v:lnum-1))
|
||||
let cline = getline(v:lnum)
|
||||
if line =~ '\\\@<!\%(\\\\\)*\\$'
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||
|
||||
if exists("b:did_indent") | finish | endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetMarkdownIndent()
|
||||
setlocal nolisp
|
||||
setlocal autoindent
|
||||
|
||||
" Automatically continue blockquote on line break
|
||||
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
|
||||
|
||||
function! s:IsMkdCode(lnum)
|
||||
let name = synIDattr(synID(a:lnum, 1, 0), 'name')
|
||||
return (name =~ '^mkd\%(Code$\|Snippet\)' || name != '' && name !~ '^\%(mkd\|html\)')
|
||||
endfunction
|
||||
|
||||
function! s:IsLiStart(line)
|
||||
return a:line !~ '^ *\([*-]\)\%( *\1\)\{2}\%( \|\1\)*$' &&
|
||||
\ a:line =~ '^\s*[*+-] \+'
|
||||
endfunction
|
||||
|
||||
function! s:IsHeaderLine(line)
|
||||
return a:line =~ '^\s*#'
|
||||
endfunction
|
||||
|
||||
function! s:IsBlankLine(line)
|
||||
return a:line =~ '^$'
|
||||
endfunction
|
||||
|
||||
function! s:PrevNonBlank(lnum)
|
||||
let i = a:lnum
|
||||
while i > 1 && s:IsBlankLine(getline(i))
|
||||
let i -= 1
|
||||
endwhile
|
||||
return i
|
||||
endfunction
|
||||
|
||||
function GetMarkdownIndent()
|
||||
if v:lnum > 2 && s:IsBlankLine(getline(v:lnum - 1)) && s:IsBlankLine(getline(v:lnum - 2))
|
||||
return 0
|
||||
endif
|
||||
let list_ind = get(g:, "vim_markdown_new_list_item_indent", 4)
|
||||
" Find a non-blank line above the current line.
|
||||
let lnum = s:PrevNonBlank(v:lnum - 1)
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0 | return 0 | endif
|
||||
let ind = indent(lnum)
|
||||
let line = getline(lnum) " Last line
|
||||
let cline = getline(v:lnum) " Current line
|
||||
if s:IsLiStart(cline)
|
||||
" Current line is the first line of a list item, do not change indent
|
||||
return indent(v:lnum)
|
||||
elseif s:IsHeaderLine(cline) && !s:IsMkdCode(v:lnum)
|
||||
" Current line is the header, do not indent
|
||||
return 0
|
||||
elseif s:IsLiStart(line)
|
||||
if s:IsMkdCode(lnum)
|
||||
return ind
|
||||
else
|
||||
" Last line is the first line of a list item, increase indent
|
||||
return ind + list_ind
|
||||
end
|
||||
else
|
||||
return ind
|
||||
endif
|
||||
endfunction
|
||||
|
||||
endif
|
||||
@@ -66,6 +66,7 @@ let s:syng_strcom = s:syng_stringdoc + [
|
||||
\ 'PercentStringDelimiter',
|
||||
\ 'PercentSymbolDelimiter',
|
||||
\ 'Regexp',
|
||||
\ 'RegexpCharClass',
|
||||
\ 'RegexpDelimiter',
|
||||
\ 'RegexpEscape',
|
||||
\ 'StringDelimiter',
|
||||
|
||||
@@ -193,7 +193,12 @@ function GetRustIndent(lnum)
|
||||
" A line that ends with '.<expr>;' is probably an end of a long list
|
||||
" of method operations.
|
||||
if prevline =~# '\V\^\s\*.' && l:last_prevline_character ==# ';'
|
||||
return indent(prevlinenum) - s:shiftwidth()
|
||||
call cursor(a:lnum - 1, 1)
|
||||
let l:scope_start = searchpair('{\|(', '', '}\|)', 'nbW',
|
||||
\ 's:is_string_comment(line("."), col("."))')
|
||||
if l:scope_start != 0 && l:scope_start < a:lnum
|
||||
return indent(l:scope_start) + 4
|
||||
endif
|
||||
endif
|
||||
|
||||
if l:last_prevline_character ==# ","
|
||||
|
||||
69
indent/vlang.vim
Normal file
69
indent/vlang.vim
Normal file
@@ -0,0 +1,69 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'v') == -1
|
||||
|
||||
" Based on the Go identation file.
|
||||
"
|
||||
" Copyright 2011 The Go Authors. All rights reserved.
|
||||
" Use of this source code is governed by a BSD-style
|
||||
" license that can be found in the LICENSE file.
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal nolisp
|
||||
setlocal autoindent
|
||||
setlocal indentexpr=VlangIndent(v:lnum)
|
||||
setlocal indentkeys+=<:>,0=},0=)
|
||||
|
||||
if exists("*VlangIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! VlangIndent(lnum) abort
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
if prevlnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
|
||||
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
|
||||
let previ = indent(prevlnum)
|
||||
|
||||
let ind = previ
|
||||
|
||||
if prevl =~ '[({]\s*$'
|
||||
" previous line opened a block
|
||||
let ind += shiftwidth()
|
||||
endif
|
||||
if prevl =~# '^\s*\(case .*\|default\):$'
|
||||
" previous line is part of a switch statement
|
||||
let ind += shiftwidth()
|
||||
endif
|
||||
|
||||
if thisl =~ '^\s*[)}]'
|
||||
" this line closed a block
|
||||
let ind -= shiftwidth()
|
||||
endif
|
||||
|
||||
" Colons are tricky.
|
||||
" We want to outdent if it's part of a switch ("case foo:" or "default:").
|
||||
" 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 -= shiftwidth()
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" restore Vi compatibility settings
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
@@ -15,7 +15,7 @@ syntax match typescriptClassName contained /\K\k*/
|
||||
|
||||
syntax region typescriptClassTypeParameter
|
||||
\ start=/</ end=/>/
|
||||
\ contains=typescriptTypeParameter
|
||||
\ contains=@typescriptTypeParameterCluster
|
||||
\ nextgroup=typescriptClassBlock,typescriptClassExtends
|
||||
\ contained skipwhite skipnl
|
||||
|
||||
@@ -47,7 +47,7 @@ syntax match typescriptInterfaceName contained /\k\+/
|
||||
\ skipwhite skipnl
|
||||
syntax region typescriptInterfaceTypeParameter
|
||||
\ start=/</ end=/>/
|
||||
\ contains=typescriptTypeParameter
|
||||
\ contains=@typescriptTypeParameterCluster
|
||||
\ nextgroup=typescriptObjectType,typescriptInterfaceExtends
|
||||
\ contained
|
||||
\ skipwhite skipnl
|
||||
|
||||
@@ -16,7 +16,7 @@ syntax region typescriptString
|
||||
\ contains=typescriptSpecial,@Spell
|
||||
\ extend
|
||||
|
||||
syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{4,5}})|c\u|.)"
|
||||
syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{1,6}})|c\u|.)"
|
||||
|
||||
" From vim runtime
|
||||
" <https://github.com/vim/vim/blob/master/runtime/syntax/javascript.vim#L48>
|
||||
@@ -24,7 +24,7 @@ syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|
|
||||
|
||||
syntax region typescriptTemplate
|
||||
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
|
||||
\ contains=typescriptTemplateSubstitution
|
||||
\ contains=typescriptTemplateSubstitution,typescriptSpecial,@Spell
|
||||
\ nextgroup=@typescriptSymbols
|
||||
\ skipwhite skipempty
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') ==
|
||||
|
||||
syntax region typescriptObjectLiteral matchgroup=typescriptBraces
|
||||
\ start=/{/ end=/}/
|
||||
\ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName
|
||||
\ contains=@typescriptComments,typescriptObjectLabel,typescriptStringProperty,typescriptComputedPropertyName,typescriptObjectAsyncKeyword
|
||||
\ fold contained
|
||||
|
||||
syntax keyword typescriptObjectAsyncKeyword async contained
|
||||
|
||||
syntax match typescriptObjectLabel contained /\k\+\_s*/
|
||||
\ nextgroup=typescriptObjectColon,@typescriptCallImpl
|
||||
\ skipwhite skipempty
|
||||
|
||||
@@ -3,13 +3,17 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') ==
|
||||
" Types
|
||||
syntax match typescriptOptionalMark /?/ contained
|
||||
|
||||
syntax cluster typescriptTypeParameterCluster contains=
|
||||
\ typescriptTypeParameter,
|
||||
\ typescriptGenericDefault
|
||||
|
||||
syntax region typescriptTypeParameters matchgroup=typescriptTypeBrackets
|
||||
\ start=/</ end=/>/
|
||||
\ contains=typescriptTypeParameter
|
||||
\ contains=@typescriptTypeParameterCluster
|
||||
\ contained
|
||||
|
||||
syntax match typescriptTypeParameter /\K\k*/
|
||||
\ nextgroup=typescriptConstraint,typescriptGenericDefault
|
||||
\ nextgroup=typescriptConstraint
|
||||
\ contained skipwhite skipnl
|
||||
|
||||
syntax keyword typescriptConstraint extends
|
||||
|
||||
@@ -111,6 +111,7 @@ if exists("did_typescript_hilink")
|
||||
HiLink typescriptMethodAccessor Operator
|
||||
|
||||
HiLink typescriptAsyncFuncKeyword Keyword
|
||||
HiLink typescriptObjectAsyncKeyword Keyword
|
||||
HiLink typescriptAsyncFor Keyword
|
||||
HiLink typescriptFuncKeyword Keyword
|
||||
HiLink typescriptAsyncFunc Keyword
|
||||
|
||||
@@ -28,7 +28,7 @@ syntax keyword dartConstant null
|
||||
syntax keyword dartTypedef this super class typedef enum mixin
|
||||
syntax keyword dartOperator new is as in
|
||||
syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
|
||||
syntax keyword dartType void var bool int double num dynamic
|
||||
syntax keyword dartCoreType void var dynamic
|
||||
syntax keyword dartStatement return
|
||||
syntax keyword dartStorageClass static abstract final const factory
|
||||
syntax keyword dartExceptions throw rethrow try on catch finally
|
||||
@@ -51,27 +51,26 @@ syntax match dartLibrary "^\(library\|part of\|part\)\>"
|
||||
syntax match dartMetadata "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>"
|
||||
|
||||
" Numbers
|
||||
syntax match dartNumber "\<\d\+\(\.\d\+\)\=\>"
|
||||
syntax match dartNumber "\<\d\+\(\.\d\+\)\=\>"
|
||||
|
||||
" User Types
|
||||
if !exists('dart_highlight_types') || dart_highlight_types
|
||||
syntax match dartTypeName "\<[A-Z]\w*\>\|\<_[A-Z]\w*\>"
|
||||
endif
|
||||
syntax match dartUserType "\<_\?\u[[:alnum:]_\$]*\>"
|
||||
|
||||
" Core libraries
|
||||
if !exists('dart_corelib_highlight') || dart_corelib_highlight
|
||||
syntax keyword dartCoreClasses BidirectionalIterator Comparable DateTime
|
||||
\ Duration Expando Function Invocation Iterable Iterator List Map Match
|
||||
\ Object Pattern RegExp RuneIterator Runes Set StackTrace Stopwatch String
|
||||
\ StringBuffer StringSink Symbol Type
|
||||
syntax keyword dartCoreTypedefs Comparator
|
||||
syntax keyword dartCoreExceptions AbstractClassInstantiationError
|
||||
\ ArgumentError AssertionError CastError ConcurrentModificationError
|
||||
\ Error Exception FallThroughError FormatException
|
||||
\ IntegerDivisionByZeroException NoSuchMethodError NullThrownError
|
||||
\ OutOfMemoryError RangeError RuntimeError StackOverflowError StateError
|
||||
\ TypeError UnimplementedError UnsupportedError
|
||||
endif
|
||||
" Function highlighting
|
||||
syntax match dartFunction "\zs\<\(_\?\l[[:alnum:]_\$]*\)\>*\s*\ze("
|
||||
|
||||
" SDK libraries
|
||||
syntax keyword dartSdkClass BidirectionalIterator Comparable DateTime
|
||||
\ Duration Expando Function Invocation Iterable Iterator List Map Match
|
||||
\ Object Pattern RegExp RuneIterator Runes Set StackTrace Stopwatch String
|
||||
\ StringBuffer StringSink Symbol Type bool int double num
|
||||
syntax keyword dartSdkTypedef Comparator
|
||||
syntax keyword dartSdkException AbstractClassInstantiationError
|
||||
\ ArgumentError AssertionError CastError ConcurrentModificationError
|
||||
\ Error Exception FallThroughError FormatException
|
||||
\ IntegerDivisionByZeroException NoSuchMethodError NullThrownError
|
||||
\ OutOfMemoryError RangeError RuntimeError StackOverflowError StateError
|
||||
\ TypeError UnimplementedError UnsupportedError
|
||||
|
||||
" Comments
|
||||
syntax keyword dartTodo contained TODO FIXME XXX
|
||||
@@ -119,21 +118,23 @@ highlight default link dartLineComment Comment
|
||||
highlight default link dartLineDocComment Comment
|
||||
highlight default link dartShebangLine Comment
|
||||
highlight default link dartConstant Constant
|
||||
highlight default link dartTypedef Typedef
|
||||
highlight default link dartTodo Todo
|
||||
highlight default link dartKeyword Keyword
|
||||
highlight default link dartType Type
|
||||
highlight default link dartTypeName Type
|
||||
highlight default link dartInterpolation PreProc
|
||||
highlight default link dartDocLink SpecialComment
|
||||
highlight default link dartSpecialChar SpecialChar
|
||||
highlight default link dartLibrary Include
|
||||
highlight default link dartUri String
|
||||
highlight default link dartCombinator Keyword
|
||||
highlight default link dartCoreClasses Type
|
||||
highlight default link dartCoreTypedefs Typedef
|
||||
highlight default link dartCoreExceptions Exception
|
||||
highlight default link dartMetadata PreProc
|
||||
highlight default link dartSdkTypedef Typedef
|
||||
highlight default link dartTypedef Typedef
|
||||
highlight default link dartSdkException Exception
|
||||
highlight default link dartSdkClass dartType
|
||||
highlight default link dartCoreType dartType
|
||||
highlight default link dartUserType dartType
|
||||
highlight default link dartType Type
|
||||
highlight default link dartFunction Function
|
||||
|
||||
let b:current_syntax = "dart"
|
||||
let b:spell_options = "contained"
|
||||
|
||||
@@ -6,7 +6,7 @@ if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
syntax match dhallInterpolation "\v\$\{[^\}]*\}"
|
||||
syntax match dhallInterpolation "\v\$\{([^\}]|\\n)*\}"
|
||||
syntax keyword dhallTodo TODO FIXME
|
||||
syntax match dhallBrackets "[<>|]"
|
||||
syntax match dhallOperator "+\|*\|#"
|
||||
@@ -39,6 +39,7 @@ syntax region dhallString start=+''+ end=+''+ contains=@Spell,dhallInterpolation
|
||||
syntax region dhallString start=+"+ end=+"+ contains=dhallInterpolation,dhallEsc
|
||||
syntax region dhallString start=+"/+ end=+"+ contains=dhallInterpolation,dhallEsc
|
||||
syntax keyword dhallBool True False
|
||||
syntax match dhallHash "sha256:[a-f0-9]+"
|
||||
|
||||
highlight link dhallSingleSpecial Special
|
||||
highlight link dhallIndex Special
|
||||
@@ -60,6 +61,7 @@ highlight link dhallType Structure
|
||||
highlight link dhallParens Special
|
||||
highlight link dhallComment Comment
|
||||
highlight link dhallMultilineComment Comment
|
||||
highlight link dhallHash Keyword
|
||||
|
||||
let b:current_syntax = 'dhall'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Language: git commit file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.git/COMMIT_EDITMSG
|
||||
" Last Change: 2013 May 30
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Language: git config file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: gitconfig, .gitconfig, *.git/config
|
||||
" Last Change: 2010 May 21
|
||||
" Last Change: 2019 Sep 27
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -13,7 +13,7 @@ endif
|
||||
syn case ignore
|
||||
syn sync minlines=10
|
||||
|
||||
syn match gitconfigComment "[#;].*"
|
||||
syn match gitconfigComment "[#;].*" contains=@Spell
|
||||
syn match gitconfigSection "\%(^\s*\)\@<=\[[a-z0-9.-]\+\]"
|
||||
syn match gitconfigSection '\%(^\s*\)\@<=\[[a-z0-9.-]\+ \+\"\%([^\\"]\|\\.\)*"\]'
|
||||
syn match gitconfigVariable "\%(^\s*\)\@<=\a[a-z0-9-]*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Language: git rebase --interactive
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: git-rebase-todo
|
||||
" Last Change: 2013 May 30
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -12,36 +12,49 @@ endif
|
||||
|
||||
syn case match
|
||||
|
||||
syn match gitrebaseHash "\v<\x{7,40}>" contained
|
||||
syn match gitrebaseCommit "\v<\x{7,40}>" nextgroup=gitrebaseSummary skipwhite
|
||||
syn match gitrebaseHash "\v<\x{7,}>" contained
|
||||
syn match gitrebaseCommit "\v<\x{7,}>" nextgroup=gitrebaseSummary skipwhite
|
||||
syn match gitrebasePick "\v^p%(ick)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseReword "\v^r%(eword)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseEdit "\v^e%(dit)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite
|
||||
syn match gitrebaseBreak "\v^b%(reak)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseBreak "\v^b%(reak)=>"
|
||||
syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseNoop "\v^noop>"
|
||||
syn match gitrebaseMerge "\v^m(erge)=>" nextgroup=gitrebaseMergeOption,gitrebaseName skipwhite
|
||||
syn match gitrebaseLabel "\v^l(abel)=>" nextgroup=gitrebaseName skipwhite
|
||||
syn match gitrebaseReset "\v^r(eset)=>" nextgroup=gitrebaseName skipwhite
|
||||
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
|
||||
syn match gitrebaseCommand ".*" contained
|
||||
syn match gitrebaseComment "^\s*#.*" contains=gitrebaseHash
|
||||
syn match gitrebaseSquashError "\v%^%(s%(quash)=>|f%(ixup)=>)" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseMergeOption "\v-[Cc]>" nextgroup=gitrebaseMergeCommit skipwhite contained
|
||||
syn match gitrebaseMergeCommit "\v<\x{7,}>" nextgroup=gitrebaseName skipwhite contained
|
||||
syn match gitrebaseName "\v[^[:space:].*?i:^~/-]\S+" nextgroup=gitrebaseMergeComment skipwhite contained
|
||||
syn match gitrebaseMergeComment "#" nextgroup=gitrebaseSummary skipwhite contained
|
||||
|
||||
hi def link gitrebaseCommit gitrebaseHash
|
||||
hi def link gitrebaseHash Identifier
|
||||
hi def link gitrebasePick Statement
|
||||
hi def link gitrebaseReword Number
|
||||
hi def link gitrebasePick Type
|
||||
hi def link gitrebaseReword Conditional
|
||||
hi def link gitrebaseEdit PreProc
|
||||
hi def link gitrebaseSquash Type
|
||||
hi def link gitrebaseFixup Special
|
||||
hi def link gitrebaseExec Function
|
||||
hi def link gitrebaseSquash Statement
|
||||
hi def link gitrebaseFixup Repeat
|
||||
hi def link gitrebaseExec Operator
|
||||
hi def link gitrebaseBreak Macro
|
||||
hi def link gitrebaseDrop Comment
|
||||
hi def link gitrebaseNoop Comment
|
||||
hi def link gitrebaseMerge Exception
|
||||
hi def link gitrebaseLabel Label
|
||||
hi def link gitrebaseReset Keyword
|
||||
hi def link gitrebaseSummary String
|
||||
hi def link gitrebaseComment Comment
|
||||
hi def link gitrebaseSquashError Error
|
||||
hi def link gitrebaseMergeCommit gitrebaseCommit
|
||||
hi def link gitrebaseMergeComment gitrebaseComment
|
||||
hi def link gitrebaseName Tag
|
||||
|
||||
let b:current_syntax = "gitrebase"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Language: git send-email message
|
||||
" Maintainer: Tim Pope
|
||||
" Filenames: .gitsendemail.*
|
||||
" Last Change: 2010 May 21
|
||||
" Last Change: 2016 Aug 29
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
|
||||
@@ -164,15 +164,17 @@ endif
|
||||
syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
|
||||
|
||||
" Integers
|
||||
syn match goDecimalInt "\<-\=\(0\|[1-9]\d*\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goHexadecimalInt "\<-\=0[xX]\x\+\>"
|
||||
syn match goHexadecimalError "\<-\=0[xX]\x*[^ \t0-9A-Fa-f]\S*\>"
|
||||
syn match goOctalInt "\<-\=0\o\+\>"
|
||||
syn match goOctalError "\<-\=0[XxBb\]]\@!\o*[^ \t0-7]\S*\>"
|
||||
syn match goBinaryInt "\<-\=0[bB][01]\+\>"
|
||||
syn match goBinaryError "\<-\=0[bB][01]*[^ \t01]\S*\>"
|
||||
syn match goDecimalInt "\<-\=\(0\|[1-9]_\?\(\d\|\d\+_\?\d\+\)*\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>"
|
||||
syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^ \t0-9A-Fa-f_]\|__\)\S*\|_\)\>"
|
||||
syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>"
|
||||
syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
|
||||
syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>"
|
||||
syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^ \t01_]\S*\|__\S*\|_\)\>"
|
||||
|
||||
hi def link goDecimalInt Integer
|
||||
hi def link goDecimalError Error
|
||||
hi def link goHexadecimalInt Integer
|
||||
hi def link goHexadecimalError Error
|
||||
hi def link goOctalInt Integer
|
||||
|
||||
@@ -35,7 +35,7 @@ syn match graphqlDirective "\<@\h\w*\>" display
|
||||
syn match graphqlVariable "\<\$\h\w*\>" display
|
||||
syn match graphqlName "\<\h\w*\>" display
|
||||
syn match graphqlType "\<_*\u\w*\>" display
|
||||
syn match graphqlConstant "\<[A-Z_]\+\>" display
|
||||
syn match graphqlConstant "\<[_A-Z][_A-Z0-9]*\>" display
|
||||
|
||||
syn keyword graphqlMetaFields __schema __type __typename
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ syn keyword htmlTagName contained article aside audio canvas command
|
||||
syn keyword htmlTagName contained datalist details dialog embed figcaption figure footer
|
||||
syn keyword htmlTagName contained header hgroup keygen main mark meter menu menuitem nav output
|
||||
syn keyword htmlTagName contained progress ruby rt rp rb rtc section source summary time track video data
|
||||
syn keyword htmlTagName contained template content shadow
|
||||
syn keyword htmlTagName contained template content shadow slot
|
||||
syn keyword htmlTagName contained wbr bdi
|
||||
syn keyword htmlTagName contained picture
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ syn match i3ConfigFontNamespace /\w\+:/ contained contains=i3ConfigFontSeparator
|
||||
syn match i3ConfigFontContent /-\?\w\+\(-\+\|\s\+\|,\)/ contained contains=i3ConfigFontNamespace,i3ConfigFontSeparator,i3ConfigFontKeyword
|
||||
syn match i3ConfigFontSize /\s\=\d\+\(px\)\?\s\?$/ contained
|
||||
syn match i3ConfigFont /^\s*font\s\+.*$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
"syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
"syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?[^\\]\+$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
"syn match i3ConfigFont /^\s*font\s\+\(\(.*\\\_.*\)\|\(.*[^\\]\+$\)\)/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
syn match i3ConfigFont /^\s*font\s\+.*\(\\\_.*\)\?[^\\]\+$/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
syn match i3ConfigFont /^\s*font\s\+\(\(.*\\\_.*\)\|\(.*[^\\]\+$\)\)/ contains=i3ConfigFontContent,i3ConfigFontSeparator,i3ConfigFontSize,i3ConfigFontNamespace
|
||||
|
||||
" variables
|
||||
syn match i3ConfigString /\(['"]\)\(.\{-}\)\1/ contained
|
||||
@@ -55,8 +55,8 @@ syn keyword i3ConfigInitializeKeyword set contained
|
||||
syn match i3ConfigInitialize /^\s*set\s\+.*$/ contains=i3ConfigVariable,i3ConfigInitializeKeyword,i3ConfigColor,i3ConfigString
|
||||
|
||||
" Gaps
|
||||
syn keyword i3ConfigGapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle contained
|
||||
syn match i3ConfigGapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(-\?\d\+\|\$.*\)\)$/ contains=i3ConfigGapStyleKeyword,number,i3ConfigVariable
|
||||
syn keyword i3ConfigGapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle up down contained
|
||||
syn match i3ConfigGapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(-\?\d\+\|\$.*\)\)$/ contains=i3ConfigGapStyleKeyword,i3ConfigNumber,i3ConfigVariable
|
||||
syn keyword i3ConfigSmartGapKeyword on inverse_outer contained
|
||||
syn match i3ConfigSmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\)\s\?$/ contains=i3ConfigSmartGapKeyword
|
||||
syn keyword i3ConfigSmartBorderKeyword on no_gaps contained
|
||||
@@ -64,19 +64,21 @@ syn match i3ConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\)\s\?$/ contai
|
||||
|
||||
" Keyboard bindings
|
||||
syn keyword i3ConfigAction toggle fullscreen restart key import kill shrink grow contained
|
||||
syn keyword i3ConfigAction focus move split layout resize restore reload mute unmute exit contained
|
||||
syn keyword i3ConfigAction focus move grow height width split layout resize restore reload mute unmute exit mode workspace container to contained
|
||||
syn match i3ConfigModifier /\w\++\w\+\(\(+\w\+\)\+\)\?/ contained contains=i3ConfigVariableModifier
|
||||
syn match i3ConfigNumber /\s\d\+/ contained
|
||||
syn match i3ConfigUnit /\sp\(pt\|x\)/ contained
|
||||
syn match i3ConfigUnitOr /\sor/ contained
|
||||
syn keyword i3ConfigBindKeyword bindsym bindcode exec gaps contained
|
||||
syn match i3ConfigBindArgument /--\w\+\(\(-\w\+\)\+\)\?\s/ contained
|
||||
syn match i3ConfigBind /^\s*\(bindsym\|bindcode\)\s\+.*$/ contains=i3ConfigVariable,i3ConfigBindKeyword,i3ConfigVariableAndModifier,i3ConfigBindArgument,i3ConfigNumber,i3ConfigModifier,i3ConfigAction,i3ConfigString,i3ConfigGapStyleKeyword
|
||||
syn match i3ConfigBind /^\s*\(bindsym\|bindcode\)\s\+.*$/ contains=i3ConfigVariable,i3ConfigBindKeyword,i3ConfigVariableAndModifier,i3ConfigNumber,i3ConfigUnit,i3ConfigUnitOr,i3ConfigBindArgument,i3ConfigModifier,i3ConfigAction,i3ConfigString,i3ConfigGapStyleKeyword
|
||||
|
||||
" Floating
|
||||
syn keyword i3ConfigSizeSpecial x contained
|
||||
syn match i3ConfigNegativeSize /-/ contained
|
||||
syn match i3ConfigSize /-\?\d\+\s\?x\s\?-\?\d\+/ contained contains=i3ConfigSizeSpecial,i3ConfigNumber,i3ConfigNegativeSize
|
||||
syn match i3ConfigFloating /^\s*floating_modifier\s\+\$\w\+\d\?/ contains=i3ConfigVariable
|
||||
syn match i3ConfigFloating /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=Size
|
||||
syn match i3ConfigFloating /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=i3ConfigSize
|
||||
|
||||
" Orientation
|
||||
syn keyword i3ConfigOrientationKeyword vertical horizontal auto contained
|
||||
@@ -88,7 +90,7 @@ syn match i3ConfigLayout /^\s*workspace_layout\s\+\(default\|stacking\|tabbed\)\
|
||||
|
||||
" Border style
|
||||
syn keyword i3ConfigBorderStyleKeyword none normal pixel contained
|
||||
syn match i3ConfigBorderStyle /^\s*\(new_window\|new_float\|default_border\|default_floating_border\)\s\+\(none\|\(normal\|pixel\)\(\s\+\d\+\)\?\)\s\?$/ contains=i3ConfigBorderStyleKeyword,number
|
||||
syn match i3ConfigBorderStyle /^\s*\(new_window\|new_float\|default_border\|default_floating_border\)\s\+\(none\|\(normal\|pixel\)\(\s\+\d\+\)\?\)\s\?$/ contains=i3ConfigBorderStyleKeyword,i3ConfigNumber
|
||||
|
||||
" Hide borders and edges
|
||||
syn keyword i3ConfigEdgeKeyword none vertical horizontal both smart smart_no_gaps contained
|
||||
@@ -97,7 +99,7 @@ syn match i3ConfigEdge /^\s*hide_edge_borders\s\+\(none\|vertical\|horizontal\|b
|
||||
" Arbitrary commands for specific windows (for_window)
|
||||
syn keyword i3ConfigCommandKeyword for_window contained
|
||||
syn region i3ConfigWindowStringSpecial start=+"+ skip=+\\"+ end=+"+ contained contains=i3ConfigString
|
||||
syn region i3ConfigWindowCommandSpecial start="\[" end="\]" contained contains=WindowStringSpacial,i3ConfigString
|
||||
syn region i3ConfigWindowCommandSpecial start="\[" end="\]" contained contains=i3ConfigWindowStringSpacial,i3ConfigString
|
||||
syn match i3ConfigArbitraryCommand /^\s*for_window\s\+.*$/ contains=i3ConfigWindowCommandSpecial,i3ConfigCommandKeyword,i3ConfigBorderStyleKeyword,i3ConfigLayoutKeyword,i3ConfigOrientationKeyword,Size,i3ConfigNumber
|
||||
|
||||
" Disable focus open opening
|
||||
@@ -127,6 +129,9 @@ syn match i3ConfigWorkspace /^\s*workspace\s\+.*$/ contains=i3ConfigWorkspaceKey
|
||||
syn keyword i3ConfigClientColorKeyword client focused focused_inactive unfocused urgent placeholder background contained
|
||||
syn match i3ConfigClientColor /^\s*client.\w\+\s\+.*$/ contains=i3ConfigClientColorKeyword,i3ConfigColor,i3ConfigVariable
|
||||
|
||||
syn keyword i3ConfigTitleAlignKeyword left center right contained
|
||||
syn match i3ConfigTitleAlign /^\s*title_align\s\+.*$/ contains=i3ConfigTitleAlignKeyword
|
||||
|
||||
" Interprocess communication
|
||||
syn match i3ConfigInterprocessKeyword /ipc-socket/ contained
|
||||
syn match i3ConfigInterprocess /^\s*ipc-socket\s\+.*$/ contains=i3ConfigInterprocessKeyword
|
||||
@@ -175,10 +180,10 @@ syn match i3ConfigDrawingMarks /^\s*show_marks\s\+\(yes\|no\)\s\?$/ contains=i3C
|
||||
|
||||
" Group mode/bar
|
||||
syn keyword i3ConfigBlockKeyword mode bar colors i3bar_command status_command position exec mode hidden_state modifier id position output background statusline tray_output tray_padding separator separator_symbol workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained
|
||||
syn region i3ConfigBlock start=+.*s\?{$+ end=+^}$+ contains=i3ConfigBlockKeyword,i3ConfigString,Bind,i3ConfigComment,Font,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
|
||||
syn region i3ConfigBlock start=+.*s\?{$+ end=+^}$+ contains=i3ConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
|
||||
|
||||
" Line continuation
|
||||
syn region i3ConfigLineCont start=/^.*\\$/ end=/^.*$/ contains=i3ConfigBlockKeyword,i3ConfigString,Bind,i3ConfigComment,Font,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
|
||||
syn region i3ConfigLineCont start=/^.*\\$/ end=/^.*$/ contains=i3ConfigBlockKeyword,i3ConfigString,i3ConfigBind,i3ConfigComment,i3ConfigFont,i3ConfigFocusWrappingType,i3ConfigColor,i3ConfigVariable transparent keepend extend
|
||||
|
||||
" Define the highlighting.
|
||||
hi! def link i3ConfigError Error
|
||||
@@ -191,6 +196,7 @@ hi! def link i3ConfigOrientationKeyword Type
|
||||
hi! def link i3ConfigMouseWarpingType Type
|
||||
hi! def link i3ConfigFocusFollowsMouseType Type
|
||||
hi! def link i3ConfigGapStyleKeyword Type
|
||||
hi! def link i3ConfigTitleAlignKeyword Type
|
||||
hi! def link i3ConfigSmartGapKeyword Type
|
||||
hi! def link i3ConfigSmartBorderKeyword Type
|
||||
hi! def link i3ConfigLayoutKeyword Type
|
||||
@@ -201,9 +207,11 @@ hi! def link i3ConfigCommand Type
|
||||
hi! def link i3ConfigOutput Type
|
||||
hi! def link i3ConfigWindowCommandSpecial Type
|
||||
hi! def link i3ConfigFocusWrappingType Type
|
||||
hi! def link i3ConfigUnitOr Type
|
||||
hi! def link i3ConfigFontSize Constant
|
||||
hi! def link i3ConfigColor Constant
|
||||
hi! def link i3ConfigNumber Constant
|
||||
hi! def link i3ConfigUnit Constant
|
||||
hi! def link i3ConfigVariableAndModifier Constant
|
||||
hi! def link i3ConfigTimeUnit Constant
|
||||
hi! def link i3ConfigModifier Constant
|
||||
@@ -221,6 +229,7 @@ hi! def link i3ConfigFontKeyword Identifier
|
||||
hi! def link i3ConfigBindKeyword Identifier
|
||||
hi! def link i3ConfigOrientation Identifier
|
||||
hi! def link i3ConfigGapStyle Identifier
|
||||
hi! def link i3ConfigTitleAlign Identifier
|
||||
hi! def link i3ConfigSmartGap Identifier
|
||||
hi! def link i3ConfigSmartBorder Identifier
|
||||
hi! def link i3ConfigLayout Identifier
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'log') == -1
|
||||
" Vim syntax file
|
||||
" Language: Generic log file
|
||||
" Maintainer: MTDL9 <https://github.com/MTDL9>
|
||||
" Latest Revision: 2019-04-16
|
||||
" Latest Revision: 2019-11-24
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
@@ -52,8 +52,8 @@ syn match logDate '\(\(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\) \)\?\(Jan\|Feb\|Mar\|
|
||||
syn match logTime '\d\{2}:\d\{2}:\d\{2}\(\.\d\{2,6}\)\?\(\s\?[-+]\d\{2,4}\|Z\)\?\>' nextgroup=logTimeZone,logSysColumns skipwhite
|
||||
|
||||
" Follows logTime, matches UTC or PDT 2019 or 2019 EDT
|
||||
syn match logTimeZone '\(UTC\|PDT\|EDT\|GMT\|EST\|KST\)\( \d\{4}\)\?' contained
|
||||
syn match logTimeZone '\d\{4} \(UTC\|PDT\|EDT\|GMT\|EST\|KST\)' contained
|
||||
syn match logTimeZone '[A-Z]\{2,5}\>\( \d\{4}\)\?' contained
|
||||
syn match logTimeZone '\d\{4} [A-Z]\{2,5}\>' contained
|
||||
|
||||
|
||||
" Entities
|
||||
@@ -66,7 +66,7 @@ syn match logIPV4 '\<\d\{1,3}\(\.\d\{1,3}\)\{3}\>'
|
||||
syn match logIPV6 '\<\x\{1,4}\(:\x\{1,4}\)\{7}\>'
|
||||
syn match logMacAddress '\<\x\{2}\(:\x\{2}\)\{5}'
|
||||
syn match logFilePath '\<\w:\\[^\n|,; ()'"\]{}]\+'
|
||||
syn match logFilePath '\/\w[^\n|,; ()'"\]{}]\+'
|
||||
syn match logFilePath '[^a-zA-Z0-9"']\@<=\/\w[^\n|,; ()'"\]{}]\+'
|
||||
|
||||
|
||||
" Syslog Columns
|
||||
|
||||
1087
syntax/markdown.vim
1087
syntax/markdown.vim
File diff suppressed because it is too large
Load Diff
34
syntax/markdown_jekyll.vim
Normal file
34
syntax/markdown_jekyll.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||
|
||||
let b:markdown_in_jekyll=0
|
||||
|
||||
if getline(1) =~ '^---\s*$'
|
||||
let b:markdown_in_jekyll=1
|
||||
|
||||
syn region markdownJekyllFrontMatter matchgroup=markdownJekyllDelimiter contains=@NoSpell
|
||||
\ start="\%^---" end="^---$"
|
||||
|
||||
syn region markdownJekyllLiquidTag matchgroup=markdownJekyllDelimiter contains=@NoSpell oneline
|
||||
\ start="{%" end="%}"
|
||||
|
||||
syn region markdownJekyllLiquidOutputTag matchgroup=markdownJekyllDelimiter contains=@NoSpell oneline
|
||||
\ start="{{" skip=/"}}"/ end="}}"
|
||||
|
||||
syn region markdownJekyllLiquidBlockTag matchgroup=markdownJekyllDelimiter contains=@NoSpell
|
||||
\ start="{%\s*\z(comment\|raw\|highlight\)[^%]*%}" end="{%\s*\%(no\|end\)\z1\s*%}"
|
||||
|
||||
silent spell! nocomment
|
||||
silent spell! endcomment
|
||||
silent spell! nohighlight
|
||||
silent spell! endhighlight
|
||||
silent spell! noraw
|
||||
silent spell! endraw
|
||||
|
||||
hi def link markdownJekyllFrontMatter NonText
|
||||
hi def link markdownJekyllLiquidTag NonText
|
||||
hi def link markdownJekyllLiquidOutputTag NonText
|
||||
hi def link markdownJekyllLiquidBlockTag NonText
|
||||
hi def link markdownJekyllDelimiter Delimiter
|
||||
endif
|
||||
|
||||
endif
|
||||
@@ -175,7 +175,7 @@ if version >= 508 || !exists("did_ps1_syn_inits")
|
||||
HiLink ps1Comment Comment
|
||||
HiLink ps1CommentTodo Todo
|
||||
HiLink ps1CommentDoc Tag
|
||||
HiLink ps1CDocParam Todo
|
||||
HiLink ps1CDocParam Identifier
|
||||
HiLink ps1Operator Operator
|
||||
HiLink ps1Repeat Repeat
|
||||
HiLink ps1RepeatAndCmdlet Repeat
|
||||
|
||||
@@ -29,7 +29,7 @@ endif
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn cluster qmlExpr contains=qmlStringD,qmlString,SqmlCharacter,qmlNumber,qmlObjectLiteralType,qmlBoolean,qmlType,qmlJsType,qmlNull,qmlGlobal,qmlFunction
|
||||
syn cluster qmlExpr contains=qmlStringD,qmlStringS,SqmlCharacter,qmlNumber,qmlObjectLiteralType,qmlBoolean,qmlType,qmlJsType,qmlNull,qmlGlobal,qmlFunction
|
||||
syn keyword qmlCommentTodo TODO FIXME XXX TBD contained
|
||||
syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo
|
||||
syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
|
||||
|
||||
@@ -175,7 +175,7 @@ syn match rstStandaloneHyperlink contains=@NoSpell
|
||||
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
|
||||
|
||||
syn region rstCodeBlock contained matchgroup=rstDirective
|
||||
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\s*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+
|
||||
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\s*\(\S*\)\?\s*\n\%(\s*:.*:\s*.*\s*\n\)*\n\ze\z(\s\+\)+
|
||||
\ skip=+^$+
|
||||
\ end=+^\z1\@!+
|
||||
\ contains=@NoSpell
|
||||
|
||||
@@ -55,6 +55,7 @@ syn keyword rustKeyword mod trait nextgroup=rustIdentifier skipwhite skipe
|
||||
syn keyword rustStorage move mut ref static const
|
||||
syn match rustDefault /\<default\ze\_s\+\(impl\|fn\|type\|const\)\>/
|
||||
syn keyword rustAwait await
|
||||
syn match rustKeyword /\<try\>!\@!/ display
|
||||
|
||||
syn keyword rustPubScopeCrate crate contained
|
||||
syn match rustPubScopeDelim /[()]/ contained
|
||||
|
||||
@@ -187,6 +187,7 @@ syntax region swiftEscapedReservedWord start="`" end="`" oneline
|
||||
syntax keyword swiftAttributes
|
||||
\ @_exported
|
||||
\ @_functionBuilder
|
||||
\ @_implementationOnly
|
||||
\ @_silgen_name
|
||||
\ @assignment
|
||||
\ @autoclosure
|
||||
|
||||
@@ -4830,10 +4830,9 @@ syn keyword terraSection connection output variable terraform locals
|
||||
syn keyword terraValueBool true false on off yes no
|
||||
|
||||
syn keyword terraTodo contained TODO FIXME XXX BUG
|
||||
syn cluster terraCommentGroup contains=terraTodo
|
||||
syn region terraComment start="/\*" end="\*/" contains=@terraCommentGroup,@Spell
|
||||
syn region terraComment start="#" end="$" contains=@terraCommentGroup,@Spell
|
||||
syn region terraComment start="//" end="$" contains=@terraCommentGroup,@Spell
|
||||
syn region terraComment start="/\*" end="\*/" contains=terraTodo,@Spell
|
||||
syn region terraComment start="#" end="$" contains=terraTodo,@Spell
|
||||
syn region terraComment start="//" end="$" contains=terraTodo,@Spell
|
||||
|
||||
syn keyword terraResource resource nextgroup=terraResourceTypeStr skipwhite
|
||||
syn region terraResourceTypeStr start=/"/ end=/"/ contains=terraResourceTypeBI nextgroup=terraResourceName skipwhite
|
||||
@@ -4867,13 +4866,11 @@ syn match terraBraces "[\[\]]"
|
||||
""" skip \" in strings.
|
||||
""" we may also want to pass \\" into a function to escape quotes.
|
||||
syn region terraValueString start=/"/ skip=/\\\+"/ end=/"/ contains=terraStringInterp
|
||||
syn region terraStringInterp matchgroup=terraBrackets start=/\${/ end=/}/ contains=terraValueFunction,terraValueVarSubscript,terraStringInterp contained
|
||||
syn region terraStringInterp matchgroup=terraBraces start=/\${/ end=/}/ contained contains=ALL
|
||||
syn region terraHereDocText start=/<<-\?\z([a-z0-9A-Z]\+\)/ end=/^\s*\z1/ contains=terraStringInterp
|
||||
|
||||
"" TODO match keywords here, not a-z+
|
||||
syn region terraValueFunction matchgroup=terraBrackets start=/[a-z]\+(/ end=/)/ contains=terraValueString,terraValueFunction,terraValueVarSubscript contained
|
||||
" User variables or module outputs can be lists or maps, and accessed with
|
||||
" var.map["foo"]
|
||||
syn region terraValueVarSubscript start=/\(\<var\|\<module\)\.[a-z0-9_-]\+\[/ end=/\]/ contains=terraValueString,terraValueFunction,terraValueVarSubscript contained
|
||||
syn match terraValueFunction "[a-z]\+(\@="
|
||||
|
||||
""" HCL2
|
||||
syn keyword terraContent content
|
||||
@@ -4892,7 +4889,6 @@ syn region terraBlock matchgroup=terraBraces start="{" end="}" fold transparent
|
||||
|
||||
hi def link terraComment Comment
|
||||
hi def link terraTodo Todo
|
||||
hi def link terraBrackets Operator
|
||||
hi def link terraProvider Structure
|
||||
hi def link terraBraces Delimiter
|
||||
hi def link terraProviderName String
|
||||
@@ -4905,7 +4901,6 @@ hi def link terraDataName String
|
||||
hi def link terraDataTypeBI Tag
|
||||
hi def link terraDataTypeStr String
|
||||
hi def link terraSection Structure
|
||||
hi def link terraStringInterp Identifier
|
||||
hi def link terraValueBool Boolean
|
||||
hi def link terraValueDec Number
|
||||
hi def link terraValueHexaDec Number
|
||||
@@ -4915,8 +4910,7 @@ hi def link terraProvisioner Structure
|
||||
hi def link terraProvisionerName String
|
||||
hi def link terraModule Structure
|
||||
hi def link terraModuleName String
|
||||
hi def link terraValueFunction Identifier
|
||||
hi def link terraValueVarSubscript Identifier
|
||||
hi def link terraValueFunction Function
|
||||
hi def link terraDynamic Structure
|
||||
hi def link terraDynamicName String
|
||||
hi def link terraContent Structure
|
||||
|
||||
268
syntax/vlang.vim
Normal file
268
syntax/vlang.vim
Normal file
@@ -0,0 +1,268 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'v') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: V
|
||||
" Maintainer: Oliver Kelton (https://github.com/ollykel)
|
||||
" Last Change: 2019 Jun 13
|
||||
" NOTE: largely based on go.vim, maintained by David Barnett
|
||||
" see David Barnett (https://github.com/google/vim-ft-go)
|
||||
" Options:
|
||||
" There are some options for customizing the highlighting; the recommended
|
||||
" settings are the default values, but you can write:
|
||||
" let OPTION_NAME = 0
|
||||
" in your ~/.vimrc file to disable particular options. You can also write:
|
||||
" let OPTION_NAME = 1
|
||||
" to enable particular options. At present, all options default to on.
|
||||
"
|
||||
" - g:v_highlight_array_whitespace_error
|
||||
" Highlights white space after "[]".
|
||||
" - g:v_highlight_chan_whitespace_error
|
||||
" Highlights white space around the communications operator that don't
|
||||
" follow the standard style.
|
||||
" Highlights commonly used library types (io.Reader, etc.).
|
||||
" - g:v_highlight_space_tab_error
|
||||
" Highlights instances of tabs following spaces.
|
||||
" - g:v_highlight_trailing_whitespace_error
|
||||
" Highlights trailing white space.
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('g:v_highlight_array_whitespace_error')
|
||||
let g:v_highlight_array_whitespace_error = 1
|
||||
endif
|
||||
if !exists('g:v_highlight_chan_whitespace_error')
|
||||
let g:v_highlight_chan_whitespace_error = 1
|
||||
endif
|
||||
if !exists('g:v_highlight_space_tab_error')
|
||||
let g:v_highlight_space_tab_error = 1
|
||||
endif
|
||||
if !exists('g:v_highlight_trailing_whitespace_error')
|
||||
let g:v_highlight_trailing_whitespace_error = 1
|
||||
endif
|
||||
if !exists('g:v_highlight_function_calls')
|
||||
let g:v_highlight_function_calls = 1
|
||||
endif
|
||||
if !exists('g:v_highlight_fields')
|
||||
let g:v_highlight_fields = 1
|
||||
endif
|
||||
|
||||
syn case match
|
||||
|
||||
syn match vDeclType "\<\(struct\|interface\)\>"
|
||||
|
||||
syn keyword vDirective module import
|
||||
syn keyword vDeclaration pub mut const type enum
|
||||
syn region vIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn match vIncluded display contained "<[^>]*>"
|
||||
syn match vFlagDefinition display contained "\s\i[^\n]*"
|
||||
syn match vInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=vIncluded
|
||||
syn match vFlag display "^\s*\zs\(%:\|#\)\s*flag\>\s*[^\n]*" contains=vFlagDefinition
|
||||
syn region vShebang display start=/^#!/ end=/$/
|
||||
|
||||
hi def link vDirective Statement
|
||||
hi def link vDeclaration Keyword
|
||||
hi def link vDeclType Keyword
|
||||
hi def link vInclude Include
|
||||
hi def link vFlag Include
|
||||
hi def link vIncluded vString
|
||||
hi def link vFlagDefinition vString
|
||||
hi def link vShebang Include
|
||||
|
||||
" Keywords within functions
|
||||
syn keyword vStatement defer go goto return break continue fallthrough
|
||||
syn keyword vConditional if else switch match or
|
||||
syn keyword vLabel case default
|
||||
syn keyword vRepeat for in
|
||||
syn match vCodeGen /$if\>/
|
||||
syn match vCodeGen /\.fields\>/
|
||||
syn match vCodeGen /\.$\i*\>/
|
||||
|
||||
hi def link vStatement Statement
|
||||
hi def link vConditional Conditional
|
||||
hi def link vLabel Label
|
||||
hi def link vRepeat Repeat
|
||||
hi def link vCodeGen Identifier
|
||||
|
||||
" Predefined types
|
||||
syn keyword vType chan map bool string error voidptr
|
||||
syn keyword vSignedInts int i8 i16 i32 i64 rune intptr
|
||||
syn keyword vUnsignedInts byte uint u8 u16 u32 u64 byteptr
|
||||
syn keyword vFloats f32 f64 floatptr
|
||||
syn keyword vComplexes complex64 complex128
|
||||
|
||||
hi def link vType Type
|
||||
hi def link vSignedInts Type
|
||||
hi def link vUnsignedInts Type
|
||||
hi def link vFloats Type
|
||||
hi def link vComplexes Type
|
||||
|
||||
" Treat fn specially: it's a declaration at the start of a line, but a type
|
||||
" elsewhere. Order matters here.
|
||||
" syn match vType /\<fn\>/
|
||||
syn match vDeclaration /\<fn\>/
|
||||
syn match vDeclaration contained /\<fn\>/
|
||||
|
||||
" Predefined functions and values
|
||||
syn keyword vBuiltins assert C cap complex copy delete exit imag
|
||||
syn keyword vBuiltins print println eprint eprintln print_backtrace
|
||||
syn keyword vBuiltins float_calloc ok memdup range_int real recover
|
||||
syn keyword vBuiltins malloc byte_calloc float_calloc
|
||||
syn keyword vBuiltins isok isnil panic on_panic
|
||||
syn keyword vConstants iota true false
|
||||
syn match vBuiltins /\<json\.\(encode\|decode\)\>/
|
||||
|
||||
hi def link vBuiltins Keyword
|
||||
hi def link vConstants Keyword
|
||||
|
||||
" Comments; their contents
|
||||
syn keyword vTodo contained TODO FIXME XXX BUG
|
||||
syn cluster vCommentGroup contains=vTodo
|
||||
syn region vComment start="/\*" end="\*/" contains=@vCommentGroup,@Spell
|
||||
syn region vComment start="//" end="$" contains=@vCommentGroup,@Spell
|
||||
|
||||
hi def link vComment Comment
|
||||
hi def link vTodo Todo
|
||||
|
||||
" Go escapes
|
||||
syn match vEscapeOctal display contained "\\[0-7]\{3}"
|
||||
syn match vEscapeVar display contained "\$[0-9A-Za-z\.]*"
|
||||
syn match vEscapeVar display contained "\${[^}]*}"
|
||||
syn match vEscapeC display contained +\\[abfnrtv\\'"]+
|
||||
syn match vEscapeX display contained "\\x\x\{2}"
|
||||
syn match vEscapeU display contained "\\u\x\{4}"
|
||||
syn match vEscapeBigU display contained "\\U\x\{8}"
|
||||
syn match vEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+
|
||||
|
||||
hi def link vEscapeOctal vSpecialString
|
||||
hi def link vEscapeVar vSpecialString
|
||||
hi def link vEscapeC vSpecialString
|
||||
hi def link vEscapeX vSpecialString
|
||||
hi def link vEscapeU vSpecialString
|
||||
hi def link vEscapeBigU vSpecialString
|
||||
hi def link vSpecialString Special
|
||||
hi def link vEscapeError Error
|
||||
|
||||
" Strings and their contents
|
||||
syn cluster vStringGroup contains=vEscapeOctal,vEscapeVar,vEscapeC,vEscapeX,vEscapeU,vEscapeBigU,vEscapeError
|
||||
syn region vString start=+"+ skip=+\\\\\|\\'+ end=+"+ contains=@vStringGroup
|
||||
syn region vRawString start=+`+ end=+`+
|
||||
|
||||
hi def link vString String
|
||||
hi def link vRawString String
|
||||
|
||||
" Characters; their contents
|
||||
syn cluster vCharacterGroup contains=vEscapeOctal,vEscapeC,vEscapeVar,vEscapeX,vEscapeU,vEscapeBigU
|
||||
syn region vCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@vCharacterGroup
|
||||
|
||||
hi def link vCharacter Character
|
||||
|
||||
" Regions
|
||||
syn region vBlock start="{" end="}" transparent fold
|
||||
syn region vParen start='(' end=')' transparent
|
||||
|
||||
" Integers
|
||||
syn match vDecimalInt "\<\d\+\([Ee]\d\+\)\?\>"
|
||||
syn match vHexadecimalInt "\<0x\x\+\>"
|
||||
syn match vOctalInt "\<0\o\+\>"
|
||||
syn match vOctalError "\<0\o*[89]\d*\>"
|
||||
|
||||
hi def link vDecimalInt Integer
|
||||
hi def link vHexadecimalInt Integer
|
||||
hi def link vOctalInt Integer
|
||||
hi def link Integer Number
|
||||
|
||||
" Floating point
|
||||
syn match vFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
|
||||
syn match vFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
|
||||
syn match vFloat "\<\d\+[Ee][-+]\d\+\>"
|
||||
|
||||
hi def link vFloat Float
|
||||
|
||||
" Imaginary literals
|
||||
syn match vImaginary "\<\d\+i\>"
|
||||
syn match vImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
|
||||
syn match vImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
|
||||
syn match vImaginary "\<\d\+[Ee][-+]\d\+i\>"
|
||||
|
||||
hi def link vImaginary Number
|
||||
|
||||
" Generics
|
||||
syn match vGenericBrackets display contained "[<>]"
|
||||
syn match vInterfaceDeclaration display "\s*\zsinterface\s*\i*\s*<[^>]*>" contains=vDeclType,vGenericBrackets
|
||||
syn match vStructDeclaration display "\s*\zsstruct\s*\i*\s*<[^>]*>" contains=vDeclType,vGenericBrackets
|
||||
" vFunctionName only appears when v_highlight_function_calls set
|
||||
syn match vFuncDeclaration display "\s*\zsfn\s*\i*\s*<[^>]*>" contains=vFunctionName,vDeclaration,vGenericBrackets
|
||||
|
||||
hi def link vGenericBrackets Identifier
|
||||
|
||||
" Spaces after "[]"
|
||||
if v_highlight_array_whitespace_error != 0
|
||||
syn match vSpaceError display "\(\[\]\)\@<=\s\+"
|
||||
endif
|
||||
|
||||
" Spacing errors around the 'chan' keyword
|
||||
if v_highlight_chan_whitespace_error != 0
|
||||
" receive-only annotation on chan type
|
||||
syn match vSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
|
||||
" send-only annotation on chan type
|
||||
syn match vSpaceError display "\(\<chan\)\@<=\s\+\(<-\)\@="
|
||||
" value-ignoring receives in a few contexts
|
||||
syn match vSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
|
||||
endif
|
||||
|
||||
" Space-tab error
|
||||
if v_highlight_space_tab_error != 0
|
||||
syn match vSpaceError display " \+\t"me=e-1
|
||||
endif
|
||||
|
||||
" Trailing white space error
|
||||
if v_highlight_trailing_whitespace_error != 0
|
||||
syn match vSpaceError display excludenl "\s\+$"
|
||||
endif
|
||||
|
||||
hi def link vSpaceError Error
|
||||
|
||||
" Function calls and Fields are from: https://github.com/fatih/vim-go/blob/master/syntax/go.vim
|
||||
" Function calls;
|
||||
if v_highlight_function_calls
|
||||
syn match vFunctionCall /\w\+\ze\s*(/ contains=vBuiltins,vDeclaration
|
||||
syn match vFunctionName display contained /\s\w\+/
|
||||
hi def link vFunctionName Special
|
||||
endif
|
||||
|
||||
hi def link vFunctionCall Special
|
||||
|
||||
" Fields;
|
||||
if v_highlight_fields
|
||||
" 1. Match a sequence of word characters coming after a '.'
|
||||
" 2. Require the following but dont match it: ( \@= see :h E59)
|
||||
" - The symbols: / - + * % OR
|
||||
" - The symbols: [] {} <> ) OR
|
||||
" - The symbols: \n \r space OR
|
||||
" - The symbols: , : .
|
||||
" 3. Have the start of highlight (hs) be the start of matched
|
||||
" pattern (s) offsetted one to the right (+1) (see :h E401)
|
||||
syn match vField /\.\w\+\
|
||||
\%(\%([\/\-\+*%]\)\|\
|
||||
\%([\[\]{}<\>\)]\)\|\
|
||||
\%([\!=\^|&]\)\|\
|
||||
\%([\n\r\ ]\)\|\
|
||||
\%([,\:.]\)\)\@=/hs=s+1
|
||||
endif
|
||||
hi def link vField Identifier
|
||||
|
||||
" Search backwards for a global declaration to start processing the syntax.
|
||||
"syn sync match vSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
||||
|
||||
" There's a bug in the implementation of grouphere. For now, use the
|
||||
" following as a more expensive/less precise workaround.
|
||||
syn sync minlines=500
|
||||
|
||||
let b:current_syntax = 'vlang'
|
||||
|
||||
" vim: sw=2 sts=2 et
|
||||
|
||||
endif
|
||||
@@ -33,17 +33,17 @@ syn match zigBuiltinFn "\v\@(addWithOverflow|ArgType|atomicLoad|bitCast|breakpoi
|
||||
syn match zigBuiltinFn "\v\@(alignCast|alignOf|cDefine|cImport|cInclude)>"
|
||||
syn match zigBuiltinFn "\v\@(cUndef|canImplicitCast|clz|cmpxchgWeak|cmpxchgStrong|compileError)>"
|
||||
syn match zigBuiltinFn "\v\@(compileLog|ctz|popCount|divExact|divFloor|divTrunc)>"
|
||||
syn match zigBuiltinFn "\v\@(embedFile|export|tagName|TagType|errorName)>"
|
||||
syn match zigBuiltinFn "\v\@(embedFile|export|tagName|TagType|errorName|call)>"
|
||||
syn match zigBuiltinFn "\v\@(errorReturnTrace|fence|fieldParentPtr|field|unionInit)>"
|
||||
syn match zigBuiltinFn "\v\@(frameAddress|import|inlineCall|newStackCall|asyncCall|intToPtr|IntType)>"
|
||||
syn match zigBuiltinFn "\v\@(frameAddress|import|newStackCall|asyncCall|intToPtr|IntType)>"
|
||||
syn match zigBuiltinFn "\v\@(maxValue|memberCount|memberName|memberType|as)>"
|
||||
syn match zigBuiltinFn "\v\@(memcpy|memset|minValue|mod|mulWithOverflow|splat)>"
|
||||
syn match zigBuiltinFn "\v\@(noInlineCall|bitOffsetOf|byteOffsetOf|OpaqueType|panic|ptrCast)>"
|
||||
syn match zigBuiltinFn "\v\@(bitOffsetOf|byteOffsetOf|OpaqueType|panic|ptrCast)>"
|
||||
syn match zigBuiltinFn "\v\@(ptrToInt|rem|returnAddress|setCold|Type|shuffle)>"
|
||||
syn match zigBuiltinFn "\v\@(setRuntimeSafety|setEvalBranchQuota|setFloatMode)>"
|
||||
syn match zigBuiltinFn "\v\@(setGlobalLinkage|setGlobalSection|shlExact|This|hasDecl|hasField)>"
|
||||
syn match zigBuiltinFn "\v\@(shlWithOverflow|shrExact|sizeOf|sqrt|byteSwap|subWithOverflow|intCast|floatCast|intToFloat|floatToInt|boolToInt|errSetCast)>"
|
||||
syn match zigBuiltinFn "\v\@(truncate|typeId|typeInfo|typeName|typeOf|atomicRmw|bytesToSlice|sliceToBytes)>"
|
||||
syn match zigBuiltinFn "\v\@(truncate|typeId|typeInfo|typeName|TypeOf|atomicRmw|bytesToSlice|sliceToBytes)>"
|
||||
syn match zigBuiltinFn "\v\@(intToError|errorToInt|intToEnum|enumToInt|setAlignStack|frame|Frame|frameSize|bitReverse|Vector)>"
|
||||
syn match zigBuiltinFn "\v\@(sin|cos|exp|exp2|ln|log2|log10|fabs|floor|ceil|trunc|round)>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user