mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Update all packages
This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
" This file describes a very basic syntax for TomDoc comments in a
|
|
||||||
" CoffeeScript file.
|
|
||||||
"
|
|
||||||
" For more information on TomDoc, check it out here: http://tomdoc.org/
|
|
||||||
"
|
|
||||||
|
|
||||||
syn keyword tomdocKeywords Returns containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Throws containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Examples containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Signature containedin=coffeeComment contained
|
|
||||||
|
|
||||||
syn match tomdocArguments +\s*[A-Za-z0-9_\-&\*:]*\(\s*- \)+he=e-3 containedin=coffeeComment contained
|
|
||||||
|
|
||||||
syn match tomdocDescriptions +\s*Public:+he=e-1 containedin=coffeeComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=coffeeComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=coffeeComment contained
|
|
||||||
|
|
||||||
hi default link tomdocDescriptions String
|
|
||||||
hi default link tomdocKeywords String
|
|
||||||
hi default link tomdocArguments HELP
|
|
||||||
@@ -1,23 +1,3 @@
|
|||||||
" This file describes a very basic syntax for TomDoc comments in a Ruby file.
|
|
||||||
"
|
|
||||||
" For more information on TomDoc, check it out here: http://tomdoc.org/
|
|
||||||
"
|
|
||||||
|
|
||||||
syn keyword tomdocKeywords Returns containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Yields containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Raises containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Examples containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Signature containedin=rubyComment contained
|
|
||||||
|
|
||||||
syn match tomdocArguments +\s*[A-Za-z0-9_\-&\*:]*\(\s*- \)+he=e-3 containedin=rubyComment contained
|
|
||||||
|
|
||||||
syn match tomdocDescriptions +\s*Public:+he=e-1 containedin=rubyComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=rubyComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=rubyComment contained
|
|
||||||
|
|
||||||
hi default link tomdocDescriptions String
|
|
||||||
hi default link tomdocKeywords String
|
|
||||||
hi default link tomdocArguments HELP
|
|
||||||
" Ruby syntax extensions for highlighting YARD documentation.
|
" Ruby syntax extensions for highlighting YARD documentation.
|
||||||
"
|
"
|
||||||
" Author: Joel Holdbrooks <https://github.com/noprompt>
|
" Author: Joel Holdbrooks <https://github.com/noprompt>
|
||||||
|
|||||||
@@ -235,9 +235,9 @@ endfunction
|
|||||||
|
|
||||||
let s:_hexcolor = '#\(\x\{3}\|\x\{6}\)\>' " submatch 1
|
let s:_hexcolor = '#\(\x\{3}\|\x\{6}\)\>' " submatch 1
|
||||||
let s:_funcname = '\(rgb\|hsl\)a\?' " submatch 2
|
let s:_funcname = '\(rgb\|hsl\)a\?' " submatch 2
|
||||||
let s:_numval = '\(\d\{1,3}%\?\)' " submatch 3,4,5
|
|
||||||
let s:_ws_ = '\s*'
|
let s:_ws_ = '\s*'
|
||||||
let s:_listsep = s:_ws_ . ',' . s:_ws_
|
let s:_numval = s:_ws_ . '\(\d\{1,3}%\?\)' " submatch 3,4,5
|
||||||
|
let s:_listsep = s:_ws_ . ','
|
||||||
let s:_otherargs_ = '\%(,[^)]*\)\?'
|
let s:_otherargs_ = '\%(,[^)]*\)\?'
|
||||||
let s:_funcexpr = s:_funcname . '[(]' . s:_numval . s:_listsep . s:_numval . s:_listsep . s:_numval . s:_ws_ . s:_otherargs_ . '[)]'
|
let s:_funcexpr = s:_funcname . '[(]' . s:_numval . s:_listsep . s:_numval . s:_listsep . s:_numval . s:_ws_ . s:_otherargs_ . '[)]'
|
||||||
let s:_csscolor = s:_hexcolor . '\|' . s:_funcexpr
|
let s:_csscolor = s:_hexcolor . '\|' . s:_funcexpr
|
||||||
|
|||||||
@@ -601,7 +601,7 @@ let g:xmldata_html5 = {
|
|||||||
\ ],
|
\ ],
|
||||||
\ 'meta': [
|
\ 'meta': [
|
||||||
\ [],
|
\ [],
|
||||||
\ extend(copy(global_attributes), {'name': [], 'http-equiv': ['refresh', 'default-style', 'content-type'], 'content': [], 'charset': charset})
|
\ extend(copy(global_attributes), {'name': ['application-name', 'author', 'description', 'generator', 'referrer', 'creator', 'googlebot', 'publisher', 'robots', 'slurp', 'viewport', 'theme-color'], 'http-equiv': ['refresh', 'default-style', 'content-type'], 'content': [], 'charset': charset})
|
||||||
\ ],
|
\ ],
|
||||||
\ 'meter': [
|
\ 'meter': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
|
|||||||
@@ -3,11 +3,14 @@ if exists("current_compiler")
|
|||||||
endif
|
endif
|
||||||
let current_compiler = "typescript"
|
let current_compiler = "typescript"
|
||||||
|
|
||||||
|
if !exists("g:typescript_compiler_binary")
|
||||||
|
let g:typescript_compiler_binary = "tsc"
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists("g:typescript_compiler_options")
|
if !exists("g:typescript_compiler_options")
|
||||||
let g:typescript_compiler_options = ""
|
let g:typescript_compiler_options = ""
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let &l:makeprg = g:typescript_compiler_binary . ' ' . g:typescript_compiler_options . ' $* %'
|
||||||
let &l:makeprg='tsc' . g:typescript_compiler_options . ' $* %'
|
|
||||||
|
|
||||||
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
|
|||||||
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
|
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
|
||||||
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
||||||
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
||||||
autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
|
autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
||||||
autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail
|
autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail
|
||||||
autocmd BufNewFile,BufRead *.git/**
|
autocmd BufNewFile,BufRead *.git/**
|
||||||
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
|
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
|
||||||
\ set ft=git |
|
\ set ft=git |
|
||||||
@@ -202,6 +202,7 @@ au BufRead,BufNewFile *.textile set filetype=textile
|
|||||||
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
||||||
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux
|
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux
|
||||||
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
||||||
|
autocmd BufNewFile,BufRead Cargo.lock set filetype=toml
|
||||||
autocmd BufNewFile,BufRead *.twig set filetype=twig
|
autocmd BufNewFile,BufRead *.twig set filetype=twig
|
||||||
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
||||||
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
|
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
|
||||||
|
|||||||
268
ftplugin/csv.vim
268
ftplugin/csv.vim
@@ -1,11 +1,11 @@
|
|||||||
" Filetype plugin for editing CSV files. "{{{1
|
" Filetype plugin for editing CSV files. "{{{1
|
||||||
" Author: Christian Brabandt <cb@256bit.org>
|
" Author: Christian Brabandt <cb@256bit.org>
|
||||||
" Version: 0.30
|
" Version: 0.31
|
||||||
" Script: http://www.vim.org/scripts/script.php?script_id=2830
|
" Script: http://www.vim.org/scripts/script.php?script_id=2830
|
||||||
" License: VIM License
|
" License: VIM License
|
||||||
" Last Change: Thu, 27 Mar 2014 23:28:40 +0100
|
" Last Change: Thu, 15 Jan 2015 21:05:10 +0100
|
||||||
" Documentation: see :help ft-csv.txt
|
" Documentation: see :help ft-csv.txt
|
||||||
" GetLatestVimScripts: 2830 29 :AutoInstall: csv.vim
|
" GetLatestVimScripts: 2830 30 :AutoInstall: csv.vim
|
||||||
"
|
"
|
||||||
" Some ideas are taken from the wiki http://vim.wikia.com/wiki/VimTip667
|
" Some ideas are taken from the wiki http://vim.wikia.com/wiki/VimTip667
|
||||||
" though, implementation differs.
|
" though, implementation differs.
|
||||||
@@ -90,7 +90,7 @@ fu! <sid>Init(startline, endline) "{{{3
|
|||||||
" - Should work with most ugly solutions that are available
|
" - Should work with most ugly solutions that are available
|
||||||
let b:col='\%(\%(\%(' . (b:delimiter !~ '\s' ? '\s*' : '') .
|
let b:col='\%(\%(\%(' . (b:delimiter !~ '\s' ? '\s*' : '') .
|
||||||
\ '"\%(' . (exists("g:csv_nl") ? '\_' : '' ) .
|
\ '"\%(' . (exists("g:csv_nl") ? '\_' : '' ) .
|
||||||
\ '[^"]\|""\)*"\)' . s:del . '\)\|\%(' .
|
\ '[^"]\|""\)*"\s*\)' . s:del . '\)\|\%(' .
|
||||||
\ '[^' . b:delimiter . ']*' . s:del . '\)\)'
|
\ '[^' . b:delimiter . ']*' . s:del . '\)\)'
|
||||||
let b:col_end='\%(\%(\%(' . (b:delimiter !~ '\s' ? '\s*' : '') .
|
let b:col_end='\%(\%(\%(' . (b:delimiter !~ '\s' ? '\s*' : '') .
|
||||||
\ '"\%(' . (exists("g:csv_nl") ? '\_' : '' ) .
|
\ '"\%(' . (exists("g:csv_nl") ? '\_' : '' ) .
|
||||||
@@ -147,7 +147,7 @@ fu! <sid>Init(startline, endline) "{{{3
|
|||||||
let b:undo_ftplugin .= "| unlet! b:delimiter b:col"
|
let b:undo_ftplugin .= "| unlet! b:delimiter b:col"
|
||||||
\ . "| unlet! b:csv_fixed_width_cols b:csv_filter"
|
\ . "| unlet! b:csv_fixed_width_cols b:csv_filter"
|
||||||
\ . "| unlet! b:csv_fixed_width b:csv_list b:col_width"
|
\ . "| unlet! b:csv_fixed_width b:csv_list b:col_width"
|
||||||
\ . "| unlet! b:csv_SplitWindow b:csv_headerline"
|
\ . "| unlet! b:csv_SplitWindow b:csv_headerline b:csv_cmt"
|
||||||
\ . "| unlet! b:csv_thousands_sep b:csv_decimal_sep"
|
\ . "| unlet! b:csv_thousands_sep b:csv_decimal_sep"
|
||||||
\. " | unlet! b:browsefilter b:csv_cmt"
|
\. " | unlet! b:browsefilter b:csv_cmt"
|
||||||
\. " | unlet! b:csv_arrange_leftalign"
|
\. " | unlet! b:csv_arrange_leftalign"
|
||||||
@@ -182,7 +182,7 @@ fu! <sid>Init(startline, endline) "{{{3
|
|||||||
" \ delf <sid>SaveOptions | delf <sid>CheckDuplicates |
|
" \ delf <sid>SaveOptions | delf <sid>CheckDuplicates |
|
||||||
" \ delf <sid>CompleteColumnNr | delf <sid>CSVPat | delf <sid>Transpose |
|
" \ delf <sid>CompleteColumnNr | delf <sid>CSVPat | delf <sid>Transpose |
|
||||||
" \ delf <sid>LocalSettings() | delf <sid>AddColumn | delf <sid>SubstituteInColumn
|
" \ delf <sid>LocalSettings() | delf <sid>AddColumn | delf <sid>SubstituteInColumn
|
||||||
" \ delf <sid>SetupQuitPre() | delf CSV_CloseBuffer
|
" \ delf <sid>SetupAutoCmd() | delf CSV_CloseBuffer
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>LocalSettings(type) "{{{3
|
fu! <sid>LocalSettings(type) "{{{3
|
||||||
@@ -194,11 +194,8 @@ fu! <sid>LocalSettings(type) "{{{3
|
|||||||
let b:undo_ftplugin = "setlocal sol& tw< wrap<"
|
let b:undo_ftplugin = "setlocal sol& tw< wrap<"
|
||||||
|
|
||||||
" Set browsefilter
|
" Set browsefilter
|
||||||
if (v:version > 703 || (v:version == 703 && has("patch593")))
|
let b:browsefilter="CSV Files (*.csv, *.dat)\t*.csv;*.dat\n".
|
||||||
\ && exists("browsefilter")
|
|
||||||
let b:browsefilter="CSV Files (*.csv, *.dat)\t*.csv;*.dat\n".
|
|
||||||
\ "All Files\t*.*\n"
|
\ "All Files\t*.*\n"
|
||||||
endif
|
|
||||||
|
|
||||||
if has("conceal")
|
if has("conceal")
|
||||||
setl cole=2 cocu=nc
|
setl cole=2 cocu=nc
|
||||||
@@ -341,7 +338,8 @@ fu! <sid>SearchColumn(arg) "{{{3
|
|||||||
endif
|
endif
|
||||||
let @/ = <sid>GetPat(colnr, maxcolnr, '\%('.pat. '\)')
|
let @/ = <sid>GetPat(colnr, maxcolnr, '\%('.pat. '\)')
|
||||||
try
|
try
|
||||||
norm! n
|
" force redraw, so that the search pattern isn't shown
|
||||||
|
exe "norm! n\<c-l>"
|
||||||
catch /^Vim\%((\a\+)\)\=:E486/
|
catch /^Vim\%((\a\+)\)\=:E486/
|
||||||
" Pattern not found
|
" Pattern not found
|
||||||
echohl Error
|
echohl Error
|
||||||
@@ -619,10 +617,6 @@ fu! <sid>ColWidth(colnr) "{{{3
|
|||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>ArrangeCol(first, last, bang, limit) range "{{{3
|
fu! <sid>ArrangeCol(first, last, bang, limit) range "{{{3
|
||||||
"TODO: Why doesn't that work?
|
|
||||||
" is this because of the range flag?
|
|
||||||
" It's because of the way, Vim works with
|
|
||||||
" a:firstline and a:lastline parameter, therefore
|
|
||||||
" explicitly give the range as argument to the function
|
" explicitly give the range as argument to the function
|
||||||
if exists("b:csv_fixed_width_cols")
|
if exists("b:csv_fixed_width_cols")
|
||||||
" Nothing to do
|
" Nothing to do
|
||||||
@@ -713,6 +707,8 @@ fu! <sid>CalculateColumnWidth() "{{{3
|
|||||||
" delete buffer content in variable b:csv_list,
|
" delete buffer content in variable b:csv_list,
|
||||||
" this was only necessary for calculating the max width
|
" this was only necessary for calculating the max width
|
||||||
unlet! b:csv_list
|
unlet! b:csv_list
|
||||||
|
unlet! s:columnize_count
|
||||||
|
unlet! s:decimal_column
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>Columnize(field) "{{{3
|
fu! <sid>Columnize(field) "{{{3
|
||||||
@@ -736,51 +732,83 @@ fu! <sid>Columnize(field) "{{{3
|
|||||||
" Careful: Keep this fast! Using
|
" Careful: Keep this fast! Using
|
||||||
" let width=get(b:col_width,<SID>WColumn()-1,20)
|
" let width=get(b:col_width,<SID>WColumn()-1,20)
|
||||||
" is too slow, so we are using:
|
" is too slow, so we are using:
|
||||||
let width=get(b:col_width, (s:columnize_count % s:max_cols), 20)
|
let colnr = s:columnize_count % s:max_cols
|
||||||
|
let width=get(b:col_width, colnr, 20)
|
||||||
|
let align='r'
|
||||||
|
if exists('b:csv_arrange_align')
|
||||||
|
let align_list=split(get(b:, 'csv_arrange_align', " "), '\zs')
|
||||||
|
try
|
||||||
|
let align = align_list[colnr]
|
||||||
|
catch
|
||||||
|
let align = 'r'
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
if ((align isnot? 'r' && align isnot? 'l' &&
|
||||||
|
\ align isnot? 'c' && align isnot? '.') || get(b:, 'csv_arrange_leftalign', 0))
|
||||||
|
let align = 'r'
|
||||||
|
endif
|
||||||
|
|
||||||
let s:columnize_count += 1
|
let s:columnize_count += 1
|
||||||
let has_delimiter = (a:field =~# b:delimiter.'$')
|
let has_delimiter = (a:field =~# b:delimiter.'$')
|
||||||
if v:version > 703 || v:version == 703 && has("patch713")
|
if align is? 'l'
|
||||||
" printf knows about %S (e.g. can handle char length
|
" left-align content
|
||||||
if get(b:, 'csv_arrange_leftalign',0)
|
return printf("%-*S%s", width+1 ,
|
||||||
" left-align content
|
\ (has_delimiter ? a:field[:-2] : a:field),
|
||||||
return printf("%-*S%s", width+1 ,
|
\ (has_delimiter ? b:delimiter : ' '))
|
||||||
\ (has_delimiter ?
|
elseif align is? 'c'
|
||||||
\ matchstr(a:field, '.*\%('.b:delimiter.'\)\@=') : a:field),
|
" center the column
|
||||||
\ (has_delimiter ? b:delimiter : ''))
|
let t = width - len(split(a:field, '\zs'))
|
||||||
else
|
let leftwidth = t/2
|
||||||
return printf("%*S", width+1 , a:field)
|
" uneven width, add one
|
||||||
|
let rightwidth = (t%2 ? leftwidth+1 : leftwidth)
|
||||||
|
let field = (has_delimiter ? a:field[:-2] : a:field). repeat(' ', rightwidth)
|
||||||
|
return printf("%*S%s", width , field, (has_delimiter ? b:delimiter : ' '))
|
||||||
|
elseif align is? '.'
|
||||||
|
if !exists("s:decimal_column")
|
||||||
|
let s:decimal_column = {}
|
||||||
endif
|
endif
|
||||||
else
|
if get(s:decimal_column, colnr, 0) == 0
|
||||||
" printf only handles bytes
|
call <sid>CheckHeaderLine()
|
||||||
if !exists("g:csv_no_multibyte") &&
|
call <sid>NumberFormat()
|
||||||
\ match(a:field, '[^ -~]') != -1
|
let data = <sid>CopyCol('', colnr+1, '')[s:csv_fold_headerline : -1]
|
||||||
" match characters outside the ascii range
|
let pat1 = escape(s:nr_format[1], '.').'\zs[^'.s:nr_format[1].']*\ze'.
|
||||||
let a = split(a:field, '\zs')
|
\ (has_delimiter ? b:delimiter : '').'$'
|
||||||
let add = eval(join(map(a, 'len(v:val)'), '+'))
|
let pat2 = '\d\+\ze\%(\%('.escape(s:nr_format[1], '.'). '\d\+\)\|'.
|
||||||
let add -= len(a)
|
\ (has_delimiter ? b:delimiter : '').'$\)'
|
||||||
else
|
let data1 = map(copy(data), 'matchstr(v:val, pat1)')
|
||||||
let add = 0
|
let data2 = map(data, 'matchstr(v:val, pat2)')
|
||||||
endif
|
" strlen should be okay for decimals...
|
||||||
|
let data1 = map(data1, 'strlen(v:val)')
|
||||||
" Add one for the frame
|
let data2 = map(data2, 'strlen(v:val)')
|
||||||
" plus additional width for multibyte chars,
|
let dec = max(data1)
|
||||||
" since printf(%*s..) uses byte width!
|
let scal = max(data2)
|
||||||
let width = width + add + 1
|
if dec + scal + 1 + (has_delimiter ? 1 : 0) > width
|
||||||
|
let width = dec + scal + 1 + (has_delimiter ? 1 :0)
|
||||||
if width == strlen(a:field)
|
let b:col_width[colnr] = width
|
||||||
" Column has correct length, don't use printf()
|
|
||||||
return a:field
|
|
||||||
else
|
|
||||||
if get(b:, 'csv_arrange_leftalign',0)
|
|
||||||
" left-align content
|
|
||||||
return printf("%-*s%s", width,
|
|
||||||
\ (has_delimiter ? matchstr(a:field, '.*\%('.b:delimiter.'\)\@=') : a:field),
|
|
||||||
\ (has_delimiter ? b:delimiter : ''))
|
|
||||||
else
|
|
||||||
return printf("%*s", width , a:field)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let s:decimal_column[colnr] = dec
|
||||||
|
else
|
||||||
|
let dec = get(s:decimal_column, colnr)
|
||||||
endif
|
endif
|
||||||
|
let field = (has_delimiter ? a:field[:-2] : a:field)
|
||||||
|
let fmt = printf("%%%d.%df", width+1, dec)
|
||||||
|
try
|
||||||
|
if s:nr_format[1] isnot '.'
|
||||||
|
let field = substitute(field, s:nr_format[1], '.', 'g')
|
||||||
|
let field = substitute(field, s:nr_format[0], '', 'g')
|
||||||
|
endif
|
||||||
|
if field =~? '\h' " text in the column, can't be converted to float
|
||||||
|
throw "no decimal"
|
||||||
|
endif
|
||||||
|
let result = printf(fmt, str2float(field)). (has_delimiter ? b:delimiter : ' ')
|
||||||
|
catch
|
||||||
|
let result = printf("%*S", width+2, a:field)
|
||||||
|
endtry
|
||||||
|
return result
|
||||||
|
else
|
||||||
|
" right align
|
||||||
|
return printf("%*S", width+1 , a:field)
|
||||||
endif
|
endif
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
@@ -809,14 +837,13 @@ fu! <sid>GetColPat(colnr, zs_flag) "{{{3
|
|||||||
return pat . (a:zs_flag ? '\zs' : '')
|
return pat . (a:zs_flag ? '\zs' : '')
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>SetupQuitPre(window) "{{{3
|
fu! <sid>SetupAutoCmd(window,bufnr) "{{{3
|
||||||
" Setup QuitPre autocommand to quit cleanly
|
" Setup QuitPre autocommand to quit cleanly
|
||||||
if exists("##QuitPre")
|
aug CSV_QuitPre
|
||||||
augroup CSV_QuitPre
|
au!
|
||||||
au!
|
exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")"
|
||||||
exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")"
|
exe "au CursorHold <buffer=".a:bufnr."> call CSV_SetSplitOptions(".a:window.")"
|
||||||
augroup end
|
aug END
|
||||||
endif
|
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
||||||
@@ -837,8 +864,9 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
|||||||
let _sbo = &sbo
|
let _sbo = &sbo
|
||||||
let a = []
|
let a = []
|
||||||
let b=b:col
|
let b=b:col
|
||||||
|
let bufnr = bufnr('.')
|
||||||
if a:hor
|
if a:hor
|
||||||
setl scrollopt=hor scrollbind
|
setl scrollopt=hor scrollbind cursorbind
|
||||||
let _fdc = &l:fdc
|
let _fdc = &l:fdc
|
||||||
let lines = empty(a:lines) ? s:csv_fold_headerline : a:lines
|
let lines = empty(a:lines) ? s:csv_fold_headerline : a:lines
|
||||||
let a = getline(1,lines)
|
let a = getline(1,lines)
|
||||||
@@ -851,16 +879,21 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
|||||||
"setl syntax=csv
|
"setl syntax=csv
|
||||||
sil! doautocmd FileType csv
|
sil! doautocmd FileType csv
|
||||||
noa 1
|
noa 1
|
||||||
|
sil! sign unplace *
|
||||||
exe "resize" . lines
|
exe "resize" . lines
|
||||||
setl scrollopt=hor winfixheight nowrap
|
setl scrollopt=hor winfixheight nowrap cursorbind
|
||||||
"let &l:stl=repeat(' ', winwidth(0))
|
|
||||||
let &l:stl="%#Normal#".repeat(' ',winwidth(0))
|
let &l:stl="%#Normal#".repeat(' ',winwidth(0))
|
||||||
|
let s:local_stl = &l:stl
|
||||||
" set the foldcolumn to the same of the other window
|
" set the foldcolumn to the same of the other window
|
||||||
let &l:fdc = _fdc
|
let &l:fdc = _fdc
|
||||||
else
|
else
|
||||||
setl scrollopt=ver scrollbind
|
setl scrollopt=ver scrollbind cursorbind
|
||||||
noa 0
|
noa 0
|
||||||
let a=<sid>CopyCol('',1,a:lines)
|
if a:lines[-1:] is? '!'
|
||||||
|
let a=<sid>CopyCol('',a:lines,'')
|
||||||
|
else
|
||||||
|
let a=<sid>CopyCol('',1, a:lines-1)
|
||||||
|
endif
|
||||||
" Does it make sense to use the preview window?
|
" Does it make sense to use the preview window?
|
||||||
"vert sil! pedit |wincmd w | enew!
|
"vert sil! pedit |wincmd w | enew!
|
||||||
above vsp +enew
|
above vsp +enew
|
||||||
@@ -876,11 +909,14 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
|||||||
noa 0
|
noa 0
|
||||||
let b:csv_SplitWindow = winnr()
|
let b:csv_SplitWindow = winnr()
|
||||||
sil :call <sid>ArrangeCol(1,line('$'), 1, -1)
|
sil :call <sid>ArrangeCol(1,line('$'), 1, -1)
|
||||||
|
sil! sign unplace *
|
||||||
exe "vert res" . len(split(getline(1), '\zs'))
|
exe "vert res" . len(split(getline(1), '\zs'))
|
||||||
call matchadd("CSVHeaderLine", b:col)
|
call matchadd("CSVHeaderLine", b:col)
|
||||||
setl scrollopt=ver winfixwidth
|
setl scrollopt=ver winfixwidth cursorbind nonu nornu fdc=0
|
||||||
endif
|
endif
|
||||||
call <sid>SetupQuitPre(winnr())
|
call <sid>SetupAutoCmd(winnr(),bufnr)
|
||||||
|
" disable airline
|
||||||
|
let w:airline_disabled = 1
|
||||||
let win = winnr()
|
let win = winnr()
|
||||||
setl scrollbind buftype=nowrite bufhidden=wipe noswapfile nobuflisted
|
setl scrollbind buftype=nowrite bufhidden=wipe noswapfile nobuflisted
|
||||||
noa wincmd p
|
noa wincmd p
|
||||||
@@ -901,9 +937,9 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
|
|||||||
if exists("_sbo")
|
if exists("_sbo")
|
||||||
let &sbo = _sbo
|
let &sbo = _sbo
|
||||||
endif
|
endif
|
||||||
setl noscrollbind
|
setl noscrollbind nocursorbind
|
||||||
try
|
try
|
||||||
wincmd c
|
noa wincmd c
|
||||||
catch /^Vim\%((\a\+)\)\=:E444/ " cannot close last window
|
catch /^Vim\%((\a\+)\)\=:E444/ " cannot close last window
|
||||||
catch /^Vim\%((\a\+)\)\=:E517/ " buffer already wiped
|
catch /^Vim\%((\a\+)\)\=:E517/ " buffer already wiped
|
||||||
" no-op
|
" no-op
|
||||||
@@ -959,6 +995,9 @@ fu! <sid>MoveCol(forward, line, ...) "{{{3
|
|||||||
elseif line > line('$')
|
elseif line > line('$')
|
||||||
let line=line('$')
|
let line=line('$')
|
||||||
endif
|
endif
|
||||||
|
if foldclosed(line) != -1
|
||||||
|
let line = line > line('.') ? foldclosedend(line) : foldclosed(line)
|
||||||
|
endif
|
||||||
|
|
||||||
" Generate search pattern
|
" Generate search pattern
|
||||||
if colnr == 1
|
if colnr == 1
|
||||||
@@ -1906,7 +1945,7 @@ fu! <sid>CommandDefinitions() "{{{3
|
|||||||
call <sid>LocalCmd("CSVFixed", ':call <sid>InitCSVFixedWidth()', '')
|
call <sid>LocalCmd("CSVFixed", ':call <sid>InitCSVFixedWidth()', '')
|
||||||
call <sid>LocalCmd("NewRecord", ':call <sid>NewRecord(<line1>,
|
call <sid>LocalCmd("NewRecord", ':call <sid>NewRecord(<line1>,
|
||||||
\ <line2>, <q-args>)', '-nargs=? -range')
|
\ <line2>, <q-args>)', '-nargs=? -range')
|
||||||
call <sid>LocalCmd("NewDelimiter", ':call <sid>NewDelimiter(<q-args>)',
|
call <sid>LocalCmd("NewDelimiter", ':call <sid>NewDelimiter(<q-args>, 1, line(''$''))',
|
||||||
\ '-nargs=1')
|
\ '-nargs=1')
|
||||||
call <sid>LocalCmd("Duplicates", ':call <sid>CheckDuplicates(<q-args>)',
|
call <sid>LocalCmd("Duplicates", ':call <sid>CheckDuplicates(<q-args>)',
|
||||||
\ '-nargs=1 -complete=custom,<sid>CompleteColumnNr')
|
\ '-nargs=1 -complete=custom,<sid>CompleteColumnNr')
|
||||||
@@ -1993,7 +2032,7 @@ fu! <sid>SaveOptions(list) "{{{3
|
|||||||
return save
|
return save
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>NewDelimiter(newdelimiter) "{{{3
|
fu! <sid>NewDelimiter(newdelimiter, firstl, lastl) "{{{3
|
||||||
let save = <sid>SaveOptions(['ro', 'ma'])
|
let save = <sid>SaveOptions(['ro', 'ma'])
|
||||||
if exists("b:csv_fixed_width_cols")
|
if exists("b:csv_fixed_width_cols")
|
||||||
call <sid>Warn("NewDelimiter does not work with fixed width column!")
|
call <sid>Warn("NewDelimiter does not work with fixed width column!")
|
||||||
@@ -2005,8 +2044,12 @@ fu! <sid>NewDelimiter(newdelimiter) "{{{3
|
|||||||
if &l:ro
|
if &l:ro
|
||||||
setl noro
|
setl noro
|
||||||
endif
|
endif
|
||||||
let line=1
|
let delimiter = a:newdelimiter
|
||||||
while line <= line('$')
|
if a:newdelimiter is '\t'
|
||||||
|
let delimiter="\t"
|
||||||
|
endif
|
||||||
|
let line=a:firstl
|
||||||
|
while line <= a:lastl
|
||||||
" Don't change delimiter for comments
|
" Don't change delimiter for comments
|
||||||
if getline(line) =~ '^\s*\V'. escape(b:csv_cmt[0], '\\')
|
if getline(line) =~ '^\s*\V'. escape(b:csv_cmt[0], '\\')
|
||||||
let line+=1
|
let line+=1
|
||||||
@@ -2016,7 +2059,7 @@ fu! <sid>NewDelimiter(newdelimiter) "{{{3
|
|||||||
" Remove field delimiter
|
" Remove field delimiter
|
||||||
call map(fields, 'substitute(v:val, b:delimiter .
|
call map(fields, 'substitute(v:val, b:delimiter .
|
||||||
\ ''\?$'' , "", "")')
|
\ ''\?$'' , "", "")')
|
||||||
call setline(line, join(fields, a:newdelimiter))
|
call setline(line, join(fields, delimiter))
|
||||||
let line+=1
|
let line+=1
|
||||||
endwhile
|
endwhile
|
||||||
" reset local buffer options
|
" reset local buffer options
|
||||||
@@ -2024,7 +2067,17 @@ fu! <sid>NewDelimiter(newdelimiter) "{{{3
|
|||||||
call setbufvar('', '&'. key, value)
|
call setbufvar('', '&'. key, value)
|
||||||
endfor
|
endfor
|
||||||
"reinitialize the plugin
|
"reinitialize the plugin
|
||||||
|
if exists("g:csv_delim")
|
||||||
|
let _delim = g:csv_delim
|
||||||
|
endif
|
||||||
|
let g:csv_delim = delimiter
|
||||||
call <sid>Init(1,line('$'))
|
call <sid>Init(1,line('$'))
|
||||||
|
if exists("_delim")
|
||||||
|
let g:csv_delim = _delim
|
||||||
|
else
|
||||||
|
unlet g:csv_delim
|
||||||
|
endif
|
||||||
|
unlet! _delim
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
fu! <sid>IN(list, value) "{{{3
|
fu! <sid>IN(list, value) "{{{3
|
||||||
@@ -2207,6 +2260,23 @@ fu! <sid>Tabularize(bang, first, last) "{{{3
|
|||||||
let adjust_last = 0
|
let adjust_last = 0
|
||||||
call cursor(a:first,0)
|
call cursor(a:first,0)
|
||||||
call <sid>CheckHeaderLine()
|
call <sid>CheckHeaderLine()
|
||||||
|
let line=a:first
|
||||||
|
if exists("g:csv_table_leftalign")
|
||||||
|
let b:csv_arrange_leftalign = 1
|
||||||
|
endif
|
||||||
|
let newlines=[]
|
||||||
|
while line <= a:last
|
||||||
|
let curline = getline(line)
|
||||||
|
if empty(split(curline, b:delimiter))
|
||||||
|
" only empty delimiters, add one empty delimiter
|
||||||
|
" (:NewDelimiter strips trailing delimiter
|
||||||
|
let curline = repeat(b:delimiter, <sid>MaxColumns())
|
||||||
|
call add(newlines, line)
|
||||||
|
call setline(line, curline)
|
||||||
|
endif
|
||||||
|
let line+=1
|
||||||
|
endw
|
||||||
|
unlet! line
|
||||||
if exists("b:csv_fixed_width_cols")
|
if exists("b:csv_fixed_width_cols")
|
||||||
let cols=copy(b:csv_fixed_width_cols)
|
let cols=copy(b:csv_fixed_width_cols)
|
||||||
let pat = join(map(cols, ' ''\(\%''. v:val. ''c\)'' '), '\|')
|
let pat = join(map(cols, ' ''\(\%''. v:val. ''c\)'' '), '\|')
|
||||||
@@ -2223,21 +2293,35 @@ fu! <sid>Tabularize(bang, first, last) "{{{3
|
|||||||
" don't clear column width variable, might have been set in the
|
" don't clear column width variable, might have been set in the
|
||||||
" plugin!
|
" plugin!
|
||||||
sil call <sid>ArrangeCol(a:first, a:last, 0, -1)
|
sil call <sid>ArrangeCol(a:first, a:last, 0, -1)
|
||||||
|
if !get(b:, 'csv_arrange_leftalign',0)
|
||||||
|
for line in newlines
|
||||||
|
let cline = getline(line)
|
||||||
|
let cline = substitute(cline, '\s$', ' ', '')
|
||||||
|
call setline(line, cline)
|
||||||
|
endfor
|
||||||
|
unlet! line
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if empty(b:col_width)
|
if empty(b:col_width)
|
||||||
call <sid>Warn('An error occured, aborting!')
|
call <sid>Warn('An error occured, aborting!')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let b:col_width[-1] += 1
|
if get(b:, 'csv_arrange_leftalign', 0)
|
||||||
|
call map(b:col_width, 'v:val+1')
|
||||||
|
endif
|
||||||
|
if b:delimiter == "\t" && !get(b:, 'csv_arrange_leftalign',0)
|
||||||
|
let b:col_width[-1] += 1
|
||||||
|
endif
|
||||||
let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val)'), s:td.cros). s:td.ecol
|
let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val)'), s:td.cros). s:td.ecol
|
||||||
|
|
||||||
exe printf('sil %d,%ds/%s/%s/ge', a:first, (a:last+adjust_last),
|
call <sid>NewDelimiter(s:td.vbar, a:first, a:last+adjust_last)
|
||||||
\ (exists("b:csv_fixed_width_cols") ? pat : b:delimiter ), s:td.vbar)
|
"exe printf('sil %d,%ds/%s/%s/ge', a:first, (a:last+adjust_last),
|
||||||
|
" \ (exists("b:csv_fixed_width_cols") ? pat : b:delimiter ), s:td.vbar)
|
||||||
" Add vertical bar in first column, if there isn't already one
|
" Add vertical bar in first column, if there isn't already one
|
||||||
exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last,
|
exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last,
|
||||||
\ '^[^'. s:td.vbar. s:td.scol. ']', s:td.vbar.'&')
|
\ '^[^'. s:td.vbar. s:td.scol. ']', s:td.vbar.'&')
|
||||||
" And add a final vertical bar, if there isn't already
|
" And add a final vertical bar, if there isn't one already
|
||||||
exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last,
|
exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last,
|
||||||
\ '[^'. s:td.vbar. s:td.ecol. ']$', '&'. s:td.vbar)
|
\ '[^'. s:td.vbar. s:td.ecol. ']$', '&'. s:td.vbar)
|
||||||
" Make nice intersection graphs
|
" Make nice intersection graphs
|
||||||
@@ -2247,11 +2331,16 @@ fu! <sid>Tabularize(bang, first, last) "{{{3
|
|||||||
call append(a:first-1, s:td.ltop. join(line, s:td.dhor). s:td.rtop)
|
call append(a:first-1, s:td.ltop. join(line, s:td.dhor). s:td.rtop)
|
||||||
call append(a:last+adjust_last+1, s:td.lbot. join(line, s:td.uhor). s:td.rbot)
|
call append(a:last+adjust_last+1, s:td.lbot. join(line, s:td.uhor). s:td.rbot)
|
||||||
|
|
||||||
if s:csv_fold_headerline > 0 && !a:bang
|
if s:csv_fold_headerline > 0
|
||||||
"call <sid>NewRecord(s:csv_fold_headerline, s:csv_fold_headerline, 1)
|
|
||||||
call append(a:first + s:csv_fold_headerline, marginline)
|
call append(a:first + s:csv_fold_headerline, marginline)
|
||||||
let adjust_last += 1
|
let adjust_last += 1
|
||||||
endif
|
endif
|
||||||
|
" Adjust headerline to header of new table
|
||||||
|
let b:csv_headerline = (exists('b:csv_headerline')?b:csv_headerline+2:3)
|
||||||
|
call <sid>CheckHeaderLine()
|
||||||
|
" Adjust syntax highlighting
|
||||||
|
unlet! b:current_syntax
|
||||||
|
ru syntax/csv.vim
|
||||||
|
|
||||||
if a:bang
|
if a:bang
|
||||||
exe printf('sil %d,%ds/^%s\zs\n/&%s&/e', a:first + s:csv_fold_headerline, a:last + adjust_last,
|
exe printf('sil %d,%ds/^%s\zs\n/&%s&/e', a:first + s:csv_fold_headerline, a:last + adjust_last,
|
||||||
@@ -2484,8 +2573,23 @@ fu! CSV_WCol(...) "{{{3
|
|||||||
endtry
|
endtry
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
fu! CSV_SetSplitOptions(window) "{{{3
|
||||||
|
if exists("s:local_stl")
|
||||||
|
" local horizontal statusline
|
||||||
|
for opt in items({'&nu': &l:nu, '&rnu': &l:rnu, '&fdc': &fdc})
|
||||||
|
if opt[1] != getwinvar(a:window, opt[0])
|
||||||
|
call setwinvar(a:window, opt[0], opt[1])
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
" Check statusline (airline might change it)
|
||||||
|
if getwinvar(a:window, '&l:stl') != s:local_stl
|
||||||
|
call setwinvar(a:window, '&stl', s:local_stl)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
|
||||||
fu! CSV_CloseBuffer(buffer) "{{{3
|
fu! CSV_CloseBuffer(buffer) "{{{3
|
||||||
" Setup by SetupQuitPre autocommand
|
" Setup by SetupAutoCmd autocommand
|
||||||
try
|
try
|
||||||
if bufnr((a:buffer)+0) > -1
|
if bufnr((a:buffer)+0) > -1
|
||||||
exe a:buffer. "bw"
|
exe a:buffer. "bw"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function! LatexBox_GetMainFileName(...)
|
|||||||
" move up the directory tree until we find a .latexmain file.
|
" move up the directory tree until we find a .latexmain file.
|
||||||
" TODO: Should we be doing this recursion by default, or should there be a
|
" TODO: Should we be doing this recursion by default, or should there be a
|
||||||
" setting?
|
" setting?
|
||||||
while glob('*.latexmain') == ''
|
while glob('*.latexmain',1) == ''
|
||||||
let dirmodifier = dirmodifier.':h'
|
let dirmodifier = dirmodifier.':h'
|
||||||
let dirNew = fnameescape(expand(dirmodifier))
|
let dirNew = fnameescape(expand(dirmodifier))
|
||||||
" break from the loop if we cannot go up any further.
|
" break from the loop if we cannot go up any further.
|
||||||
@@ -41,7 +41,7 @@ function! LatexBox_GetMainFileName(...)
|
|||||||
exe 'cd '.dirLast
|
exe 'cd '.dirLast
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
let lheadfile = glob('*.latexmain')
|
let lheadfile = glob('*.latexmain',1)
|
||||||
if lheadfile != ''
|
if lheadfile != ''
|
||||||
" Remove the trailing .latexmain part of the filename... We never want
|
" Remove the trailing .latexmain part of the filename... We never want
|
||||||
" that.
|
" that.
|
||||||
|
|||||||
@@ -443,10 +443,32 @@ function! LatexBox_LatexErrors(status, ...)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Redefine uniq() for compatibility with older Vim versions (< 7.4.218)
|
||||||
|
function! s:uniq(list)
|
||||||
|
if exists('*uniq')
|
||||||
|
return uniq(a:list)
|
||||||
|
elseif len(a:list) <= 1
|
||||||
|
return a:list
|
||||||
|
endif
|
||||||
|
|
||||||
|
let last_element = get(a:list,0)
|
||||||
|
let uniq_list = [last_element]
|
||||||
|
|
||||||
|
for i in range(1, len(a:list)-1)
|
||||||
|
let next_element = get(a:list, i)
|
||||||
|
if last_element == next_element
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
let last_element = next_element
|
||||||
|
call add(uniq_list, next_element)
|
||||||
|
endfor
|
||||||
|
return uniq_list
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:log_contains_error(file)
|
function! s:log_contains_error(file)
|
||||||
let lines = readfile(a:file)
|
let lines = readfile(a:file)
|
||||||
let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''')
|
let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''')
|
||||||
let lines = uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
|
let lines = s:uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
|
||||||
let lines = filter(lines, 'filereadable(fnameescape(v:val))')
|
let lines = filter(lines, 'filereadable(fnameescape(v:val))')
|
||||||
return len(lines) > 0
|
return len(lines) > 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -5,31 +5,31 @@ if exists("g:LatexBox_no_mappings")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" latexmk {{{
|
" latexmk {{{
|
||||||
map <buffer> <LocalLeader>ll :Latexmk<CR>
|
noremap <buffer> <LocalLeader>ll :Latexmk<CR>
|
||||||
map <buffer> <LocalLeader>lL :Latexmk!<CR>
|
noremap <buffer> <LocalLeader>lL :Latexmk!<CR>
|
||||||
map <buffer> <LocalLeader>lc :LatexmkClean<CR>
|
noremap <buffer> <LocalLeader>lc :LatexmkClean<CR>
|
||||||
map <buffer> <LocalLeader>lC :LatexmkClean!<CR>
|
noremap <buffer> <LocalLeader>lC :LatexmkClean!<CR>
|
||||||
map <buffer> <LocalLeader>lg :LatexmkStatus<CR>
|
noremap <buffer> <LocalLeader>lg :LatexmkStatus<CR>
|
||||||
map <buffer> <LocalLeader>lG :LatexmkStatus!<CR>
|
noremap <buffer> <LocalLeader>lG :LatexmkStatus!<CR>
|
||||||
map <buffer> <LocalLeader>lk :LatexmkStop<CR>
|
noremap <buffer> <LocalLeader>lk :LatexmkStop<CR>
|
||||||
map <buffer> <LocalLeader>le :LatexErrors<CR>
|
noremap <buffer> <LocalLeader>le :LatexErrors<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" View {{{
|
" View {{{
|
||||||
map <buffer> <LocalLeader>lv :LatexView<CR>
|
noremap <buffer> <LocalLeader>lv :LatexView<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" TOC {{{
|
" TOC {{{
|
||||||
map <silent> <buffer> <LocalLeader>lt :LatexTOC<CR>
|
noremap <silent> <buffer> <LocalLeader>lt :LatexTOC<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" List of labels {{{
|
" List of labels {{{
|
||||||
map <silent> <buffer> <LocalLeader>lj :LatexLabels<CR>
|
noremap <silent> <buffer> <LocalLeader>lj :LatexLabels<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Folding {{{
|
" Folding {{{
|
||||||
if g:LatexBox_Folding == 1
|
if g:LatexBox_Folding == 1
|
||||||
map <buffer> <LocalLeader>lf :LatexFold<CR>
|
noremap <buffer> <LocalLeader>lf :LatexFold<CR>
|
||||||
endif
|
endif
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
@@ -44,12 +44,12 @@ endif
|
|||||||
" Define text objects {{{
|
" Define text objects {{{
|
||||||
vmap <buffer> ie <Plug>LatexBox_SelectCurrentEnvInner
|
vmap <buffer> ie <Plug>LatexBox_SelectCurrentEnvInner
|
||||||
vmap <buffer> ae <Plug>LatexBox_SelectCurrentEnvOuter
|
vmap <buffer> ae <Plug>LatexBox_SelectCurrentEnvOuter
|
||||||
omap <buffer> ie :normal vie<CR>
|
onoremap <buffer> ie :normal vie<CR>
|
||||||
omap <buffer> ae :normal vae<CR>
|
onoremap <buffer> ae :normal vae<CR>
|
||||||
vmap <buffer> i$ <Plug>LatexBox_SelectInlineMathInner
|
vmap <buffer> i$ <Plug>LatexBox_SelectInlineMathInner
|
||||||
vmap <buffer> a$ <Plug>LatexBox_SelectInlineMathOuter
|
vmap <buffer> a$ <Plug>LatexBox_SelectInlineMathOuter
|
||||||
omap <buffer> i$ :normal vi$<CR>
|
onoremap <buffer> i$ :normal vi$<CR>
|
||||||
omap <buffer> a$ :normal va$<CR>
|
onoremap <buffer> a$ :normal va$<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Jump between sections {{{
|
" Jump between sections {{{
|
||||||
|
|||||||
@@ -443,11 +443,17 @@ function! Fixedgq(lnum, count)
|
|||||||
let l:tw = &tw ? &tw : 80;
|
let l:tw = &tw ? &tw : 80;
|
||||||
|
|
||||||
let l:count = a:count
|
let l:count = a:count
|
||||||
|
let l:first_char = indent(a:lnum) + 1
|
||||||
|
|
||||||
if mode() == 'i' " gq was not pressed, but tw was set
|
if mode() == 'i' " gq was not pressed, but tw was set
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" This gq is only meant to do code with strings, not comments
|
||||||
|
if s:IsLineComment(a:lnum, l:first_char) || s:IsInMultilineComment(a:lnum, l:first_char)
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -106,10 +106,9 @@ fu! <sid>DoHighlight() "{{{3
|
|||||||
\ . s:col . '/ contains=CSVDelimiter'
|
\ . s:col . '/ contains=CSVDelimiter'
|
||||||
exe 'syn match CSVColumnOdd nextgroup=CSVColumnEven /'
|
exe 'syn match CSVColumnOdd nextgroup=CSVColumnEven /'
|
||||||
\ . s:col . '/ contains=CSVDelimiter'
|
\ . s:col . '/ contains=CSVDelimiter'
|
||||||
|
exe 'syn match CSVColumnHeaderEven nextgroup=CSVColumnHeaderOdd /\%<'. (get(b:, 'csv_headerline', 1)+1).'l'
|
||||||
exe 'syn match CSVColumnHeaderEven nextgroup=CSVColumnHeaderOdd /\%1l'
|
|
||||||
\. s:col . '/ contains=CSVDelimiter'
|
\. s:col . '/ contains=CSVDelimiter'
|
||||||
exe 'syn match CSVColumnHeaderOdd nextgroup=CSVColumnHeaderEven /\%1l'
|
exe 'syn match CSVColumnHeaderOdd nextgroup=CSVColumnHeaderEven /\%<'. (get(b:, 'csv_headerline', 1)+1).'l'
|
||||||
\. s:col . '/ contains=CSVDelimiter'
|
\. s:col . '/ contains=CSVDelimiter'
|
||||||
else
|
else
|
||||||
for i in range(len(b:csv_fixed_width_cols))
|
for i in range(len(b:csv_fixed_width_cols))
|
||||||
@@ -137,8 +136,13 @@ fu! <sid>DoSyntaxDefinitions() "{{{3
|
|||||||
|
|
||||||
hi def link CSVColumnHeaderOdd WarningMsg
|
hi def link CSVColumnHeaderOdd WarningMsg
|
||||||
hi def link CSVColumnHeaderEven WarningMsg
|
hi def link CSVColumnHeaderEven WarningMsg
|
||||||
hi def link CSVColumnOdd DiffAdd
|
if get(g:, 'csv_no_column_highlight', 0)
|
||||||
hi def link CSVColumnEven DiffChange
|
hi def link CSVColumnOdd Normal
|
||||||
|
hi def link CSVColumnEven Normal
|
||||||
|
else
|
||||||
|
hi def link CSVColumnOdd DiffAdd
|
||||||
|
hi def link CSVColumnEven DiffChange
|
||||||
|
endif
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" Main: {{{2
|
" Main: {{{2
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@el
|
|||||||
syn match elixirComment '#.*' contains=elixirTodo
|
syn match elixirComment '#.*' contains=elixirTodo
|
||||||
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
||||||
|
|
||||||
syn keyword elixirKeyword is_atom is_binary is_bitstring is_boolean is_float is_function is_integer is_list is_number is_pid is_port is_record is_reference is_tuple is_exception
|
syn keyword elixirKeyword is_atom is_binary is_bitstring is_boolean is_float is_function is_integer is_list is_map is_number is_pid is_port is_record is_reference is_tuple is_exception
|
||||||
syn keyword elixirKeyword case cond for if unless try receive send
|
syn keyword elixirKeyword case when cond for if unless try receive send
|
||||||
syn keyword elixirKeyword exit raise throw after rescue catch else do end
|
syn keyword elixirKeyword exit raise throw after rescue catch else do end
|
||||||
syn keyword elixirKeyword quote unquote super
|
syn keyword elixirKeyword quote unquote super
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ if !exists("g:go_highlight_structs")
|
|||||||
let g:go_highlight_structs = 0
|
let g:go_highlight_structs = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists("g:go_highlight_build_constraints")
|
||||||
|
let g:go_highlight_build_constraints = 0
|
||||||
|
endif
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
syn keyword goDirective package import
|
syn keyword goDirective package import
|
||||||
@@ -270,6 +274,21 @@ endif
|
|||||||
hi def link goStruct Function
|
hi def link goStruct Function
|
||||||
hi def link goStructDef Function
|
hi def link goStructDef Function
|
||||||
|
|
||||||
|
" Build Constraints
|
||||||
|
if g:go_highlight_build_constraints != 0
|
||||||
|
syn keyword goBuildOs contained ignore cgo android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows
|
||||||
|
syn keyword goBuildArch contained 386 amd64 amd64p32 arm
|
||||||
|
syn match goBuildDirective display contained "+build"
|
||||||
|
syn region goBuildComment start="//\s*+build" end="$" contains=goBuildDirective,goBuildOs,goBuildArch
|
||||||
|
syn region goBuildComment start="/\*\s*+build" end="\*/" contains=goBuildDirective,goBuildOs,goBuildArch
|
||||||
|
endif
|
||||||
|
|
||||||
|
hi def link goBuildComment Comment
|
||||||
|
hi def link goBuildOs Type
|
||||||
|
hi def link goBuildArch Type
|
||||||
|
hi def link goBuildDirective PreProc
|
||||||
|
|
||||||
|
|
||||||
" Search backwards for a global declaration to start processing the syntax.
|
" Search backwards for a global declaration to start processing the syntax.
|
||||||
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ syn match jadeBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=jadeTag,jadeClassCha
|
|||||||
syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent
|
syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent
|
||||||
syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript,jadeTagBlockChar,jadeTagInlineText
|
syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript,jadeTagBlockChar,jadeTagInlineText
|
||||||
syn match jadeComment '\s*\/\/.*$'
|
syn match jadeComment '\s*\/\/.*$'
|
||||||
|
syn region jadeCommentBlock start="\z(\s*\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
|
||||||
syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
||||||
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
|
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
|
||||||
syn match jadeClassChar "\." contained nextgroup=jadeClass
|
syn match jadeClassChar "\." contained nextgroup=jadeClass
|
||||||
@@ -45,7 +46,7 @@ syn region jadeDocType start="^\s*\(!!!\|doctype\)" end="$"
|
|||||||
syn keyword jadeHtmlArg contained href title
|
syn keyword jadeHtmlArg contained href title
|
||||||
|
|
||||||
syn match jadePlainChar "\\" contained
|
syn match jadePlainChar "\\" contained
|
||||||
syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="#{" end="}" contains=@htmlJavascript
|
syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="[#!]{" end="}" contains=@htmlJavascript
|
||||||
syn match jadeInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
syn match jadeInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
||||||
syn match jadeTagInlineText "\s.*$" contained contains=jadeInterpolation,jadeTextInlineJade
|
syn match jadeTagInlineText "\s.*$" contained contains=jadeInterpolation,jadeTextInlineJade
|
||||||
syn region jadePipedText matchgroup=jadePipeChar start="|" end="$" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadePipedText skipnl
|
syn region jadePipedText matchgroup=jadePipeChar start="|" end="$" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadePipedText skipnl
|
||||||
@@ -90,6 +91,7 @@ hi def link jadeInlineDelimiter Delimiter
|
|||||||
hi def link jadeFilter PreProc
|
hi def link jadeFilter PreProc
|
||||||
hi def link jadeDocType PreProc
|
hi def link jadeDocType PreProc
|
||||||
hi def link jadeComment Comment
|
hi def link jadeComment Comment
|
||||||
|
hi def link jadeCommentBlock Comment
|
||||||
hi def link jadeHtmlConditionalComment jadeComment
|
hi def link jadeHtmlConditionalComment jadeComment
|
||||||
|
|
||||||
let b:current_syntax = "jade"
|
let b:current_syntax = "jade"
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if !exists("javascript_ignore_javaScriptdoc")
|
|||||||
syntax region jsDocComment matchgroup=jsComment start="/\*\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
syntax region jsDocComment matchgroup=jsComment start="/\*\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
||||||
|
|
||||||
" tags containing a param
|
" tags containing a param
|
||||||
syntax match jsDocTags contained "@\(alias\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite
|
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite
|
||||||
" tags containing type and param
|
" tags containing type and param
|
||||||
syntax match jsDocTags contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite
|
syntax match jsDocTags contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite
|
||||||
" tags containing type but no param
|
" tags containing type but no param
|
||||||
@@ -70,7 +70,7 @@ if !exists("javascript_ignore_javaScriptdoc")
|
|||||||
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
||||||
syntax region jsDocTypeNoParam start="{" end="}" oneline contained
|
syntax region jsDocTypeNoParam start="{" end="}" oneline contained
|
||||||
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||||
syntax match jsDocParam contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\)\+"
|
syntax match jsDocParam contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\|\[\|]\|=\)\+"
|
||||||
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||||
|
|
||||||
syntax case match
|
syntax case match
|
||||||
@@ -94,11 +94,17 @@ syntax match jsRegexpMod "\v\(@<=\?[:=!>]" contained
|
|||||||
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
|
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
|
||||||
syntax region jsRegexpGroup start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend
|
syntax region jsRegexpGroup start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend
|
||||||
syntax region jsRegexpString start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend
|
syntax region jsRegexpString start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend
|
||||||
syntax match jsNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
|
syntax match jsNumber /\<-\=\d\+\(L\|[eE][+-]\=\d\+\)\=\>\|\<0[xX]\x\+\>/
|
||||||
syntax keyword jsNumber Infinity
|
syntax keyword jsNumber Infinity
|
||||||
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||||
syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\)\@=/ contains=jsFunctionKey contained
|
syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey contained
|
||||||
syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\s*function\s*\)\@=/ contained
|
syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/ contained
|
||||||
|
|
||||||
|
syntax match jsAssignmentExpr /\v%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=/ contains=jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise
|
||||||
|
syntax match jsAssignExpIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
|
||||||
|
syntax match jsFuncAssignExpr /\v%(%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=\s*){-1,}\ze%(function\s*\*?\s*\()/ contains=jsFuncAssignObjChain,jsFuncAssignIdent,jsFunction,jsPrototype,jsOperator,jsThis contained
|
||||||
|
syntax match jsFuncAssignObjChain /\v%([a-zA-Z_$]\k*\.)+/ contains=jsPrototype,jsNoise contained
|
||||||
|
syntax match jsFuncAssignIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
|
||||||
|
|
||||||
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
|
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
|
||||||
exe 'syntax keyword jsReturn return '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '')
|
exe 'syntax keyword jsReturn return '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '')
|
||||||
@@ -174,7 +180,7 @@ endif "DOM/HTML/CSS
|
|||||||
|
|
||||||
|
|
||||||
"" Code blocks
|
"" Code blocks
|
||||||
syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsCommonJS
|
syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsCommonJS,jsAssignmentExpr
|
||||||
syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException
|
syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException
|
||||||
syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold
|
syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold
|
||||||
syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
|
syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
|
||||||
@@ -194,8 +200,9 @@ if main_syntax == "javascript"
|
|||||||
syntax sync match jsHighlight grouphere jsBlock /{/
|
syntax sync match jsHighlight grouphere jsBlock /{/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
exe 'syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
|
exe 'syntax match jsFunction /\<function\>/ nextgroup=jsGenerator,jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
|
||||||
|
|
||||||
|
syntax match jsGenerator contained '\*' nextgroup=jsFuncName skipwhite
|
||||||
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite
|
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite
|
||||||
syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest nextgroup=jsFuncBlock keepend skipwhite skipempty
|
syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest nextgroup=jsFuncBlock keepend skipwhite skipempty
|
||||||
syntax match jsFuncArgCommas contained ','
|
syntax match jsFuncArgCommas contained ','
|
||||||
@@ -250,6 +257,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsKeyword Keyword
|
HiLink jsKeyword Keyword
|
||||||
HiLink jsArrowFunction Type
|
HiLink jsArrowFunction Type
|
||||||
HiLink jsFunction Type
|
HiLink jsFunction Type
|
||||||
|
HiLink jsGenerator jsFunction
|
||||||
HiLink jsFuncName Function
|
HiLink jsFuncName Function
|
||||||
HiLink jsArgsObj Special
|
HiLink jsArgsObj Special
|
||||||
HiLink jsError Error
|
HiLink jsError Error
|
||||||
|
|||||||
@@ -329,19 +329,24 @@ syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s
|
|||||||
" XXX Any statements after the identifier are in perlString colour (i.e.
|
" XXX Any statements after the identifier are in perlString colour (i.e.
|
||||||
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
|
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
|
||||||
" seems due to the 'auto-extending nature' of regions.
|
" seems due to the 'auto-extending nature' of regions.
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*""+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*''+ end=+$+ contains=@perlTop oneline
|
||||||
if exists("perl_fold")
|
if exists("perl_fold")
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold extend
|
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold extend
|
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold extend
|
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend
|
||||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
|
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
|
||||||
else
|
else
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ
|
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ
|
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ
|
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
|
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
|
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine
|
||||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
|
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -533,10 +533,10 @@ syn match phpOperator "&&\|\<and\>" contained display
|
|||||||
syn match phpOperator "||\|\<x\=or\>" contained display
|
syn match phpOperator "||\|\<x\=or\>" contained display
|
||||||
syn match phpOperator "[!=<>]=" contained display
|
syn match phpOperator "[!=<>]=" contained display
|
||||||
syn match phpOperator "[<>]" contained display
|
syn match phpOperator "[<>]" contained display
|
||||||
syn match phpMemberSelector "->" contained display
|
syn match phpMemberSelector "->\|::" contained display
|
||||||
syn match phpVarSelector "\$" contained display
|
syn match phpVarSelector "\$" contained display
|
||||||
" highlight object variables inside strings
|
" highlight static and object variables inside strings
|
||||||
syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display containedin=phpStringDouble
|
syn match phpMethodsVar "\%(->\|::$\?\)\h\w*" contained contains=phpMethods,phpMemberSelector,phpIdentifier display containedin=phpStringDouble
|
||||||
syn match phpSplatOperator "\.\.\." contained display
|
syn match phpSplatOperator "\.\.\." contained display
|
||||||
|
|
||||||
" Identifier
|
" Identifier
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
||||||
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
||||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||||
" Last Change: July 18, 2014
|
" Last Change: January 5, 2015
|
||||||
|
|
||||||
if version < 600
|
if version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
@@ -56,10 +56,10 @@ syn match rustMacroRepeatCount ".\?[*+]" contained
|
|||||||
syn match rustMacroVariable "$\w\+"
|
syn match rustMacroVariable "$\w\+"
|
||||||
|
|
||||||
" Reserved (but not yet used) keywords {{{2
|
" Reserved (but not yet used) keywords {{{2
|
||||||
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override
|
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override macro
|
||||||
|
|
||||||
" Built-in types {{{2
|
" Built-in types {{{2
|
||||||
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
|
syn keyword rustType isize usize float char bool u8 u16 u32 u64 f32
|
||||||
syn keyword rustType f64 i8 i16 i32 i64 str Self
|
syn keyword rustType f64 i8 i16 i32 i64 str Self
|
||||||
|
|
||||||
" Things from the prelude (src/libstd/prelude.rs) {{{2
|
" Things from the prelude (src/libstd/prelude.rs) {{{2
|
||||||
@@ -68,59 +68,35 @@ syn keyword rustType f64 i8 i16 i32 i64 str Self
|
|||||||
|
|
||||||
" Reexported core operators {{{3
|
" Reexported core operators {{{3
|
||||||
syn keyword rustTrait Copy Send Sized Sync
|
syn keyword rustTrait Copy Send Sized Sync
|
||||||
syn keyword rustTrait Add Sub Mul Div Rem Neg Not
|
syn keyword rustTrait Drop Fn FnMut FnOnce
|
||||||
syn keyword rustTrait BitAnd BitOr BitXor
|
|
||||||
syn keyword rustTrait Drop Deref DerefMut
|
|
||||||
syn keyword rustTrait Shl Shr
|
|
||||||
syn keyword rustTrait Index IndexMut
|
|
||||||
syn keyword rustTrait Slice SliceMut
|
|
||||||
syn keyword rustTrait Fn FnMut FnOnce
|
|
||||||
|
|
||||||
" Reexported functions {{{3
|
" Reexported functions {{{3
|
||||||
"syn keyword rustFunction range repeat
|
syn keyword rustFunction drop
|
||||||
"syn keyword rustFunction drop
|
|
||||||
"syn keyword rustFunction from_str
|
|
||||||
|
|
||||||
" Reexported types and traits {{{3
|
" Reexported types and traits {{{3
|
||||||
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
|
syn keyword rustTrait Box
|
||||||
syn keyword rustTrait IntoBytes
|
syn keyword rustTrait CharExt
|
||||||
syn keyword rustTrait ToCStr
|
|
||||||
syn keyword rustTrait Char UnicodeChar
|
|
||||||
syn keyword rustTrait Clone
|
syn keyword rustTrait Clone
|
||||||
syn keyword rustTrait PartialEq PartialOrd Eq Ord
|
syn keyword rustTrait PartialEq PartialOrd Eq Ord
|
||||||
syn keyword rustEnum Ordering Equiv
|
syn keyword rustTrait DoubleEndedIterator
|
||||||
syn keyword rustEnumVariant Less Equal Greater
|
syn keyword rustTrait ExactSizeIterator
|
||||||
syn keyword rustTrait FromIterator Extend ExactSizeIterator
|
syn keyword rustTrait Iterator IteratorExt Extend
|
||||||
syn keyword rustTrait Iterator DoubleEndedIterator
|
|
||||||
syn keyword rustTrait RandomAccessIterator CloneableIterator
|
|
||||||
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator
|
|
||||||
syn keyword rustTrait ToPrimitive FromPrimitive
|
|
||||||
syn keyword rustTrait Box
|
|
||||||
syn keyword rustEnum Option
|
syn keyword rustEnum Option
|
||||||
syn keyword rustEnumVariant Some None
|
syn keyword rustEnumVariant Some None
|
||||||
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
|
syn keyword rustTrait PtrExt MutPtrExt
|
||||||
syn keyword rustTrait RawPtr RawMutPtr
|
|
||||||
syn keyword rustEnum Result
|
syn keyword rustEnum Result
|
||||||
syn keyword rustEnumVariant Ok Err
|
syn keyword rustEnumVariant Ok Err
|
||||||
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
|
syn keyword rustTrait AsSlice
|
||||||
syn keyword rustTrait Str StrVector StrPrelude
|
syn keyword rustTrait SliceExt SliceConcatExt
|
||||||
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrPrelude
|
syn keyword rustTrait Str StrExt
|
||||||
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
|
syn keyword rustTrait String ToString
|
||||||
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
|
|
||||||
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
|
|
||||||
syn keyword rustTrait SlicePrelude AsSlice CloneSlicePrelude
|
|
||||||
syn keyword rustTrait VectorVector PartialEqSlicePrelude OrdSlicePrelude
|
|
||||||
syn keyword rustTrait CloneSliceAllocPrelude OrdSliceAllocPrelude SliceAllocPrelude
|
|
||||||
syn keyword rustTrait IntoString String ToString
|
|
||||||
syn keyword rustTrait Vec
|
syn keyword rustTrait Vec
|
||||||
|
" FIXME: remove when path reform lands
|
||||||
" Reexported runtime types {{{3
|
syn keyword rustTrait Path GenericPath
|
||||||
"syn keyword rustFunction sync_channel channel
|
" FIXME: remove when I/O reform lands
|
||||||
syn keyword rustTrait SyncSender Sender Receiver
|
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
|
||||||
"syn keyword rustFunction spawn
|
|
||||||
|
|
||||||
" Other syntax {{{2
|
" Other syntax {{{2
|
||||||
|
|
||||||
syn keyword rustSelf self
|
syn keyword rustSelf self
|
||||||
syn keyword rustBoolean true false
|
syn keyword rustBoolean true false
|
||||||
|
|
||||||
@@ -157,14 +133,14 @@ syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustE
|
|||||||
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
||||||
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
||||||
|
|
||||||
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDeriving
|
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive
|
||||||
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
|
syn region rustDerive start="derive(" end=")" contained contains=rustTrait
|
||||||
|
|
||||||
" Number literals
|
" Number literals
|
||||||
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
|
|
||||||
" Special case for numbers of the form "1." which are float literals, unless followed by
|
" Special case for numbers of the form "1." which are float literals, unless followed by
|
||||||
" an identifier, which makes them integer literals with a method call or field access,
|
" an identifier, which makes them integer literals with a method call or field access,
|
||||||
@@ -263,7 +239,7 @@ hi def link rustMacro Macro
|
|||||||
hi def link rustType Type
|
hi def link rustType Type
|
||||||
hi def link rustTodo Todo
|
hi def link rustTodo Todo
|
||||||
hi def link rustAttribute PreProc
|
hi def link rustAttribute PreProc
|
||||||
hi def link rustDeriving PreProc
|
hi def link rustDerive PreProc
|
||||||
hi def link rustStorage StorageClass
|
hi def link rustStorage StorageClass
|
||||||
hi def link rustObsoleteStorage Error
|
hi def link rustObsoleteStorage Error
|
||||||
hi def link rustLifetime Special
|
hi def link rustLifetime Special
|
||||||
@@ -275,7 +251,7 @@ hi def link rustBoxPlacementExpr rustKeyword
|
|||||||
|
|
||||||
" Other Suggestions:
|
" Other Suggestions:
|
||||||
" hi rustAttribute ctermfg=cyan
|
" hi rustAttribute ctermfg=cyan
|
||||||
" hi rustDeriving ctermfg=cyan
|
" hi rustDerive ctermfg=cyan
|
||||||
" hi rustAssert ctermfg=yellow
|
" hi rustAssert ctermfg=yellow
|
||||||
" hi rustPanic ctermfg=red
|
" hi rustPanic ctermfg=red
|
||||||
" hi rustMacro ctermfg=magenta
|
" hi rustMacro ctermfg=magenta
|
||||||
|
|||||||
18
syntax/tomdoc.vim
Normal file
18
syntax/tomdoc.vim
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
syn keyword tomdocKeywords
|
||||||
|
\ Returns Yields Raises Examples Signature
|
||||||
|
\ containedin=.*Comment
|
||||||
|
\ contained
|
||||||
|
|
||||||
|
syn match tomdocDescriptions
|
||||||
|
\ +\s*\(Public\|Internal\|Deprecated\):+he=e-1
|
||||||
|
\ containedin=.*Comment
|
||||||
|
\ contained
|
||||||
|
|
||||||
|
syn match tomdocArguments
|
||||||
|
\ +\s*[A-Za-z0-9_\-&\*:]*\(\s*- \)+he=e-3
|
||||||
|
\ containedin=.*Comment
|
||||||
|
\ contained
|
||||||
|
|
||||||
|
hi default link tomdocDescriptions String
|
||||||
|
hi default link tomdocKeywords String
|
||||||
|
hi default link tomdocArguments HELP
|
||||||
Reference in New Issue
Block a user