I broke up with neovim....vim is my best friend now

This commit is contained in:
LinlyBoi
2023-04-30 08:14:07 +03:00
parent 0d185449c5
commit 4a4a6b1e81
5245 changed files with 468325 additions and 25 deletions

View File

@@ -0,0 +1,22 @@
MYVIM ?= nvim --clean --headless
INMAKE := 1
export INMAKE
TESTS := $(wildcard test_*_reference.tex)
TESTS := $(TESTS:_reference.tex=)
.PHONY: test $(TESTS)
test: $(TESTS)
$(TESTS):
@rm -f $@_output.tex
@FILEIN=$@_input.tex FILEOUT=$@_output.tex $(MYVIM) -u test.vim
@diff $@_output.tex $@_reference.tex
@rm -f $@_output.tex
test_ampersands-off: export FLAGS=1
test_environments-ignored: export FLAGS=2
test_close-indented: export FLAGS=3
test_close_open_same_line: export FLAGS=4

View File

@@ -0,0 +1,33 @@
set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin indent on
nnoremap q :qall!<cr>
set nomore
set shiftwidth=2
set expandtab
if !empty($FLAGS)
if $FLAGS == 1
let g:vimtex_indent_on_ampersands = 0
elseif $FLAGS == 2
let g:vimtex_indent_ignored_envs = ['proof']
elseif $FLAGS == 3
let g:vimtex_indent_delims = {'close_indented': 1}
elseif $FLAGS == 4
let g:vimtex_indent_delims = {
\ 'open': ['{', '\['],
\ 'close': ['}', '\]'],
\ }
endif
endif
execute 'silent edit' $FILEIN
if empty($INMAKE) | finish | endif
silent normal! gg=G
execute 'silent write!' $FILEOUT
quit!

View File

@@ -0,0 +1,13 @@
\begin{equation}
\begin{aligned}
1 &
& 2 \\
3 &
& 4 \\
\end{aligned}
\end{equation}
\begin{align}
&x(
y)
\end{align}

View File

@@ -0,0 +1,13 @@
\begin{equation}
\begin{aligned}
1 &
& 2 \\
3 &
& 4 \\
\end{aligned}
\end{equation}
\begin{align}
&x(
y)
\end{align}

View File

@@ -0,0 +1,30 @@
\documentclass{minimal}
\begin{document}
\begin{tabular}{cc}
\begin{tabular}{c}
Cell 1
\end{tabular} &
\begin{tabular}{c}
Cell 2
\end{tabular}
\end{tabular}
\begin{equation}
\begin{aligned}
1 &
& 2 \\
3 &
& 4 \\
\end{aligned}
\end{equation}
\begin{environ*}
A &= 10
\\&= \command{
something
}
\\&= 20
\end{environ*}
\end{document}

View File

@@ -0,0 +1,18 @@
\documentclass{beamer}
\usepackage{amsmath}
\usepackage{bytefield}
\begin{document}
\begin{align}
x &= \begin{bmatrix} 1 \\ 3 \end{bmatrix}
\end{align}
\begin{frame}
\begin{bytefield}{2}
\begin{leftwordgroup}{Test}
\bitbox{1}{Test} & \bitbox{1}{Test}
\end{leftwordgroup} \\[1.5ex]
\end{bytefield}
\end{frame}
\end{document}

View File

@@ -0,0 +1,18 @@
\documentclass{beamer}
\usepackage{amsmath}
\usepackage{bytefield}
\begin{document}
\begin{align}
x &= \begin{bmatrix} 1 \\ 3 \end{bmatrix}
\end{align}
\begin{frame}
\begin{bytefield}{2}
\begin{leftwordgroup}{Test}
\bitbox{1}{Test} & \bitbox{1}{Test}
\end{leftwordgroup} \\[1.5ex]
\end{bytefield}
\end{frame}
\end{document}

View File

@@ -0,0 +1,30 @@
\documentclass{minimal}
\begin{document}
\begin{tabular}{cc}
\begin{tabular}{c}
Cell 1
\end{tabular} &
\begin{tabular}{c}
Cell 2
\end{tabular}
\end{tabular}
\begin{equation}
\begin{aligned}
1 &
& 2 \\
3 &
& 4 \\
\end{aligned}
\end{equation}
\begin{environ*}
A &= 10
\\&= \command{
something
}
\\&= 20
\end{environ*}
\end{document}

