fix: add castel latex workflow
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
614ae12320
commit
5619e9b217
5 changed files with 138 additions and 583 deletions
|
@ -7,7 +7,9 @@
|
||||||
mappings.lua,
|
mappings.lua,
|
||||||
plugins.lua,
|
plugins.lua,
|
||||||
treesitter.lua
|
treesitter.lua
|
||||||
]
|
],
|
||||||
|
ftplugin/tex.lua,
|
||||||
|
UltiSnips/tex.snippets
|
||||||
];
|
];
|
||||||
.config/eww/[
|
.config/eww/[
|
||||||
eww.yuck,
|
eww.yuck,
|
||||||
|
@ -43,6 +45,10 @@
|
||||||
.config/zathura/zathurarc;
|
.config/zathura/zathurarc;
|
||||||
.config/dunst/dunstrc;
|
.config/dunst/dunstrc;
|
||||||
.config/qutebrowser/config.py;
|
.config/qutebrowser/config.py;
|
||||||
|
.config/helix/[
|
||||||
|
config.toml,
|
||||||
|
languages.toml
|
||||||
|
];
|
||||||
.wallpaper/[
|
.wallpaper/[
|
||||||
sgcfd.jpeg,
|
sgcfd.jpeg,
|
||||||
sgcfdblurred.jpg,
|
sgcfdblurred.jpg,
|
||||||
|
|
|
@ -1,301 +0,0 @@
|
||||||
snippet template "template for comp prog"
|
|
||||||
#include <bits/stdc++.h>
|
|
||||||
using namespace std;
|
|
||||||
int MOD = 1000000007;
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
ios::sync_with_stdio();
|
|
||||||
cin.tie(0);
|
|
||||||
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet if "if statement"
|
|
||||||
if ($1) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet while "while loop"
|
|
||||||
while ($1) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet fori "for i" w
|
|
||||||
for (int i = 0; i < $1; i++) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet forj "for j" w
|
|
||||||
for (int j = 0; j < $1; j++) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet fork "for k" w
|
|
||||||
for (int k = 0; k < $1; k++) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet fora "for auto" w
|
|
||||||
for (&auto i : $1) {
|
|
||||||
$0
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet print "print" w
|
|
||||||
cout << $1 << '\n';
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet printv "print vector" w
|
|
||||||
for (int i = 0; i < $1.size(); i++) {
|
|
||||||
cout << $1[i] << '\n';
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet ins "input string" w
|
|
||||||
string $1;
|
|
||||||
cin >> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet ini "input int" w
|
|
||||||
int $1;
|
|
||||||
cin >> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet viin "input vector int" w
|
|
||||||
int n;
|
|
||||||
cin >> n;
|
|
||||||
vector<int> $1;
|
|
||||||
for (int i = 0; i < n; i++) {
|
|
||||||
int a;
|
|
||||||
cin >> a;
|
|
||||||
$1.push_back(a);
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vsin "input vector string" w
|
|
||||||
int n;
|
|
||||||
cin >> n;
|
|
||||||
vector<string> $1;
|
|
||||||
for (int i = 0; i < n; i++) {
|
|
||||||
string s;
|
|
||||||
cin >> s;
|
|
||||||
$1.push_back(s);
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet sort "sort iterator" w
|
|
||||||
sort($1.begin(), $1.end());
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet sortr "sort reverse iterator" w
|
|
||||||
sort($1.rbegin(), $1.rend());
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet sortp "sort iterator pains" w
|
|
||||||
sort($1.begin(), $1.end(), [](auto &left, auto& right) {
|
|
||||||
$0
|
|
||||||
});
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet rev "reverse iterator" w
|
|
||||||
reverse($1.begin(), $1.end());
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet sum "sum vector" w
|
|
||||||
accumulate($1.begin(), $1.end(), 0);
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vec "vector" w
|
|
||||||
vector<$1> $2;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vvec "vector vector" w
|
|
||||||
vector<vector<$1>> $2;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vi "vector int" w
|
|
||||||
vector<int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vvi "vector vector int" w
|
|
||||||
vector<vector<int>> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vii "vector pair int" w
|
|
||||||
vector<pair<int, int>> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vs "vector string" w
|
|
||||||
vector<string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vvs "vector vector string" w
|
|
||||||
vector<vector<string>> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vss "vector pair int" w
|
|
||||||
vector<pair<string,string>> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vsi "vector pair string int" w
|
|
||||||
vector<pair<string,int>> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet vis "vector pair int string" w
|
|
||||||
vector<pair<int,string>> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet .pb "vector push back" i
|
|
||||||
.push_back($1)$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet os "ordered set" w
|
|
||||||
set<$1> $2;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet osi "ordered set int" w
|
|
||||||
set<int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet oss "ordered set string" w
|
|
||||||
set<string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet us "unordered set" w
|
|
||||||
unordered_set<$1> $2;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet usi "unordered set int" w
|
|
||||||
unordered_set<int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet uss "unordered set string" w
|
|
||||||
unordered_set<string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet om "ordered map" w
|
|
||||||
map<$1, $2> $3;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet omii "ordered map int int" w
|
|
||||||
map<int, int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet omss "ordered map int int" w
|
|
||||||
map<string, string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet omsi "ordered map string int" w
|
|
||||||
map<string, int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet omis "ordered map int string" w
|
|
||||||
map<int, string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet um "unordered map" w
|
|
||||||
unordered_map<$1, $2> $3;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet umii "unordered map int int" w
|
|
||||||
unordered_map<int, int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet umss "unordered map int int" w
|
|
||||||
unordered_map<string, string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet umsi "unordered map string int" w
|
|
||||||
unordered_map<string, int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet umis "unordered map int string" w
|
|
||||||
unordered_map<int, string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet que "queue" w
|
|
||||||
queue<$1> $2;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet qi "queue integer" w
|
|
||||||
queue<int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet qs "queue string" w
|
|
||||||
queue<string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet sta "stack" w
|
|
||||||
stack<$1> $2;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet si "stack int" w
|
|
||||||
stack<int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet ss "stack string" w
|
|
||||||
stack<string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pq "priority queue" w
|
|
||||||
priority_queue<$1> $2;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pqi "priority queue int" w
|
|
||||||
priority_queue<int> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pqs "priority queue string" w
|
|
||||||
priority_queue<string> $1;
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
|
@ -1,96 +0,0 @@
|
||||||
snippet h1 "h1 header" bA
|
|
||||||
# $0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet h2 "h2 header" bA
|
|
||||||
## $0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet h3 "h3 header" bA
|
|
||||||
### $0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet h4 "h4 header" bA
|
|
||||||
#### $0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet h5 "h5 header" bA
|
|
||||||
##### $0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet h6 "h6 header" bA
|
|
||||||
###### $0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet link "link"
|
|
||||||
[$1]($2)$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet img "image"
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet im "inline math"
|
|
||||||
\$$0\$
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet am "display math"
|
|
||||||
\$\$
|
|
||||||
$0
|
|
||||||
\$\$
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet cb "code block" bA
|
|
||||||
\`\`\`$1
|
|
||||||
$0
|
|
||||||
\`\`\`
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
global !p
|
|
||||||
# A overkill(dirty) table with automatic alignment feature
|
|
||||||
def create_table(snip):
|
|
||||||
# retrieving single line from current string and treat it like tabstops count
|
|
||||||
placeholders_string = snip.buffer[snip.line].strip()
|
|
||||||
rows_amount = int(placeholders_string[0])
|
|
||||||
columns_amount = int(placeholders_string[1])
|
|
||||||
prefix_str = "from vimsnippets import display_width;"
|
|
||||||
# erase current line
|
|
||||||
snip.buffer[snip.line] = ""
|
|
||||||
# create anonymous snippet with expected content and number of tabstops
|
|
||||||
anon_snippet_title = "| "
|
|
||||||
anon_snippet_delimiter = "|"
|
|
||||||
for col in range(1, columns_amount+1):
|
|
||||||
sync_rows = [x*columns_amount+col for x in range(rows_amount+1)]
|
|
||||||
sync_str = ",".join(["t[{0}]".format(x) for x in sync_rows])
|
|
||||||
max_width_str = "max(list(map(display_width, [" + sync_str + "])))"
|
|
||||||
cur_width_str = "display_width(t[" + str(col) + "])"
|
|
||||||
rv_val = "(" + max_width_str + "-" + cur_width_str + ")*' '"
|
|
||||||
anon_snippet_title += "${" + str(col) + ":head" + str(col)\
|
|
||||||
+ "}`!p " + prefix_str + "snip.rv=" + rv_val + "` | "
|
|
||||||
anon_snippet_delimiter += ":`!p " + prefix_str + "snip.rv = "\
|
|
||||||
+ max_width_str + "*'-'" + "`-|"
|
|
||||||
anon_snippet_title += "\n"
|
|
||||||
anon_snippet_delimiter += "\n"
|
|
||||||
anon_snippet_body = ""
|
|
||||||
for row in range(1, rows_amount+1):
|
|
||||||
body_row = "| "
|
|
||||||
for col in range(1, columns_amount+1):
|
|
||||||
sync_rows = [x*columns_amount+col for x in range(rows_amount+1)]
|
|
||||||
sync_str = ",".join(["t[{0}]".format(x) for x in sync_rows])
|
|
||||||
max_width_str = "max(list(map(display_width, [" + sync_str + "])))"
|
|
||||||
cur_width_str = "display_width(t[" + str(row*columns_amount+col) + "])"
|
|
||||||
rv_val = "(" + max_width_str + "-" + cur_width_str + ")*' '"
|
|
||||||
placeholder = "R{0}C{1}".format(row, col)
|
|
||||||
body_row += "${" + str(row*columns_amount+col) + ":" + placeholder\
|
|
||||||
+ "}`!p " + prefix_str + "snip.rv=" + rv_val + "` | "
|
|
||||||
body_row += "\n"
|
|
||||||
anon_snippet_body += body_row
|
|
||||||
anon_snippet_table = anon_snippet_title + anon_snippet_delimiter + anon_snippet_body
|
|
||||||
# expand anonymous snippet
|
|
||||||
snip.expand_anon(anon_snippet_table)
|
|
||||||
endglobal
|
|
||||||
|
|
||||||
post_jump "create_table(snip)"
|
|
||||||
snippet "tb([1-9][1-9])" "Fancy table" br
|
|
||||||
`!p snip.rv = match.group(1)`
|
|
||||||
endsnippet
|
|
|
@ -1,262 +1,209 @@
|
||||||
# Document
|
global !p
|
||||||
snippet importmath "amsmath amssymb"
|
def math():
|
||||||
\usepackage{amsmath}
|
return vim.eval('vimtex#syntax#in_mathzone()') == '1'
|
||||||
\usepackage{amssymb}
|
|
||||||
|
def comment():
|
||||||
|
return vim.eval('vimtex#syntax#in_comment()') == '1'
|
||||||
|
|
||||||
|
def env(name):
|
||||||
|
[x,y] = vim.eval("vimtex#env#is_inside('" + name + "')")
|
||||||
|
return x != '0' and y != '0'
|
||||||
|
|
||||||
|
endglobal
|
||||||
|
|
||||||
|
# General Formatting
|
||||||
|
snippet beg "begin{} / end{}" bA
|
||||||
|
\\begin{$1}
|
||||||
|
$0
|
||||||
|
\\end{$1}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet importgeo "geometry"
|
snippet tit "Italics" w
|
||||||
\usepackage[left=2cm,top=2cm]{geometry}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet importenum "enum item"
|
|
||||||
\usepackage{enumitem}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet setlist "set list"
|
|
||||||
\setlist[enumerate,$1]{label={\roman*.}}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet titleneu "Lucas NEU Author Title"
|
|
||||||
\title{$1}
|
|
||||||
\author {
|
|
||||||
Sta. Maria, Lucas \\\\
|
|
||||||
\texttt{stamaria.l@northeastern.edu}
|
|
||||||
}
|
|
||||||
\date{`date +"%B %d, %Y"`}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet titlenor "Lucas Normal Author Title"
|
|
||||||
\title{$1}
|
|
||||||
\author {
|
|
||||||
Sta. Maria, Lucas \\\\
|
|
||||||
\texttt{stamaria.l@northeastern.edu}
|
|
||||||
}
|
|
||||||
\date{`date +"%B %d, %Y"`}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet worddoc "Word document"
|
|
||||||
\documentclass{article}
|
|
||||||
\usepackage{wordlike}
|
|
||||||
\PassOptionsToPackage{margin=1in}{geometry}
|
|
||||||
\usepackage[hang,flushmargin]{footmisc}
|
|
||||||
\usepackage[parfill]{parskip}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
# Text Formatting
|
|
||||||
snippet bold "bold font"
|
|
||||||
\textbf{$1}$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet ita "italic font"
|
|
||||||
\textit{$1}$0
|
\textit{$1}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet boi "bold italic font"
|
snippet tob "Bold" w
|
||||||
\textbf{\textit{$1}}$0
|
\textbf{$1}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ul "underline font"
|
# Text Formatting
|
||||||
\underline{$1}$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet ... "ldots"
|
snippet ... "ldots" A
|
||||||
\ldots
|
\ldots
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet fn "footnote" i
|
# Math Environments
|
||||||
\footnote{$0}
|
snippet im "Inline math" w
|
||||||
|
\(${1}\)`!p
|
||||||
|
if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
|
||||||
|
snip.rv = ' '
|
||||||
|
else:
|
||||||
|
snip.rv = ''
|
||||||
|
`$2
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
# General Shortcuts
|
snippet dm "Display math" w
|
||||||
snippet beg "\begin{} / end{}"
|
\[
|
||||||
\begin{$1}
|
${1:${VISUAL}}
|
||||||
$0
|
\] $0
|
||||||
\end{$1}
|
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet olist "ordered list"
|
# Math Snippets
|
||||||
\begin{enumerate}
|
context "math()"
|
||||||
\item $0
|
snippet iff "iff" Ai
|
||||||
\end{enumerate}
|
\iff
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ulist "unordered list"
|
context "math()"
|
||||||
\begin{itemize}
|
snippet => "implies" iA
|
||||||
\item $0
|
\Rightarrow
|
||||||
\end{itemize}
|
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
# Math Shortcuts
|
context "math()"
|
||||||
snippet * "cdot" iA
|
snippet =< "implied by" iA
|
||||||
\cdot
|
\Leftarrow
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet im "inline math"
|
context "math()"
|
||||||
\$$0\$
|
snippet -> "maps to" iA
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet dm "display math"
|
|
||||||
\$\$
|
|
||||||
$0
|
|
||||||
\$\$
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet am "align math"
|
|
||||||
\begin{align}
|
|
||||||
$0
|
|
||||||
\end{align}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet nonum "no number"
|
|
||||||
\nonumber $0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
# Math Symbols Shortcuts
|
|
||||||
snippet mbb "\mathbb" iA
|
|
||||||
$1\mathbb{$2}$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet rarr "right arrow" iA
|
|
||||||
\rightarrow
|
\rightarrow
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet larr "left arrow" iA
|
context "math()"
|
||||||
|
snippet -< "maps from" iA
|
||||||
\leftarrow
|
\leftarrow
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet set "math set" w
|
context "math()"
|
||||||
\\\{$1\\\}$0
|
snippet / "Fraction" i
|
||||||
|
\\frac{$1}{$2}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet tf "therefore" w
|
context "math()"
|
||||||
\therefore$1$0
|
snippet '([A-Za-z])(\d)' "auto subscript" wrA
|
||||||
|
`!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)`
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet frac "\frac" w
|
context "math()"
|
||||||
$1\frac{$2}{$3}$0
|
snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA
|
||||||
|
`!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet sqq "square" iA
|
snippet __ "subscript" iA
|
||||||
^2
|
_{$1}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet cbb "cube" iA
|
context "math()"
|
||||||
^3
|
snippet ceil "ceil" iA
|
||||||
|
\left\lceil $1 \right\rceil $0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet sss "superscript" iA
|
context "math()"
|
||||||
^{$0}
|
snippet floor "floor" iA
|
||||||
|
\left\lfloor $1 \right\rfloor$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ssb "subscript" iA
|
context "math()"
|
||||||
_{$0}
|
snippet ** "cdot" iA
|
||||||
|
\cdot
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet land "logical and" iA
|
priority 100
|
||||||
\wedge$0
|
context "math()"
|
||||||
|
snippet '(?<!\\)(sin|cos|arccot|cot|csc|ln|log|exp|star|perp)' "ln" rwA
|
||||||
|
\\`!p snip.rv = match.group(1)`
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet lor "logical or" iA
|
priority 300
|
||||||
\vee$0
|
context "math()"
|
||||||
|
snippet dint "integral" wA
|
||||||
|
\int_{${1}}^{${2}} ${3} $0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet lnot "logical not" iA
|
priority 200
|
||||||
\neg$0
|
context "math()"
|
||||||
|
snippet '(?<!\\)(arcsin|arccos|arctan|arccot|arccsc|arcsec|pi|zeta|int)' "ln" rwA
|
||||||
|
\\`!p snip.rv = match.group(1)`
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet lxor "logical xor" iA
|
priority 100
|
||||||
\veebar$0
|
context "math()"
|
||||||
|
snippet -> "to" iA
|
||||||
|
\to
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet sand "set and" i
|
priority 200
|
||||||
\cap$0
|
context "math()"
|
||||||
|
snippet <-> "leftrightarrow" iA
|
||||||
|
\leftrightarrow
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet sor "set or" i
|
context "math()"
|
||||||
\cup$0
|
snippet !> "mapsto" iA
|
||||||
|
\mapsto
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet snot "set not" i
|
context "math()"
|
||||||
\bar{$1}$0
|
snippet invs "inverse" iA
|
||||||
|
^{-1}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet cong "logical congruent" i
|
context "math()"
|
||||||
\cong $0
|
snippet compl "complement" iA
|
||||||
|
^{c}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ncong "logical not congruent" i
|
context "math()"
|
||||||
\ncong $0
|
snippet set "set" wA
|
||||||
|
\\{$1\\} $0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet cap "set cap" i
|
context "math()"
|
||||||
\cap $0
|
snippet cc "subset" Ai
|
||||||
|
\subset
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet cup "set cup" i
|
snippet notin "not in " iA
|
||||||
\cup $0
|
\not\in
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
# Boxes
|
context "math()"
|
||||||
snippet importcbox "import colored boxes"
|
snippet inn "in " iA
|
||||||
\usepackage[most]{tcolorbox}
|
\in
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet boxr "red box" wA
|
snippet NN "n" iA
|
||||||
\begin{tcolorbox}[colback=red!30!white,colframe=red!30!white, sharp corners]
|
\N
|
||||||
$0
|
|
||||||
\end{tcolorbox}
|
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet boxb "blue box" wA
|
snippet Nn "cap" iA
|
||||||
\begin{tcolorbox}[colback=blue!30!white,colframe=blue!30!white, sharp corners]
|
\cap
|
||||||
$0
|
|
||||||
\end{tcolorbox}
|
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet boxg "green box" wA
|
snippet UU "cup" iA
|
||||||
\begin{tcolorbox}[colback=green!30!white,colframe=green!30!white, sharp corners]
|
\cup
|
||||||
$0
|
|
||||||
\end{tcolorbox}
|
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet boxtr "red title box" wA
|
priority 10
|
||||||
\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black,title=$1]
|
context "math()"
|
||||||
$0
|
snippet "bar" "bar" riA
|
||||||
\end{tcolorbox}
|
\overline{$1}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet boxtb "blue title box" wA
|
priority 100
|
||||||
\begin{tcolorbox}[colback=blue!5!white,colframe=blue!75!black,title=$1]
|
context "math()"
|
||||||
$0
|
snippet "([a-zA-Z])bar" "bar" riA
|
||||||
\end{tcolorbox}
|
\overline{`!p snip.rv=match.group(1)`}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet boxtg "green title box" wA
|
priority 10
|
||||||
\begin{tcolorbox}[colback=green!5!white, colframe=green!75!black,title=$1]
|
context "math()"
|
||||||
$0
|
snippet "hat" "hat" riA
|
||||||
\end{tcolorbox}
|
\hat{$1}$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet proposition "red box" w
|
priority 100
|
||||||
\begin{tcolorbox}[colback=red!30!white,colframe=red!30!white, sharp corners]
|
context "math()"
|
||||||
\textbf{Proposition} \\\\
|
snippet "([a-zA-Z])hat" "hat" riA
|
||||||
$0
|
\hat{`!p snip.rv=match.group(1)`}
|
||||||
\end{tcolorbox}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet theorem "blue box" w
|
|
||||||
\begin{tcolorbox}[colback=blue!30!white,colframe=blue!30!white, sharp corners]
|
|
||||||
\textbf{Theorem} \\\\
|
|
||||||
$0
|
|
||||||
\end{tcolorbox}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet definition "green box" w
|
|
||||||
\begin{tcolorbox}[colback=green!30!white,colframe=green!30!white, sharp corners]
|
|
||||||
\textbf{Definition} \\\\
|
|
||||||
$0
|
|
||||||
\end{tcolorbox}
|
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
|
@ -35,5 +35,4 @@ require("plugins")
|
||||||
require("mappings")
|
require("mappings")
|
||||||
require("treesitter")
|
require("treesitter")
|
||||||
require("completion")
|
require("completion")
|
||||||
require("snippets")
|
|
||||||
require("lsp")
|
require("lsp")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue