1

Update generated neovim config

This commit is contained in:
2024-08-15 14:28:54 +02:00
parent 07409c223d
commit 25cfcf2941
3809 changed files with 351157 additions and 0 deletions

View File

@ -0,0 +1,20 @@
" VimTeX - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve Lervåg
" Email: karl.yngve@gmail.com
"
function! vimtex#syntax#p#apacite#load(cfg) abort " {{{1
syntax match texCmdRef nextgroup=texRefOpt,texRefArg skipwhite skipnl "\v\\citeA[pt]?>\*?"
syntax match texCmdRef nextgroup=texRefOpt,texRefArg skipwhite skipnl "\v\\Cite[pt]?>\*?"
syntax match texCmdRef nextgroup=texRefOpt,texRefArg skipwhite skipnl "\v\\[cC]iteal[tp]>\*?"
syntax match texCmdRef nextgroup=texRefOpt,texRefArg skipwhite skipnl "\v\\cite%(num|text|url)>"
syntax match texCmdRef nextgroup=texRefOpt,texRefArg skipwhite skipnl "\v\\[Cc]ite%(title|author|year%(par)?|date)?%(NP)?>\*?"
call vimtex#syntax#core#new_arg('texRefOpt', {
\ 'matcher': 'start="<" end=">"',
\ 'next': 'texRefOpt,texRefArg',
\})
endfunction
" }}}1

View File

@ -0,0 +1,67 @@
" VimTeX - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve Lervåg
" Email: karl.yngve@gmail.com
"
function! vimtex#syntax#p#robust_externalize#load(cfg) abort " {{{1
" Match environment boundaries
syntax match texRobExtEnvBgn contained '\\begin{\%(RobExt\)\?CacheMeCode\|CacheMe}'
\ nextgroup=texRobExtEnvOpt,texRobExtEnvArg skipwhite skipnl
\ contains=texCmdEnv
call vimtex#syntax#core#new_opt('texRobExtEnvOpt', {'next': 'texRobExtEnvArg'})
call vimtex#syntax#core#new_arg('texRobExtEnvArg', {'contains': 'texRobExtEnvArg'})
" Match generic environments
call vimtex#syntax#core#new_env({
\ 'name': '\%(RobExt\)\?CacheMeCode\|CacheMe',
\ 'region': 'texRobExtZone',
\ 'contains': 'texCmdEnv,texRobExtEnvBgn',
\})
call vimtex#syntax#core#new_env({
\ 'name': 'PlaceholderPathFromCode',
\ 'region': 'texRobExtZone',
\ 'contains': 'texCmdEnv,texRobExtEnvBgn',
\})
call vimtex#syntax#core#new_env({
\ 'name': 'SetPlaceholderCode\*\?',
\ 'region': 'texRobExtZone',
\ 'contains': 'texCmdEnv,texRobExtEnvBgn',
\})
" 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)
execute 'highlight def link' l:grp_env 'texRobExtZone'
else
let l:contains .= ',' . l:cluster
endif
" Match normal robext environments
execute 'syntax region' l:grp_env
\ 'start="\\begin{\z(\%(RobExt\)\?CacheMeCode\|CacheMe\)}\_s*{' . l:preset . '[ ,}]"'
\ 'end="\\end{\z1}"'
\ l:options
\ l:contains
endfor
" Specify default highlight groups
highlight def link texRobExtEnvArg texSymbol
highlight def link texRobExtEnvArgOpt texOpt
highlight def link texRobExtEnvOpt texOpt
highlight def link texRobExtZone texZone
endfunction
" }}}1

View File

@ -0,0 +1,12 @@
if exists('b:_loaded_markdown_vimtex')
finish
endif
let b:_loaded_markdown_vimtex = 1
unlet b:current_syntax
syntax include @tex syntax/tex.vim
let b:current_syntax = 'markdown'
syntax region mkdMath start="\\\@<!\$" end="\$" skip="\\\$" contains=@tex keepend
syntax region mkdMath start="\\\@<!\$\$" end="\$\$" skip="\\\$" contains=@tex keepend
syntax region mkdMath start="\\\@<!\\(" end="\\\@<!\\)" contains=@tex keepend

View File

