1
0
Fork 0

fix: add castel latex workflow

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
Lucas Sta Maria 2022-09-11 23:30:48 -04:00
parent 614ae12320
commit 5619e9b217
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47
5 changed files with 138 additions and 583 deletions

View file

@ -7,7 +7,9 @@
mappings.lua,
plugins.lua,
treesitter.lua
]
],
ftplugin/tex.lua,
UltiSnips/tex.snippets
];
.config/eww/[
eww.yuck,
@ -43,6 +45,10 @@
.config/zathura/zathurarc;
.config/dunst/dunstrc;
.config/qutebrowser/config.py;
.config/helix/[
config.toml,
languages.toml
];
.wallpaper/[
sgcfd.jpeg,
sgcfdblurred.jpg,

View file

@ -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

View file

@ -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"
![$2]($1)$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

View file

@ -1,262 +1,209 @@
# Document
snippet importmath "amsmath amssymb"
\usepackage{amsmath}
\usepackage{amssymb}
global !p
def math():
return vim.eval('vimtex#syntax#in_mathzone()') == '1'
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
snippet importgeo "geometry"
\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"
snippet tit "Italics" w
\textit{$1}$0
endsnippet
snippet boi "bold italic font"
\textbf{\textit{$1}}$0
snippet tob "Bold" w
\textbf{$1}$0
endsnippet
snippet ul "underline font"
\underline{$1}$0
endsnippet
# Text Formatting
snippet ... "ldots"
snippet ... "ldots" A
\ldots
endsnippet
snippet fn "footnote" i
\footnote{$0}
# Math Environments
snippet im "Inline math" w
\(${1}\)`!p
if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
snip.rv = ' '
else:
snip.rv = ''
`$2
endsnippet
# General Shortcuts
snippet beg "\begin{} / end{}"
\begin{$1}
$0
\end{$1}
snippet dm "Display math" w
\[
${1:${VISUAL}}
\] $0
endsnippet
snippet olist "ordered list"
\begin{enumerate}
\item $0
\end{enumerate}
# Math Snippets
context "math()"
snippet iff "iff" Ai
\iff
endsnippet
snippet ulist "unordered list"
\begin{itemize}
\item $0
\end{itemize}
context "math()"
snippet => "implies" iA
\Rightarrow
endsnippet
# Math Shortcuts
snippet * "cdot" iA
\cdot
context "math()"
snippet =< "implied by" iA
\Leftarrow
endsnippet
snippet im "inline math"
\$$0\$
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
context "math()"
snippet -> "maps to" iA
\rightarrow
endsnippet
snippet larr "left arrow" iA
context "math()"
snippet -< "maps from" iA
\leftarrow
endsnippet
snippet set "math set" w
\\\{$1\\\}$0
context "math()"
snippet / "Fraction" i
\\frac{$1}{$2}$0
endsnippet
snippet tf "therefore" w
\therefore$1$0
context "math()"
snippet '([A-Za-z])(\d)' "auto subscript" wrA
`!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)`
endsnippet
snippet frac "\frac" w
$1\frac{$2}{$3}$0
context "math()"
snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA
`!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`}
endsnippet
snippet sqq "square" iA
^2
snippet __ "subscript" iA
_{$1}$0
endsnippet
snippet cbb "cube" iA
^3
context "math()"
snippet ceil "ceil" iA
\left\lceil $1 \right\rceil $0
endsnippet
snippet sss "superscript" iA
^{$0}
context "math()"
snippet floor "floor" iA
\left\lfloor $1 \right\rfloor$0
endsnippet
snippet ssb "subscript" iA
_{$0}
context "math()"
snippet ** "cdot" iA
\cdot
endsnippet
snippet land "logical and" iA
\wedge$0
priority 100
context "math()"
snippet '(?<!\\)(sin|cos|arccot|cot|csc|ln|log|exp|star|perp)' "ln" rwA
\\`!p snip.rv = match.group(1)`
endsnippet
snippet lor "logical or" iA
\vee$0
priority 300
context "math()"
snippet dint "integral" wA
\int_{${1}}^{${2}} ${3} $0
endsnippet
snippet lnot "logical not" iA
\neg$0
priority 200
context "math()"
snippet '(?<!\\)(arcsin|arccos|arctan|arccot|arccsc|arcsec|pi|zeta|int)' "ln" rwA
\\`!p snip.rv = match.group(1)`
endsnippet
snippet lxor "logical xor" iA
\veebar$0
priority 100
context "math()"
snippet -> "to" iA
\to
endsnippet
snippet sand "set and" i
\cap$0
priority 200
context "math()"
snippet <-> "leftrightarrow" iA
\leftrightarrow
endsnippet
snippet sor "set or" i
\cup$0
context "math()"
snippet !> "mapsto" iA
\mapsto
endsnippet
snippet snot "set not" i
\bar{$1}$0
context "math()"
snippet invs "inverse" iA
^{-1}
endsnippet
snippet cong "logical congruent" i
\cong $0
context "math()"
snippet compl "complement" iA
^{c}
endsnippet
snippet ncong "logical not congruent" i
\ncong $0
context "math()"
snippet set "set" wA
\\{$1\\} $0
endsnippet
snippet cap "set cap" i
\cap $0
context "math()"
snippet cc "subset" Ai
\subset
endsnippet
snippet cup "set cup" i
\cup $0
snippet notin "not in " iA
\not\in
endsnippet
# Boxes
snippet importcbox "import colored boxes"
\usepackage[most]{tcolorbox}
context "math()"
snippet inn "in " iA
\in
endsnippet
snippet boxr "red box" wA
\begin{tcolorbox}[colback=red!30!white,colframe=red!30!white, sharp corners]
$0
\end{tcolorbox}
snippet NN "n" iA
\N
endsnippet
snippet boxb "blue box" wA
\begin{tcolorbox}[colback=blue!30!white,colframe=blue!30!white, sharp corners]
$0
\end{tcolorbox}
snippet Nn "cap" iA
\cap
endsnippet
snippet boxg "green box" wA
\begin{tcolorbox}[colback=green!30!white,colframe=green!30!white, sharp corners]
$0
\end{tcolorbox}
snippet UU "cup" iA
\cup
endsnippet
snippet boxtr "red title box" wA
\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black,title=$1]
$0
\end{tcolorbox}
priority 10
context "math()"
snippet "bar" "bar" riA
\overline{$1}$0
endsnippet
snippet boxtb "blue title box" wA
\begin{tcolorbox}[colback=blue!5!white,colframe=blue!75!black,title=$1]
$0
\end{tcolorbox}
priority 100
context "math()"
snippet "([a-zA-Z])bar" "bar" riA
\overline{`!p snip.rv=match.group(1)`}
endsnippet
snippet boxtg "green title box" wA
\begin{tcolorbox}[colback=green!5!white, colframe=green!75!black,title=$1]
$0
\end{tcolorbox}
priority 10
context "math()"
snippet "hat" "hat" riA
\hat{$1}$0
endsnippet
snippet proposition "red box" w
\begin{tcolorbox}[colback=red!30!white,colframe=red!30!white, sharp corners]
\textbf{Proposition} \\\\
$0
\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}
priority 100
context "math()"
snippet "([a-zA-Z])hat" "hat" riA
\hat{`!p snip.rv=match.group(1)`}
endsnippet

View file

@ -35,5 +35,4 @@ require("plugins")
require("mappings")
require("treesitter")
require("completion")
require("snippets")
require("lsp")