View File

@@ -0,0 +1,20 @@
\documentclass{minimal}
\usepackage{amsmath}
\begin{document}
\[
f(x) = 1
\]
{Stuff here
asdasd}
\begin{equation}
\left(
f(x) = 3
\right)
\left.
f(x) = 3
\right.
\end{equation}
\end{document}

View File

@@ -0,0 +1,20 @@
\documentclass{minimal}
\usepackage{amsmath}
\begin{document}
\[
f(x) = 1
\]
{Stuff here
asdasd}
\begin{equation}
\left(
f(x) = 3
\right)
\left.
f(x) = 3
\right.
\end{equation}
\end{document}

View File

@@ -0,0 +1,25 @@
\documentclass{minimal}
\begin{document}
\command{
a
}{
b
}
\begin{equation}
\left(
f(x) = 3
\right)
\left.
f(x) = 3
\right.
\end{equation}
{
\graph[nodes={draw}
test
]
}
\end{document}

View File

@@ -0,0 +1,25 @@
\documentclass{minimal}
\begin{document}
\command{
a
}{
b
}
\begin{equation}
\left(
f(x) = 3
\right)
\left.
f(x) = 3
\right.
\end{equation}
{
\graph[nodes={draw}
test
]
}
\end{document}

View File

@@ -0,0 +1,9 @@
\documentclass{minimal}
\usepackage{amsmath}
\begin{document}
\begin{proof}
This statement is false.
\end{proof}
\end{document}

View File

@@ -0,0 +1,9 @@
\documentclass{minimal}
\usepackage{amsmath}
\begin{document}
\begin{proof}
This statement is false.
\end{proof}
\end{document}

View File

@@ -0,0 +1,34 @@
\documentclass{minimal}
\begin{document}
Hello
\begin{centering} centered \end{centering}
world
\begin{outer}
\begin{inner} inline environment \end{inner}
\end{outer}
\begin{tabular}{%
ccc}
$a$ & $b$ & $c$ \\
$d$ & $e$ & $f$
\end{tabular}
\begin{itemize}
\item item is indented twice
and the next line is indented to match
\end{itemize}
\begin{description}
\item[One] Ingeniería Electrónica ``first'';
a couple of lines.
\item[Doctorado] ``Generic title''
(Author): commentaries here
\end{description}
\begin{mydocument}
hello world
\end{mydocument}
\end{document}

View File

@@ -0,0 +1,34 @@
\documentclass{minimal}
\begin{document}
Hello
\begin{centering} centered \end{centering}
world
\begin{outer}
\begin{inner} inline environment \end{inner}
\end{outer}
\begin{tabular}{%
ccc}
$a$ & $b$ & $c$ \\
$d$ & $e$ & $f$
\end{tabular}
\begin{itemize}
\item item is indented twice
and the next line is indented to match
\end{itemize}
\begin{description}
\item[One] Ingeniería Electrónica ``first'';
a couple of lines.
\item[Doctorado] ``Generic title''
(Author): commentaries here
\end{description}
\begin{mydocument}
hello world
\end{mydocument}
\end{document}

View File

@@ -0,0 +1,21 @@
\documentclass{article}
\begin{document}
\begin{itemize}
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
\end{itemize}
\begin{itemize}
something here
\item [options] blah blah
\item[opt] blah blah
\item * the star is the correct one
\item etcetera
\end{itemize}
\end{document}

View File

@@ -0,0 +1,21 @@
\documentclass{article}
\begin{document}
\begin{itemize}
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
\end{itemize}
\begin{itemize}
something here
\item [options] blah blah
\item[opt] blah blah
\item * the star is the correct one
\item etcetera
\end{itemize}
\end{document}

View File

