diff --git a/nvim/lua/lsp.lua b/nvim/lua/lsp.lua index 8076a8e..9a6e613 100644 --- a/nvim/lua/lsp.lua +++ b/nvim/lua/lsp.lua @@ -99,6 +99,16 @@ local lsp_confs = { configfiles = { "tsconfig.json", "jsconfig.json", "package.json" } }), }, + denols = { + root_dir = find_repo_root({ + configfiles = { "deno.json", "deno.jsonc" } + }), + }, + astro = { + root_dir = find_repo_root({ + configfiles = { "astro.config.mjs" } + }), + }, eslint = { root_dir = find_repo_root({ configfiles = { ".eslintrc", ".eslintrc.js", "package.json" } diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index ed286ab..3bcd27c 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -31,6 +31,10 @@ return require('packer').startup({ function(use) 'evanleck/vim-svelte' } + use { + 'wuelnerdotexe/vim-astro' + } + use { 'tpope/vim-fugitive', config = function() @@ -169,6 +173,7 @@ return require('packer').startup({ function(use) 'lervag/vimtex', config = function() vim.g.vimtex_view_general_viewer = 'zathura' + vim.g.vimtex_compiler_method = "xelatex" -- vim.g.vimtex_view_general_options = = '-x nvim -n -c "Vimtex' -- 'file:@pdf\\#src:@line@tex' -- vim.g.vimtex_quickfix_enabled = 0 diff --git a/nvim/ultisnips/tex.snippets b/nvim/ultisnips/tex.snippets index 1c0346c..03d05fc 100644 --- a/nvim/ultisnips/tex.snippets +++ b/nvim/ultisnips/tex.snippets @@ -10,44 +10,14 @@ def env(name): return x != '0' and y != '0' endglobal -snippet beg "begin{} / end{}" bA +# General + +snippet beg "Begin / End" bA \\begin{$1} $2 \\end{$1}$0 endsnippet - -snippet sm "Math" wA -$${1}$`!p -if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: - snip.rv = ' ' -else: - snip.rv = '' -`$2 -endsnippet - -snippet dm "Display Math" wA - -\[ - $1 -.\] $0 -endsnippet - -snippet sc "Code" wA -\texttt{${1}}`!p -if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: - snip.rv = ' ' -else: - snip.rv = '' -`$2 -endsnippet - -snippet dc "Display Code" wA -\begin{lstlisting}[$1] -$2 -\end{lstlisting} $0 -endsnippet - snippet pac "Package" b \usepackage[$1]{$2}$0 endsnippet @@ -97,7 +67,628 @@ snippet table "Table" b \end{table} $0 endsnippet +priority 100 +snippet ... "Ldots" iA +\ldots +endsnippet +snippet ~~ "Sim" iA +\sim +endsnippet + +# Math + +snippet sm "Math" wA +$${1}$`!p +if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: + snip.rv = ' ' +else: + snip.rv = '' +`$2 +endsnippet + +snippet dm "Display Math" wA + +\[ + $1 +\] $0 +endsnippet + +snippet ali "Align" bA +\begin{align*} + ${1:${VISUAL}} +\end{align*} $0 +endsnippet + +context "math()" +snippet => "Implies" Ai +\implies +endsnippet + +context "math()" +snippet =< "Implied by" Ai +\impliedby +endsnippet + +context "math()" +snippet iff "Iff" Ai +\iff +endsnippet + +context "math()" +snippet bm "Bm" Ai +\bm{$1}$0 +endsnippet + +context "math()" +snippet sqrt "Square root" Ai +\sqrt{$1}$0 +endsnippet + +context "math()" +snippet box "Boxed" Ai +\boxed{$1}$0 +endsnippet + +context "math()" +snippet lll "L" iA +\ell +endsnippet + +context "math()" +snippet xx "Cross" iA +\times +endsnippet + +priority 100 +context "math()" +snippet ** "Cdot" iA +\cdot +endsnippet + +context "math()" +snippet norm "Norm" iA +\|$1\|$0 +endsnippet + +context "math()" +snippet nabl "Nabla" iA +\nabla +endsnippet + +context "math()" +snippet del "Nabla" iA +\nabla +endsnippet + +context "math()" +snippet \\\ "Set minus" iA +\setminus +endsnippet + +context "math()" +snippet mcal "mathcal" iA +\mathcal{$1}$0 +endsnippet + +priority 100 +context "math()" +snippet -> "To" iA +\to +endsnippet + +priority 200 +context "math()" +snippet <-> "Leftrightarrow" iA +\leftrightarrow +endsnippet + +context "math()" +snippet !> "Maps to" iA +\mapsto +endsnippet + +context "math()" +snippet set "Set" wA +\left\\{ $1 \right\\} $0 +endsnippet + +context "math()" +snippet || "Mid" iA +\mid +endsnippet + +context "math()" +snippet cc "Subset" iA +\subset +endsnippet + +context "math()" +snippet notin "Not in" iA +\not\in +endsnippet + +priority 10 +context "math()" +snippet in "In" iA +\in +endsnippet + +context "math()" +snippet NN "Natural" iA +\N +endsnippet + +context "math()" +snippet Nn "Cap" iA +\cap +endsnippet + +context "math()" +snippet isect "Cap" iA +\cap +endsnippet + +context "math()" +snippet UU "Cup" iA +\cup +endsnippet + +context "math()" +snippet union "Cup" iA +\cup +endsnippet + +context "math()" +snippet uuu "Big cup" iA +\bigcup{${1:i \in ${2: I}}} $0 +endsnippet + +context "math()" +snippet nnn "Big cap" iA +\bigcap{${1:i \in ${2: I}}} $0 +endsnippet + +context "math()" +snippet OO "Empty Set" iA +\varnothing +endsnippet + +context "math()" +snippet RR "Real" iA +\R +endsnippet + +context "math()" +snippet QQ "Rational" iA +\Q +endsnippet + +context "math()" +snippet ZZ "Integer" iA +\Z +endsnippet + +context "math()" +snippet HH "H" iA +\mathbb{H} +endsnippet + +context "math()" +snippet DD "D" iA +\mathbb{D} +endsnippet + +context "math()" +snippet "Diamond" iA +\diamond +endsnippet + +context "math()" +snippet '(?$0 +endsnippet + +context "math()" +snippet conj "Conjugate" iA +\overline{$1}$0 +endsnippet + +context "math()" +snippet sr "Square" iA +^2 +endsnippet + +context "math()" +snippet cb "Cube" iA +^3 +endsnippet + +context "math()" +snippet invs "Inverse" iA +^{-1} +endsnippet + +context "math()" +snippet compl "Complement" iA +^{c} +endsnippet + +context "math()" +snippet tp "To the power" iA +^{$1}$0 +endsnippet + +context "math()" +snippet bp "Paren to the power" iA +^{($1)}$0 +endsnippet + +context "math()" +snippet sum "Bounded Sum" w +\sum_{${1:n=${2:1}}}^{${3:\infty}} $3 +endsnippet + +context "math()" +snippet prod "Product" w +\prod{${1:n=${2:1}}}^{${3:\infty}} $4 +endsnippet + +context "math()" +snippet ssum "Sum Symbol" w +\sum $1 +endsnippet + +context "math()" +snippet lim "Limit" w +\lim_{${1:n} \to ${2:\infty}} $0 +endsnippet + +context "math()" +snippet ooo "Infinity" iA +\infty +endsnippet + +context "math()" +snippet limsup "Limit Supremum" w +\limsup_{${1:n} \to ${2:\infty}} $0 +endsnippet + +context "math()" +snippet part "Partial Derivative" w +\pdv[$1]{${2:v}}{${3:x}} $0 +endsnippet + +priority 300 +context "math()" +snippet int "Definite Integral" w +\int_{${1:-\infty}}^{${2:\infty}} $3 +endsnippet + +priority 300 +context "math()" +snippet iint "Indefinite Integral" w +\int $1 +endsnippet + +context "math()" +snippet <= "Less than or equal" iA +\le +endsnippet + +context "math()" +snippet >= "Greater than or equal" iA +\ge +endsnippet + +context "math()" +snippet >> "Greater greater" iA +\gg +endsnippet + +context "math()" +snippet << "Less less" iA +\ll +endsnippet + +context "math()" +snippet EE "There exists" iA +\exists +endsnippet + +context "math()" +snippet AA "For all" iA +\forall +endsnippet + +snippet plot "Plot" w +\begin{figure}[$1] + \centering + \begin{tikzpicture} + \begin{axis}[ + xmin= ${2:-10}, xmax= ${3:10}, + ymin= ${4:-10}, ymax = ${5:10}, + axis lines = middle, + ] + \addplot[domain=$2:$3, samples=${6:100}]{$7}; + \end{axis} + \end{tikzpicture} + \caption{$8} + \label{${9:$8}} +\end{figure} $0 +endsnippet + +snippet nn "Tikz node" w +\node[$5] (${1/[^0-9a-zA-Z]//g}${2}) ${3:at (${4:0,0}) }{$${1}$}; +$0 +endsnippet + +snippet problem "Problem" iA +\pbl{$1} + $0 +endsnippet + +# English snippet ltable "Long table" b \begin{longtable}{${1:|p{5cm}|p{10cm}|}} @@ -107,8 +698,28 @@ snippet ltable "Long table" b \end{longtable} $0 endsnippet -snippet --- "hline" iA +snippet --- "Hline" iA \hline endsnippet +# Code + +snippet sc "Code" wA +\texttt{${1}}`!p +if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: + snip.rv = ' ' +else: + snip.rv = '' +`$2 +endsnippet + +snippet dc "Display Code" wA +\begin{minted}[$1] +$2 +\end{minted} $0 +endsnippet + +snippet impc "Import Code" wA +\inputminted{$1}{$2}$0 +endsnippet diff --git a/tex/mathhw.cls b/tex/homework.cls similarity index 50% rename from tex/mathhw.cls rename to tex/homework.cls index 5d9fb0d..7290019 100644 --- a/tex/mathhw.cls +++ b/tex/homework.cls @@ -1,11 +1,27 @@ -\ProvidesClass{mathhw} +\ProvidesClass{homework} \LoadClass[fontsize=9pt, paper=a4, pagesize, DIV=calc]{scrartcl} \RequirePackage[utf8]{inputenc} +\RequirePackage[T1]{fontenc} +\RequirePackage{textcomp} +\RequirePackage{url} +\RequirePackage{float} +\RequirePackage{booktabs} +\RequirePackage{emptypage} +\RequirePackage{subcaption} +\RequirePackage{multicol} +\RequirePackage{cancel} +\RequirePackage{mathrsfs} +\RequirePackage{minted} +\RequirePackage{systeme} +\RequirePackage{stmaryrd} \RequirePackage{amsfonts, amsmath, amssymb, amsthm} \RequirePackage{enumitem} +\RequirePackage{bm} +\RequirePackage{listings} \RequirePackage{geometry} \RequirePackage{graphicx} +\RequirePackage[usenames,dvipsnames]{xcolor} \RequirePackage{physics} \RequirePackage{bm} \RequirePackage{pgfplots} @@ -20,8 +36,11 @@ \let\sidelim\lim \renewcommand\sum{\sidesum\limits} \renewcommand\lim{\sidelim\limits} -\newcommand{\sm}{\sum} \newcommand{\problem}[1]{\subsection*{#1.}} \newcommand{\pbl}[1]{\subsection*{#1.}} +\newcommand{\N}{\ensuremath{\mathbb{N}}} +\newcommand{\Z}{\ensuremath{\mathbb{Z}}} +\newcommand{\R}{\ensuremath{\mathbb{R}}} +\newcommand{\Q}{\ensuremath{\mathbb{Q}}} \geometry{top=20mm,bottom=20mm}