Update generated neovim config
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -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'
|
||||
|
||||
@ -2926,6 +2926,10 @@ OPTIONS *vimtex-options*
|
||||
hyperref ~
|
||||
`conceal` whether to enable conceal; enabled by default
|
||||
|
||||
robust_externalize ~
|
||||
`presets` list of presets and target syntaxes for things like
|
||||
`\begin{CacheMeCode}{bash} ... \end{CacheMeCode}.
|
||||
|
||||
Default: >vim
|
||||
|
||||
let g:vimtex_syntax_packages = {
|
||||
@ -2933,6 +2937,15 @@ OPTIONS *vimtex-options*
|
||||
\ 'babel': {'conceal': 1},
|
||||
\ 'hyperref': {'conceal': 1},
|
||||
\ 'fontawesome5': {'conceal': 1},
|
||||
\ 'robust_externalize': {
|
||||
\ 'presets': [
|
||||
\ ['bash', 'bash'],
|
||||
\ ['python', 'python'],
|
||||
\ ['gnuplot', 'gnuplot'],
|
||||
\ ['tikz', '@texClusterTikz'],
|
||||
\ ['latex', 'TOP'],
|
||||
\ ],
|
||||
\ },
|
||||
\}
|
||||
|
||||
*g:vimtex_texcount_custom_arg*
|
||||
@ -6119,6 +6132,9 @@ Note: Many plugin managers provide mechanisms to lazy load plugins. There is
|
||||
no need to use such a mechanism for VimTeX, and in fact, doing it will
|
||||
prevent Vim/neovim from loading the `:VimtexInverseSearch` command.
|
||||
|
||||
Note: You may need to add the installation prefix for Vim/Neovim, for example
|
||||
`/opt/homebrew/bin`, in your PDF viewer if inverse search does not work.
|
||||
|
||||
==============================================================================
|
||||
LATEX DOCUMENTATION *vimtex-latexdoc*
|
||||
|
||||
|
||||
@ -25,6 +25,8 @@ Package typearea Warning: \typearea used at group level 2.
|
||||
Package caption Warning: Unsupported document class (or package) detected,
|
||||
(caption) usage of the caption package is not recommended.
|
||||
|
||||
Overfull \vbox (303.66812pt too high) has occurred while \output is active []
|
||||
|
||||
Runaway argument?
|
||||
{\sqrt {{1}} \end {equation} \par \end {document}
|
||||
! File ended while scanning use of \frac .
|
||||
|
||||
@ -27,6 +27,7 @@ for s:expect in [
|
||||
\ {'lnum': 18, 'type': 'W', 'text': "Package onlyamsmath Warning: Environment eqnarray or eqnarray* used, please use\nonly the environments provided by the amsmath\npackage"},
|
||||
\ {'lnum': 21, 'type': 'W', 'text': "Package typearea Warning: \\typearea used at group level 2.\n Using \\typearea inside any group, e.g.\n environments, math mode, boxes, etc. may result in\n many type setting problems.\n You should move the command \\typearea\n outside all groups"},
|
||||
\ {'lnum': 0, 'type': 'W', 'text': "Package caption Warning: Unsupported document class (or package) detected,\nusage of the caption package is not recommended."},
|
||||
\ {'lnum': 0, 'type': 'W', 'text': "Overfull \\vbox (303.66812pt too high) has occurred while \\output is active []"},
|
||||
\ {'lnum': 0, 'type': 'E', 'text': "Runaway argument?\n{\\sqrt {{1}} \\end {equation} \\par \\end {document} \nFile ended while scanning use of \\frac ."},
|
||||
\ {'lnum': 0, 'type': 'E', 'text': 'Runaway argument?'},
|
||||
\ {'lnum': 16, 'type': 'E', 'text': 'Paragraph ended before \date was complete.'},
|
||||
|
||||
@ -19,6 +19,6 @@
|
||||
\faFil
|
||||
\faFilea
|
||||
\faIcon{fil}
|
||||
\faIcon[regula]{file}
|
||||
\faIcon[regula]{fil}
|
||||
|
||||
\end{document}
|
||||
|
||||
@ -27,6 +27,12 @@
|
||||
return [x + p for x in ('a', 'b')]
|
||||
\end{RobExtCacheMeCode}
|
||||
|
||||
\begin{CacheMe}{tikz}[scale=0.6]
|
||||
\draw[gray, thick] (-1,2) -- (2,-4);
|
||||
\draw[gray, thick] (-1,-1) -- (2,2);
|
||||
\filldraw[black] (0,0) circle (2pt) node[anchor=west]{Intersection point};
|
||||
\end{CacheMe}
|
||||
|
||||
\begin{CacheMe}{tikzpicture}[scale=0.6]
|
||||
\draw[gray, thick] (-1,2) -- (2,-4);
|
||||
\draw[gray, thick] (-1,-1) -- (2,2);
|
||||
@ -43,4 +49,8 @@ def f(p: string):
|
||||
return [x + p for x in ('a', 'b')]
|
||||
\end{PlaceholderPathFromCode}
|
||||
|
||||
\begin{CacheMe}{latex}
|
||||
This is regular \LaTeX commands.
|
||||
\end{CacheMe}
|
||||
|
||||
\end{document}
|
||||
|
||||
Reference in New Issue
Block a user