@@ -0,0 +1,66 @@
\documentclass{article}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\[
1+1
\]
\begin{align}
2+2 = 4\\[1ex]
3+3 = 6
\end{align}
\begin{equation}
\left(
f(x) = 3
\right)
\left.
f(x) = 3
\right.
\end{equation}
Test $[ ... )$ of unmatched brackets in
inline math text.
In R, there is the operator \verb|[<-|...
that ...
\begin{equation*}
\left \{
\begin{aligned}
-\Delta \theta &= u \quad \text{in } \Omega, \\
\theta &=0 \quad \text{on } \Gamma.
\end{aligned}
\right.
\end{equation*}
\begin{equation} \label{eq:state2}
\left\{
\begin{aligned}
-\div [a_M(z)\nabla y + b(\nabla y)] &= u \quad \text{in } \Omega, \\
y &=0 \quad \text{on } \Gamma.
\end{aligned}
\right.
\end{equation}
\begin{equation}
\left\{
\begin{aligned}
\min_{u,y} &J(u,y) \\
\text{s.t.} \quad
&
-\Delta y = u \text{in } \Omega\\
y = 0 \text{on } \partial\Omega.
\\
&\begin{aligned}[t]
-\Delta y &= u && \text{in } \Omega\\
y &= 0 && \text{on } \partial\Omega.
\end{aligned}
\end{aligned}
\right.
\end{equation}
\end{document}

View File

@@ -0,0 +1,66 @@
\documentclass{article}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\[
1+1
\]
\begin{align}
2+2 = 4\\[1ex]
3+3 = 6
\end{align}
\begin{equation}
\left(
f(x) = 3
\right)
\left.
f(x) = 3
\right.
\end{equation}
Test $[ ... )$ of unmatched brackets in
inline math text.
In R, there is the operator \verb|[<-|...
that ...
\begin{equation*}
\left \{
\begin{aligned}
-\Delta \theta &= u \quad \text{in } \Omega, \\
\theta &=0 \quad \text{on } \Gamma.
\end{aligned}
\right.
\end{equation*}
\begin{equation} \label{eq:state2}
\left\{
\begin{aligned}
-\div [a_M(z)\nabla y + b(\nabla y)] &= u \quad \text{in } \Omega, \\
y &=0 \quad \text{on } \Gamma.
\end{aligned}
\right.
\end{equation}
\begin{equation}
\left\{
\begin{aligned}
\min_{u,y} &J(u,y) \\
\text{s.t.} \quad
&
-\Delta y = u \text{in } \Omega\\
y = 0 \text{on } \partial\Omega.
\\
&\begin{aligned}[t]
-\Delta y &= u && \text{in } \Omega\\
y &= 0 && \text{on } \partial\Omega.
\end{aligned}
\end{aligned}
\right.
\end{equation}
\end{document}

View File

@@ -0,0 +1,49 @@
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\begin{document}
\tikz \fill[green] rectangle (0.5,0.5); Something
about something.
\begin{tikzpicture}
\draw [solid] let \p{I} = (0,0) in (1,1) -|
(\x{I}-1cm,-1cm) node [yshift=-.25cm] {(i)};
% Just some comment
\end{tikzpicture}
\begin{tikzpicture}
% (i) center contact head
\draw [solid] let \p{I} = (centerContactHead) in (centerContactHead) -|
(\x{I}-.75cm,-2.5)
node [yshift=-.25cm] {(i)};
% (ii) outer conductor of the contact head
\coordinate (outerContactHead) at (.8,-1.7);
\draw [solid] let \p{O} = (outerContactHead)
in (outerContactHead) -- (\x{O},-2.5)
node [yshift=-.25cm] {(ii)};
\begin{axis}
\addplot
table[row sep=crcr]{%
0 0\\
1 1\\
2 2\\
};
\end{axis}
\end{tikzpicture}
\begin{center}
\begin{circuitikz}[american]
\draw (0,0) node[npn]{};
\end{circuitikz}
\end{center}
\begin{center}
\begin{circuitikz}[american, baseline=(VCC)]
\draw (0,0) node[npn]{};
\end{circuitikz}
\end{center}
\end{document}

View File

@@ -0,0 +1,56 @@
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw
(2,0)
-- (3,0)
-- (4,0)
-- (5,0)
-- (6,0)
-- (7,0)
-- (8,0)
-- (9,0)
-- (10,0)
-- (11,0)
-- (12,0)
-- (13,0)
-- (14,0)
-- (15,0)
-- (16,0)
-- (17,0)
-- (18,0)
-- (19,0)
-- (20,0)
-- (21,0)
-- (22,0)
-- (23,0)
-- (24,0)
-- (25,0)
-- (26,0)
-- (27,0)
-- (28,0)
-- (29,0)
-- (30,0)
-- (31,0)
-- (32,0)
-- (33,0)
-- (34,0)
-- (35,0)
-- (36,0)
-- (37,0)
-- (38,0)
-- (39,0)
-- (40,0)
-- (41,0)
-- (42,0)
-- (43,0)
-- (44,0)
-- (45,0)
-- (46,0)
-- (47,0)
-- (48,0)
-- (49,0) % Deleting this row makes the last row indent correctly
;
\end{tikzpicture}
\end{document}

View File

@@ -0,0 +1,56 @@
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw
(2,0)
-- (3,0)
-- (4,0)
-- (5,0)
-- (6,0)
-- (7,0)
-- (8,0)
-- (9,0)
-- (10,0)
-- (11,0)
-- (12,0)
-- (13,0)
-- (14,0)
-- (15,0)
-- (16,0)
-- (17,0)
-- (18,0)
-- (19,0)
-- (20,0)
-- (21,0)
-- (22,0)
-- (23,0)
-- (24,0)
-- (25,0)
-- (26,0)
-- (27,0)
-- (28,0)
-- (29,0)
-- (30,0)
-- (31,0)
-- (32,0)
-- (33,0)
-- (34,0)
-- (35,0)
-- (36,0)
-- (37,0)
-- (38,0)
-- (39,0)
-- (40,0)
-- (41,0)
-- (42,0)
-- (43,0)
-- (44,0)
-- (45,0)
-- (46,0)
-- (47,0)
-- (48,0)
-- (49,0) % Deleting this row makes the last row indent correctly
;
\end{tikzpicture}
\end{document}

View File

@@ -0,0 +1,49 @@
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\begin{document}
\tikz \fill[green] rectangle (0.5,0.5); Something
about something.
\begin{tikzpicture}
\draw [solid] let \p{I} = (0,0) in (1,1) -|
(\x{I}-1cm,-1cm) node [yshift=-.25cm] {(i)};
% Just some comment
\end{tikzpicture}
\begin{tikzpicture}
% (i) center contact head
\draw [solid] let \p{I} = (centerContactHead) in (centerContactHead) -|
(\x{I}-.75cm,-2.5)
node [yshift=-.25cm] {(i)};
% (ii) outer conductor of the contact head
\coordinate (outerContactHead) at (.8,-1.7);
\draw [solid] let \p{O} = (outerContactHead)
in (outerContactHead) -- (\x{O},-2.5)
node [yshift=-.25cm] {(ii)};
\begin{axis}
\addplot
table[row sep=crcr]{%
0 0\\
1 1\\
2 2\\
};
\end{axis}
\end{tikzpicture}
\begin{center}
\begin{circuitikz}[american]
\draw (0,0) node[npn]{};
\end{circuitikz}
\end{center}
\begin{center}
\begin{circuitikz}[american, baseline=(VCC)]
\draw (0,0) node[npn]{};
\end{circuitikz}
\end{center}
\end{document}

View File

@@ -0,0 +1,25 @@
\begin{verbatim}
#!/bin/bash
echo "test"
\end{verbatim}
\begin{lstlisting}
Indent
should
not affect verbatim environments!
\end{lstlisting}
\begin{markdown}
An h1 header
============
Paragraphs are separated by a blank line.
2nd paragraph.
*Italic*, **bold**, and `monospace`.
Itemized lists look like:
* this one
* that one
* the other one
\end{markdown}

View File

@@ -0,0 +1,25 @@
\begin{verbatim}
#!/bin/bash
echo "test"
\end{verbatim}
\begin{lstlisting}
Indent
should
not affect verbatim environments!
\end{lstlisting}
\begin{markdown}
An h1 header
============
Paragraphs are separated by a blank line.
2nd paragraph.
*Italic*, **bold**, and `monospace`.
Itemized lists look like:
* this one
* that one
* the other one
\end{markdown}