Update generated neovim config
This commit is contained in:
@ -138,7 +138,7 @@ function! s:format_build_lines(start, end) abort " {{{1
|
||||
if strdisplaywidth(l:word) + strdisplaywidth(l:current) > s:textwidth
|
||||
call append(l:lnum, substitute(l:current, '\s$', '', ''))
|
||||
let l:lnum += 1
|
||||
let l:current = s:get_indents(VimtexIndent(a:start))
|
||||
let l:current = s:get_indents(indent(a:start))
|
||||
endif
|
||||
let l:current .= l:word . ' '
|
||||
endfor
|
||||
|
||||
@ -8,7 +8,7 @@ function! vimtex#jobs#neovim#new(cmd) abort " {{{1
|
||||
let l:job = deepcopy(s:job)
|
||||
let l:job.cmd = has('win32')
|
||||
\ ? 'cmd /s /c "' . a:cmd . '"'
|
||||
\ : ['/bin/sh', '-c', a:cmd]
|
||||
\ : ['sh', '-c', a:cmd]
|
||||
return l:job
|
||||
endfunction
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ function! vimtex#jobs#vim#new(cmd) abort " {{{1
|
||||
let l:job = deepcopy(s:job)
|
||||
let l:job.cmd = has('win32')
|
||||
\ ? 'cmd /s /c "' . a:cmd . '"'
|
||||
\ : ['/bin/sh', '-c', a:cmd]
|
||||
\ : ['sh', '-c', a:cmd]
|
||||
return l:job
|
||||
endfunction
|
||||
|
||||
|
||||
@ -392,6 +392,15 @@ function! vimtex#options#init() abort " {{{1
|
||||
\ 'babel': {'conceal': 1},
|
||||
\ 'hyperref': {'conceal': 1},
|
||||
\ 'fontawesome5': {'conceal': 1},
|
||||
\ 'robust_externalize': {
|
||||
\ 'presets': [
|
||||
\ ['bash', 'bash'],
|
||||
\ ['python', 'python'],
|
||||
\ ['gnuplot', 'gnuplot'],
|
||||
\ ['tikz', '@texClusterTikz'],
|
||||
\ ['latex', 'TOP'],
|
||||
\ ],
|
||||
\ },
|
||||
\})
|
||||
|
||||
" Disable conceals if chosen
|
||||
|
||||
@ -59,6 +59,7 @@ function! s:qf.set_errorformat() abort dict "{{{1
|
||||
setlocal errorformat+=%+WOverfull\ %\\%\\hbox%.%#\ at\ lines\ %l--%*\\d
|
||||
setlocal errorformat+=%+WOverfull\ %\\%\\hbox%.%#\ at\ line\ %l
|
||||
setlocal errorformat+=%+WOverfull\ %\\%\\vbox%.%#\ at\ line\ %l
|
||||
setlocal errorformat+=%+WOverfull\ %\\%\\vbox%.%#\ %m
|
||||
|
||||
setlocal errorformat+=%+WUnderfull\ %\\%\\hbox%.%#\ at\ lines\ %l--%*\\d
|
||||
setlocal errorformat+=%+WUnderfull\ %\\%\\vbox%.%#\ at\ line\ %l
|
||||
|
||||
@ -2303,7 +2303,7 @@ function! s:match_conceal_cites_brackets() abort " {{{1
|
||||
\ 'contains': '@texClusterOpt,texSpecialChar',
|
||||
\ 'next': 'texRefConcealedArg',
|
||||
\})
|
||||
syntax match texRefConcealedOpt2 "\[\s*\]" conceal
|
||||
syntax match texRefConcealedOpt2 "\[\s*\]" contained conceal
|
||||
\ skipwhite nextgroup=texRefConcealedPArg
|
||||
call vimtex#syntax#core#new_arg('texRefConcealedArg', {
|
||||
\ 'contains': 'texComment,@NoSpell,texRefConcealedDelim',
|
||||
@ -2325,7 +2325,7 @@ function! s:match_conceal_cites_brackets() abort " {{{1
|
||||
\ 'contains': '@texClusterOpt,texSpecialChar',
|
||||
\ 'next': 'texRefConcealedPArg',
|
||||
\})
|
||||
syntax match texRefConcealedPOpt2 "\[\s*\]" conceal
|
||||
syntax match texRefConcealedPOpt2 "\[\s*\]" contained conceal
|
||||
\ skipwhite nextgroup=texRefConcealedPArg
|
||||
call vimtex#syntax#core#new_arg('texRefConcealedPArg', {
|
||||
\ 'contains': 'texComment,@NoSpell,texRefConcealedPDelim',
|
||||
|
||||
@ -16,30 +16,31 @@ function! vimtex#syntax#p#fontawesome5#load(cfg) abort " {{{1
|
||||
\ 'opts': 'conceal contained containedin=texCmdFontawesome',
|
||||
\})
|
||||
|
||||
for [l:name, l:symbol] in items(s:fontawesome)
|
||||
" -alt variants correspond to starred commands
|
||||
if l:name[-4:] ==# '-alt'
|
||||
let l:name = l:name[:-5]
|
||||
let l:nameCased = substitute(l:name, '\v%(^|-)(.)', '\u\1', 'g')
|
||||
let l:re =
|
||||
\ '\v\\fa' . l:nameCased . '\*|'
|
||||
\ . '\\faIcon\*\s*%(\[%(regular|solid)])?\s*\{' . l:name . '\}'
|
||||
elseif l:name =~# '^\D'
|
||||
let l:nameCased = substitute(l:name, '\v%(^|-)(.)', '\u\1', 'g')
|
||||
let l:re =
|
||||
\ '\v\\fa' . l:nameCased . '>\ze%([^*]|$)|'
|
||||
\ . '\\faIcon\s*%(\[%(regular|solid)])?\s*\{' . l:name . '\}'
|
||||
else
|
||||
" In this branch l:name ==# "500px"
|
||||
" This case does not have the \faName variant!
|
||||
let l:re = '\v\\faIcon\s*%(\[%(regular|solid)])?\s*\{' . l:name . '\}'
|
||||
endif
|
||||
for [l:name, l:symbol] in items(s:fontawesome.regular)
|
||||
let l:nameCased = substitute(l:name, '\v%(^|-)(.)', '\u\1', 'g')
|
||||
let l:re =
|
||||
\ '\v\\fa' . l:nameCased . '>%(\[\w*\])?|'
|
||||
\ . '\\faIcon%(\[\w*\])?\{' . l:name . '\}'
|
||||
|
||||
execute printf(
|
||||
\ 'syntax match texCmdFontawesome "%s" conceal cchar=%s',
|
||||
\ l:re, l:symbol)
|
||||
endfor
|
||||
|
||||
for [l:name, l:symbol] in items(s:fontawesome.starred)
|
||||
let l:nameCased = substitute(l:name, '\v%(^|-)(.)', '\u\1', 'g')
|
||||
let l:re =
|
||||
\ '\v\\fa' . l:nameCased . '\*%(\[\w*\])?|'
|
||||
\ . '\\faIcon\*%(\[\w*\])?\{' . l:name . '\}'
|
||||
|
||||
execute printf(
|
||||
\ 'syntax match texCmdFontawesome "%s" conceal cchar=%s',
|
||||
\ l:re, l:symbol)
|
||||
endfor
|
||||
|
||||
" This case does not have the \faNameCased variant
|
||||
syntax match texCmdFontawesome "\v\\faIcon%(\[\w*\])?\s*\{500px\}" conceal cchar=
|
||||
|
||||
highlight def link texCmdFontawesome texCmd
|
||||
highlight def link texFontawesomeArg texArg
|
||||
highlight def link texFontawesomeOpt texOpt
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
"
|
||||
|
||||
function! vimtex#syntax#p#robust_externalize#load(cfg) abort " {{{1
|
||||
call vimtex#syntax#packages#load("tikz")
|
||||
|
||||
" Match environment boundaries
|
||||
syntax match texRobExtEnvBgn contained '\\begin{\%(RobExt\)\?CacheMeCode\|CacheMe}'
|
||||
\ nextgroup=texRobExtEnvOpt,texRobExtEnvArg skipwhite skipnl
|
||||
@ -30,30 +32,31 @@ function! vimtex#syntax#p#robust_externalize#load(cfg) abort " {{{1
|
||||
\})
|
||||
|
||||
" Add nested syntax support for supported languages
|
||||
for [l:preset, l:target] in [
|
||||
\ ['c', 'c'],
|
||||
\ ['bash', 'bash'],
|
||||
\ ['python', 'python'],
|
||||
\ ['my python', 'python'],
|
||||
\]
|
||||
let l:cluster = vimtex#syntax#nested#include(l:target)
|
||||
|
||||
let l:name = toupper(l:target[0]) . l:target[1:]
|
||||
let l:grp_env = 'texRobExtZone' . l:name
|
||||
let l:options = 'keepend'
|
||||
let l:contains = 'contains=texCmdEnv,texRobExtEnvBgn'
|
||||
|
||||
if empty(l:cluster)
|
||||
for [l:preset, l:target] in get(a:cfg, "presets", [])
|
||||
if empty(l:target)
|
||||
let l:name = 'Verb'
|
||||
let l:contains = 'contains=texCmdEnv,texRobExtEnvBgn'
|
||||
execute 'highlight def link' l:grp_env 'texRobExtZone'
|
||||
elseif l:target ==# "TOP"
|
||||
let l:name = 'LaTeX'
|
||||
let l:contains = 'contains=TOP,texRobExtZone'
|
||||
else
|
||||
let l:name = toupper(l:target[0]) . l:target[1:]
|
||||
let l:cluster = l:target[0] == "@"
|
||||
\ ? l:target
|
||||
\ : vimtex#syntax#nested#include(l:target)
|
||||
|
||||
let l:contains = 'contains=texCmdEnv,texRobExtEnvBgn'
|
||||
let l:contains .= ',' . l:cluster
|
||||
endif
|
||||
|
||||
let l:grp_env = 'texRobExtZone' . l:name
|
||||
|
||||
" Match normal robext environments
|
||||
execute 'syntax region' l:grp_env
|
||||
\ 'start="\\begin{\z(\%(RobExt\)\?CacheMeCode\|CacheMe\)}\_s*{' . l:preset . '[ ,}]"'
|
||||
\ 'end="\\end{\z1}"'
|
||||
\ l:options
|
||||
\ 'keepend'
|
||||
\ l:contains
|
||||
endfor
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ function! vimtex#view#inverse_search(line, filename) abort " {{{1
|
||||
" * If tab/window exists, switch to it/them
|
||||
let l:bufnr = bufnr(l:file)
|
||||
try
|
||||
let [l:winid] = win_findbuf(l:bufnr)
|
||||
let [l:winid; _] = win_findbuf(l:bufnr)
|
||||
let [l:tabnr, l:winnr] = win_id2tabwin(l:winid)
|
||||
execute l:tabnr . 'tabnext'
|
||||
execute l:winnr . 'wincmd w'
|
||||
|
||||
Reference in New Issue
Block a user