1

Update generated nvim config

This commit is contained in:
2024-06-05 22:05:42 +02:00
parent 859ee3a2ba
commit 075fe5f587
1292 changed files with 152601 additions and 0 deletions

View File

@ -0,0 +1,14 @@
MYVIM ?= nvim --clean --headless
INMAKE := 1
export INMAKE
TESTS := $(wildcard test*.vim)
TESTS := $(TESTS:.vim=)
.PHONY: test $(TESTS)
test: $(TESTS)
$(TESTS):
@$(MYVIM) -u $@.vim

View File

@ -0,0 +1,42 @@
\documentclass{minimal}
\begin{document}
\begin{defn}[Definition 1]
\label{defn:definition_1}
A simple environment with simple contents.
\end{defn}
\begin{figure}[ht] % A standalone figure with label and caption
\centering
%\input{proof}
\caption{Simple figure}
\label{fig:simple_figure}
\end{figure}
\begin{thm}[Example Title of Theorem]
\label{thm:example_title_of_theorem}
Suppose A and B.
\begin{itemize}
\item If C, then D
\item \(A \wedge B \implies D \iff A \wedge B \implies C\)
\end{itemize}
We demonstrate this by the figure.
\begin{figure}[ht] % Comment
\centering
%\input{proof}
\caption{A visual proof of Example Theorem}
\label{fig:visual_theorem}
\end{figure}
\end{thm}
\begin{defn}[Definition 2]
\label{defn:definition_2}
A sample definition.
\caption{A caption for an environment typically without caption}
\end{defn}
\end{document}

View File

@ -0,0 +1,43 @@
set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin on
set fillchars=fold:\
set number
set foldcolumn=2
nnoremap q :qall!<cr>
let g:vimtex_fold_enabled = 1
silent edit test-env-options.tex
if empty($INMAKE) | finish | endif
let s:width = winwidth(0)
\ - (&number ? &numberwidth : 0)
\ - str2nr(matchstr(&foldcolumn, '\d\+$')) - 1
call assert_equal(s:width, strlen(foldtextresult(4)))
call assert_match(
\ '\\begin{defn}\[Definition 1\]\s\+(defn:definition_1)',
\ foldtextresult(4))
call assert_match(
\ '\\begin{figure} Simple figure\s\+(fig:simple_figure)',
\ foldtextresult(9))
call assert_match(
\ '\\begin{thm}\[Example Title of Theorem\]\s\+(thm:example_title_of_theorem)',
\ foldtextresult(16))
call assert_match(
\ ' \\begin{figure} A visual proof of Example .*(fig:visual_theorem)',
\ foldtextresult(27))
call assert_match(
\ '\\begin{defn}\[…\] A caption for an environment .*(defn:definition_2)',
\ foldtextresult(35))
call vimtex#test#finished()

View File

@ -0,0 +1,21 @@
\documentclass{article}
\begin{document}
Hello World
% {{{ Testing markers
Folded stuff
% }}}
Testing markers %<<:
this fold was NOT recognized by VimTeX before issue #1515
%:>>
%<<:
this fold worked before issue #1515
%:>>
\end{document}

View File

@ -0,0 +1,28 @@
set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin on
set fillchars=fold:\
set number
set foldcolumn=4
nnoremap q :qall!<cr>
call vimtex#log#set_silent()
let g:vimtex_fold_enabled = 1
silent edit test-markers.tex
if empty($INMAKE) | finish | endif
call assert_equal(0, foldlevel(4))
call assert_equal(1, foldlevel(7))
call assert_equal(0, foldlevel(12))
let g:vimtex_fold_types = {'markers': {'open': '<<:', 'close': ':>>'}}
VimtexReload
call assert_equal(1, foldlevel(12))
call vimtex#test#finished()

View File