@ -0,0 +1,16 @@
if exists('b:_loaded_markdown_vimtex')
finish
endif
let b:_loaded_markdown_vimtex = 1
if !exists('b:current_syntax')
runtime! syntax/markdown.vim
endif
unlet! b:current_syntax
syntax include @tex syntax/tex.vim
let b:current_syntax = 'markdown'
syntax region mkdMath start="\\\@<!\$" end="\$" skip="\\\$" contains=@tex keepend
syntax region mkdMath start="\\\@<!\$\$" end="\$\$" skip="\\\$" contains=@tex keepend
syntax region mkdMath start="\\\@<!\\(" end="\\\@<!\\)" contains=@tex keepend

View File

@ -0,0 +1,31 @@
vim.opt.runtimepath:prepend "~/.local/plugged/vimtex"
vim.opt.runtimepath:append "~/.local/plugged/vimtex/after"
-- vim.opt.runtimepath:prepend "."
vim.opt.runtimepath:append "./after"
vim.cmd [[filetype plugin indent on]]
vim.cmd [[syntax enable]]
vim.keymap.set("n", "q", "<cmd>qall!<cr>")
vim.g.vimtex_cache_root = "."
vim.g.vimtex_cache_persistent = false
vim.cmd.colorscheme "morning"
vim.api.nvim_set_hl(0, "Conceal", { bg = "NONE", fg = "blue" })
vim.api.nvim_set_hl(0, "texCmdRef", { fg = "cyan" })
local au_group = vim.api.nvim_create_augroup("init", {})
vim.api.nvim_create_autocmd("CursorMoved", {
pattern = "*",
group = au_group,
command = [[echo join(vimtex#syntax#stack(), ' -> ')]],
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
group = au_group,
command = [[call vimtex#init()]],
})
vim.cmd.edit "test.md"

View File

@ -0,0 +1,7 @@
# Title
math here $f(x) = 1$
math here \(f(x) = 1\)
**bold text** _italic text_

View File

@ -0,0 +1,7 @@
\documentclass{article}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
Test
\end{document}

View File

@ -0,0 +1,18 @@
set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin on
nnoremap q :qall!<cr>
let g:vimtex_cache_root = '.'
let g:vimtex_cache_persistent = 0
silent edit test_apacite.tex
if empty($INMAKE) | finish | endif
let s:candidates = vimtex#test#completion('\cite<e.g.>{', '')
call assert_true(len(s:candidates) > 0)
call vimtex#test#finished()

View File

@ -0,0 +1,16 @@
\documentclass{article}
\usepackage{apacite}
\begin{document}
\cite<e.g.,>[p.~11]{Jone01,Ross87}
\citeA<e.g.,>[p.~11]{Jone01,Ross87}
\citeauthor<e.g.,>[p.~11]{Jone01,Ross87}
\citeyear<e.g.,>[p.~11]{Jone01,Ross87}
\citeyearNP<e.g.,>[p.~11]{Jone01,Ross87}
\citeNP<e.g.,>[p.~11]{Jone01,Ross87}
\bibliographystyle{plainnat}
\bibliography{../common/local1.bib}
\end{document}

View File

@ -0,0 +1,7 @@
source common.vim
Edit test-apacite.tex
if empty($INMAKE) | finish | endif
call vimtex#test#finished()

View File

@ -0,0 +1,46 @@
\documentclass{article}
\usepackage{robust-externalize}
\begin{document}
\begin{CacheMeCode}{c}
int main() {
return 1;
}
\end{CacheMeCode}
\begin{CacheMeCode}{bash, tikz terminal}
echo 'test.dat'
exit 0
\end{CacheMeCode}
\begin{figure}
\begin{CacheMeCode}{python matplotlib, add to preamble={\def\hello#1{Hello #1!}}}
def f(p: string):
return [x + p for x in ('a', 'b')]
\end{CacheMeCode}
\end{figure}
\begin{RobExtCacheMeCode}{my python matplotlib,
add to preamble={\def\hello#1{Hello #1!}}
}
def f(p: string):
return [x + p for x in ('a', 'b')]
\end{RobExtCacheMeCode}
\begin{CacheMe}{tikzpicture}[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{SetPlaceholderCode*}{__PYTHON_TEMP}
def f(p: string):
return [x + p for x in ('a', 'b')]
\end{SetPlaceholderCode*}
\begin{PlaceholderPathFromCode}[.py]{__PYTHON_TEMP}
def f(p: string):
return [x + p for x in ('a', 'b')]
\end{PlaceholderPathFromCode}
\end{document}

View File

@ -0,0 +1,7 @@
source common.vim
Edit test-robust-externalize.tex
if empty($INMAKE) | finish | endif
call vimtex#test#finished()