@ -0,0 +1,239 @@
\documentclass[% Options of scrbook
%
% Preamble fold starts here, unless 'documentclass' is added to the
% g:vimtex_fold_commands option.
%
% draft,
fontsize=12pt,
%smallheadings,
headings=big,
english,
paper=a4,
twoside,
open=right,
DIV=14,
BCOR=20mm,
headinclude=false,
footinclude=false,
mpinclude=false,
pagesize,
titlepage,
parskip=half,
headsepline,
chapterprefix=false,
appendixprefix=Appendix,
appendixwithprefixline=true,
bibliography=totoc,
toc=graduated,
numbers=noenddot,
]{scrbook}
%
% Fold commands (single)
%
\hypersetup{
...,
}
\tikzset{
testing,
tested,
}
%
% Fold commands (single_opt)
%
\usepackage[
...
]{test}
\usepackage[
backend=biber,
style=numeric-comp,
maxcitenames=99,
doi=false,
url=false,
giveninits=true,
]{biblatex}
%
% Fold commands (multi)
%
\renewcommand{\marginpar}{%
\marginnote%
}
\newcommand*{\StoreCiteField}[3]{%
\begingroup
\global\let\StoreCiteField@Result\relax
\citefield{#2}[StoreCiteField]{#3}%
\endgroup
\let#1\StoreCiteField@Result
}
\newenvironment{theo}[1][]{%
\stepcounter{theo}%
\ifstrempty{#1}{%
\mdfsetup{
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]%
\node[anchor=east,rectangle,fill=blue!20] {\strut Theorem~\thetheo};%
}%
}%
}%
{% else ifstrempty:
\mdfsetup{
frametitle={
\tikz[baseline=(current bounding box.east),outer sep=0pt]%
\node[anchor=east,rectangle,fill=blue!20]{\strut Theorem~\thetheo:~#1};}%
}%
}%
\mdfsetup{
innertopmargin=10pt,
linecolor=blue!20,
linewidth=2pt,topline=true,
frametitleaboveskip=\dimexpr-\ht\strutbox\relax,
}%
\begin{mdframed}[]\relax%
}{%
\end{mdframed}%
}
\begin{document}
Hello World
%
% Fold commands (single)
%
\pgfplotstableread[col sep=semicolon,trim cells]{
x ; y ; z ; type ; reference ; comment
0.01 ; 1.00 ; nan ; type1 ; ref-unspecified ;
0.02 ; 2.00 ; nan ; type2 ; ref-unspecified ;
0.03 ; 3.00 ; nan ; type3 ; ref-unspecified ;
}{\datatable}
%
% Fold commands (single)
%
\pgfplotstableread[col sep=semicolon,trim cells]{
x ; y ; z ; type ; reference ; comment
0.01 ; 1.00 ; nan ; type1 ; ref-unspecified ;
0.02 ; 2.00 ; nan ; type2 ; ref-unspecified ;
0.03 ; 3.00 ; nan ; type3 ; ref-unspecified ;
}
\datatable
%
% Test for cmd_addplot
%
\begin{tikzpicture}
\begin{axis}
\addplot+[error bars/.cd,x dir=both,x explicit] coordinates {
(0,0) +- (0.1,0)
(0.5,1) +- (0.4,0.2)
(1,2)
(2,5) +- (1,0.1)
};
\end{axis}
\end{tikzpicture}
\section{test 1}
\begin{equation}
f(x) = 1
\label{sec:test1}
\end{equation}
\subsection{test 1.1}
\begin{equation}
f(x) = 1
\label{sec:test1-longer label}
\end{equation}
\section{test 2}
% {{{ Testing markers
Folded stuff
% }}}
Testing markers %<<:
this fold was NOT recognized by VimTeX before issue #1515
%:>>
%<<:
this fold worked before issue #1515
%:>>
\subsection{test 2.1}
\subsection{test 2.2}
\section{test 3}
\begin{itemize}
\item test of fold
folded here
\begin{enumerate}
\item new fold level heere
and here
\item new fold level heere
and here
\item new fold level heere
and here
\item and not here
\end{enumerate}
folded more here
\item test of fold
folded here
\end{itemize}
\begin{enumerate}
\item \begin{test}
hello
world
\end{test}
\item Folding issue
\item New folding issue \begin{proof}
asdasd
\end{proof}
\end{enumerate}
% The frames need to be in this order for the test to pass. This is likely a
% bug in vim, see https://github.com/lervag/vimtex/pull/1830#issuecomment-775527621
\begin{frame}
\frametitle{Title}
\framesubtitle{Subtitle}
hello world
\end{frame}
\begin{frame}[noframenumbering] % Title page
hello world
\end{frame}
\section{
test 4
}
\section{test 5}
From issue 2771:
\begin{table}[tbp]
\caption{Test caption}
\label{tab:test}
\begin{threeparttable}
\begin{tabular}{cc}
a & b\tnote{*} \\
1 & 2 \\
\end{tabular}
\begin{tablenotes}
\item[*] note 1
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

View File

@ -0,0 +1,77 @@
set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin on
set fillchars=fold:\
set number
set foldcolumn=4
nnoremap q :qall!<cr>
call vimtex#log#set_silent()
let g:vimtex_fold_enabled = 1
let g:vimtex_fold_types = {'comments' : {'enabled': 1}}
silent edit test-other.tex
if empty($INMAKE) | finish | endif
call assert_equal(1, foldlevel(1))
call assert_equal(2, foldlevel(2))
call assert_equal(2, foldlevel(34))
call assert_equal(2, foldlevel(48))
call assert_equal(3, foldlevel(128))
call assert_equal(2, foldlevel(144))
call assert_equal(
\ ' Preamble',
\ foldtextresult(1))
call assert_equal(
\ ' test 4',
\ foldtextresult(217))
call assert_equal(
\ '\usepackage[...]{biblatex}',
\ foldtextresult(48))
call assert_equal(
\ '\newcommand*{\StoreCiteField}[3]{%',
\ foldtextresult(63))
call assert_equal(
\ '\pgfplotstableread[col sep=semicolon,trim cells]{...}{\datatable}',
\ foldtextresult(105))
call assert_equal(
\ '(sec:test1-longer label)',
\ matchstr(foldtextresult(146), '(.*)$'))
call assert_equal(
\ '% {{{ Testing markers',
\ foldtextresult(153))
" Test with different markers
let g:vimtex_fold_types = {'markers': {'open': '<<:', 'close': ':>>'}}
VimtexReload
call assert_equal('Testing markers ', foldtextresult(158))
call assert_equal('% <<: this fold worked before issue #1515', foldtextresult(163))
call assert_equal(3, foldlevel(176))
call assert_equal(5, foldlevel(179))
call assert_equal(4, foldlevel(184))
call assert_equal(3, foldlevel(186))
call assert_equal(1, foldlevel(190))
call assert_equal(2, foldlevel(202))
call assert_equal(2, foldlevel(206))
call assert_equal(
\ '\begin{frame} Title: Subtitle',
\ foldtextresult(206))
call assert_equal(2, foldlevel(213))
call assert_equal(
\ '\begin{frame} Title page',
\ foldtextresult(213))
call assert_equal(1, foldlevel(line('$')-1))
call vimtex#test#finished()
" vim: fdm=manual

View File

@ -0,0 +1,12 @@
\documentclass{article}
\begin{document}
Hello World
% Fakesection test
Folded stuff
% Fakesubsection testing
More folds
\end{document}

View File

@ -0,0 +1,21 @@
set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin on
set fillchars=fold:\
set number
set foldcolumn=4
nnoremap q :qall!<cr>
call vimtex#log#set_silent()
let g:vimtex_fold_enabled = 1
silent edit test-sections.tex
if empty($INMAKE) | finish | endif
call assert_equal(2, foldlevel(10))
call vimtex#test#finished()