Compare commits
11 Commits
cb059e5f58
...
2282e2ddfa
| Author | SHA1 | Date | |
|---|---|---|---|
| 2282e2ddfa | |||
| a49755c10f | |||
| 3c1dee3c19 | |||
| 2b9e4e94c0 | |||
| 29cc4418ee | |||
| a357ea695d | |||
| 0f9d539d11 | |||
| 2958e665fd | |||
| 2aab3f2174 | |||
| 11607d24a4 | |||
| 9670a56ed9 |
@@ -123,6 +123,8 @@ in {
|
|||||||
electrum
|
electrum
|
||||||
feather
|
feather
|
||||||
gnupg
|
gnupg
|
||||||
|
texpresso
|
||||||
|
python313Packages.pygments
|
||||||
# texlive.combined.scheme-full
|
# texlive.combined.scheme-full
|
||||||
|
|
||||||
# security
|
# security
|
||||||
|
|||||||
@@ -41,10 +41,11 @@
|
|||||||
vim-airline-themes
|
vim-airline-themes
|
||||||
plenary-nvim
|
plenary-nvim
|
||||||
nvim-web-devicons
|
nvim-web-devicons
|
||||||
{
|
texpresso-vim
|
||||||
plugin = smear-cursor-nvim;
|
# {
|
||||||
config = toLuaFile ./plugins/smear.lua;
|
# plugin = smear-cursor-nvim;
|
||||||
}
|
# config = toLuaFile ./plugins/smear.lua;
|
||||||
|
# }
|
||||||
# {
|
# {
|
||||||
# plugin = neovide;
|
# plugin = neovide;
|
||||||
# config = toLuaFile ./plugins/neovide.lua;
|
# config = toLuaFile ./plugins/neovide.lua;
|
||||||
@@ -86,6 +87,10 @@
|
|||||||
# plugin = vim-airline;
|
# plugin = vim-airline;
|
||||||
# config = toLuaFile ./plugins/airline.lua;
|
# config = toLuaFile ./plugins/airline.lua;
|
||||||
# }
|
# }
|
||||||
|
{
|
||||||
|
plugin = markdown-preview-nvim;
|
||||||
|
config = toLuaFile ./plugins/markdown-preview-nvim.lua;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
plugin = barbar-nvim;
|
plugin = barbar-nvim;
|
||||||
config = toLuaFile ./plugins/barbar.lua;
|
config = toLuaFile ./plugins/barbar.lua;
|
||||||
|
|||||||
@@ -165,6 +165,31 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
command = "setlocal wrap"
|
command = "setlocal wrap"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_augroup("vimrc", { clear = true })
|
||||||
|
|
||||||
|
-- vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
-- desc = "texpresso compile",
|
||||||
|
-- group = "vimrc",
|
||||||
|
-- pattern = "tex",
|
||||||
|
-- callback = function(args)
|
||||||
|
-- -- start server on first BufWrite
|
||||||
|
-- vim.api.nvim_create_autocmd("BufWritePost", {
|
||||||
|
-- group = vim.api.nvim_create_augroup(
|
||||||
|
-- string.format("latex<buffer=%d>", args.buf),
|
||||||
|
-- { clear = true }
|
||||||
|
-- ),
|
||||||
|
-- buffer = args.buf,
|
||||||
|
-- callback = function()
|
||||||
|
-- if not vim.b.latex_started then
|
||||||
|
-- vim.cmd "TeXpresso %"
|
||||||
|
-- vim.b.latex_started = true
|
||||||
|
-- end
|
||||||
|
-- -- vim.cmd "VimtexView"
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
|
||||||
-- idk why i need to define it here bro
|
-- idk why i need to define it here bro
|
||||||
-- local builtin = require('telescope.builtin')
|
-- local builtin = require('telescope.builtin')
|
||||||
-- vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
|
-- vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
|
||||||
|
|||||||
4
home/programs/nvim/plugins/markdown-preview-nvim.lua
Normal file
4
home/programs/nvim/plugins/markdown-preview-nvim.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-- browser
|
||||||
|
vim.g.mkdp_browser = "firefox"
|
||||||
|
-- keybindings
|
||||||
|
vim.keymap.set("n", "<leader>m", "<plug>MarkdownPreview")
|
||||||
@@ -2,9 +2,10 @@ require('smear_cursor').setup({
|
|||||||
scroll_buffer_space = false,
|
scroll_buffer_space = false,
|
||||||
smear_between_buffers = false,
|
smear_between_buffers = false,
|
||||||
smear_between_neighbor_lines = false,
|
smear_between_neighbor_lines = false,
|
||||||
|
scroll_buffer_space = false,
|
||||||
stiffness = 0.5,
|
stiffness = 0.5,
|
||||||
trailing_stiffness = 0.5,
|
trailing_stiffness = 0.5,
|
||||||
matrix_pixel_threshold = 0.5,
|
matrix_pixel_threshold = 0.5,
|
||||||
damping = 0.95,
|
damping = 0.9999, -- how "bouncy" the cursor is. 1 makes the cursor freeze in the top left lmao
|
||||||
smear_insert_mode = false,
|
smear_insert_mode = false,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ vim.g.vimtex_view_method = 'zathura'
|
|||||||
vim.g.vimtex_view_general_viewer = 'zathura'
|
vim.g.vimtex_view_general_viewer = 'zathura'
|
||||||
vim.g.vimtex_view_general_options = '--unique file:@pdf#src:@line@tex'
|
vim.g.vimtex_view_general_options = '--unique file:@pdf#src:@line@tex'
|
||||||
|
|
||||||
|
|
||||||
-- Set the TeX flavor and quickfix mode.
|
-- Set the TeX flavor and quickfix mode.
|
||||||
vim.g.tex_flavor = 'latex'
|
vim.g.tex_flavor = 'latex'
|
||||||
vim.g.vimtex_quickfix_mode = 0
|
-- vim.g.vimtex_quickfix_mode = 0
|
||||||
vim.g.vimtex_quickfix_enabled = 0
|
-- vim.g.vimtex_quickfix_enabled = 0
|
||||||
|
|
||||||
-- Compiler backend.
|
-- Compiler backend.
|
||||||
-- vim.g.vimtex_compiler_method = 'latexmk'
|
-- vim.g.vimtex_compiler_method = 'latexmk'
|
||||||
@@ -48,7 +47,7 @@ vim.g.maplocalleader = ','
|
|||||||
-- vim.g.Tex_IgnoreLevel = 8
|
-- vim.g.Tex_IgnoreLevel = 8
|
||||||
|
|
||||||
-- Delete extra compilation files when a TeX buffer is deleted.
|
-- Delete extra compilation files when a TeX buffer is deleted.
|
||||||
vim.api.nvim_create_autocmd("BufDelete", {
|
-- vim.api.nvim_create_autocmd("BufDelete", {
|
||||||
pattern = "*.tex",
|
-- pattern = "*.tex",
|
||||||
command = "silent! !latexmk -c > /dev/null 2>&1 %:p",
|
-- command = "silent! !latexmk -c > /dev/null 2>&1 %:p",
|
||||||
})
|
-- })
|
||||||
|
|||||||
@@ -171,6 +171,155 @@ ls.add_snippets("tex", {
|
|||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ls.add_snippets("tex", {
|
||||||
|
s("template-report", fmta([[
|
||||||
|
\documentclass[10pt]{article}
|
||||||
|
\usepackage{graphicx} % Required for inserting images
|
||||||
|
\usepackage[margin=1in]{geometry}
|
||||||
|
\usepackage[dvipsnames]{xcolor}
|
||||||
|
\usepackage{url}
|
||||||
|
\usepackage{amssymb}
|
||||||
|
\usepackage{amsmath}
|
||||||
|
\usepackage{amsthm}
|
||||||
|
\usepackage{fullpage}
|
||||||
|
\usepackage{listings}
|
||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage{parskip}
|
||||||
|
\usepackage{hyperref}
|
||||||
|
\usepackage{bookmark}
|
||||||
|
\usepackage[linguistics]{forest}
|
||||||
|
\usepackage{tikz}
|
||||||
|
\usepackage{float}
|
||||||
|
|
||||||
|
\usepackage[minted,skins]{tcolorbox} % 'skins' needed for shadows
|
||||||
|
|
||||||
|
% Define a new command \rustshadowfile that replaces \rustfile
|
||||||
|
\newtcbinputlisting{\rustshadowfile}[2][]{%
|
||||||
|
listing engine=minted,
|
||||||
|
minted language=rust,
|
||||||
|
minted options={linenos, numbersep=5pt, fontsize=\footnotesize, baselinestretch=1.05},
|
||||||
|
listing file={#2}, % The file to read
|
||||||
|
enhanced, % Enable skins for shadows
|
||||||
|
drop shadow, % Add the shadow
|
||||||
|
colback=white, % Background color
|
||||||
|
colframe=black!70, % Border color
|
||||||
|
boxrule=0.5pt, % Border width
|
||||||
|
arc=2pt, % Rounded corners (optional)
|
||||||
|
listing only, % Display code only (no title bar inside box)
|
||||||
|
#1 % Pass extra options like labels
|
||||||
|
}
|
||||||
|
|
||||||
|
\newtcblisting{rustcode}[1][]{
|
||||||
|
listing engine=minted,
|
||||||
|
minted language=rust,
|
||||||
|
minted options={linenos, numbersep=5pt, fontsize=\footnotesize, baselinestretch=1.05},
|
||||||
|
enhanced,
|
||||||
|
drop shadow, % Adds the shadow
|
||||||
|
colback=white, % Background color
|
||||||
|
colframe=black!70,% Border color
|
||||||
|
boxrule=0.5pt, % Border width
|
||||||
|
arc=2pt, % Rounded corners
|
||||||
|
listing only, % Hides the internal tcolorbox title bar
|
||||||
|
#1 % Allows passing extra options
|
||||||
|
}
|
||||||
|
|
||||||
|
% \usepackage{enumitem}
|
||||||
|
% \usepackage{euler}
|
||||||
|
% \usepackage{libertine}
|
||||||
|
|
||||||
|
\usepackage{import}
|
||||||
|
\usepackage{pdfpages}
|
||||||
|
\usepackage{transparent}
|
||||||
|
|
||||||
|
\newtheoremstyle{definitionstyle}
|
||||||
|
{}
|
||||||
|
{}
|
||||||
|
{\normalfont}
|
||||||
|
{}
|
||||||
|
{\bfseries}
|
||||||
|
{:}
|
||||||
|
{0.5em}
|
||||||
|
{}
|
||||||
|
|
||||||
|
\theoremstyle{definitionstyle}
|
||||||
|
\newtheorem{definition}{Definition}[section]
|
||||||
|
|
||||||
|
\newtheorem{all}{Theorem}[section]
|
||||||
|
\newtheorem{corollary}[all]{Corollary}
|
||||||
|
\newtheorem{lemma}[all]{Lemma}
|
||||||
|
\newtheorem{exercise}[all]{Exercise}
|
||||||
|
\newtheorem{proposition}[all]{Proposition}
|
||||||
|
\newtheorem{example}[all]{Example}
|
||||||
|
\newtheorem{theorem}{Theorem}
|
||||||
|
|
||||||
|
\newcommand{\namedcomment}[3]{{\sf \scriptsize \color{#2} #1: #3}}
|
||||||
|
\newcommand{\jake}[1]{\namedcomment{jake}{red}{#1}}
|
||||||
|
\title{<>}
|
||||||
|
\author{Jake Ginesin \and <>}
|
||||||
|
\date{December 5th, 1999}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\maketitle
|
||||||
|
|
||||||
|
\end{document}
|
||||||
|
]], {i(1), i(0)}, {
|
||||||
|
indent_string = ""
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
ls.add_snippets("tex", {
|
||||||
|
s("beamer", fmta([[
|
||||||
|
\documentclass{beamer}
|
||||||
|
\usetheme{metropolis} % Use metropolis theme
|
||||||
|
\title{<>}
|
||||||
|
\date{\today}
|
||||||
|
\author{Jacob Ginesin}
|
||||||
|
\institute{<>}
|
||||||
|
\begin{document}
|
||||||
|
\maketitle
|
||||||
|
\section{First Section}
|
||||||
|
\begin{frame}{First Frame}
|
||||||
|
Hello, world!
|
||||||
|
\end{frame}
|
||||||
|
\end{document}
|
||||||
|
|
||||||
|
]], {i(1), i(0)}, {
|
||||||
|
indent_string = ""
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
|
ls.add_snippets("tex", {
|
||||||
|
s("beamer", fmta([[
|
||||||
|
\documentclass{beamer}
|
||||||
|
\usetheme{metropolis} % Use metropolis theme
|
||||||
|
\title{<>}
|
||||||
|
\date{\today}
|
||||||
|
\author{Jacob Ginesin}
|
||||||
|
\institute{<>}
|
||||||
|
\begin{document}
|
||||||
|
\maketitle
|
||||||
|
\section{First Section}
|
||||||
|
\begin{frame}{First Frame}
|
||||||
|
Hello, world!
|
||||||
|
\end{frame}
|
||||||
|
\end{document}
|
||||||
|
|
||||||
|
]], {i(1), i(0)}, {
|
||||||
|
indent_string = ""
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
|
ls.add_snippets("tex", {
|
||||||
|
s("bib", fmta([[
|
||||||
|
\bibliographystyle{plain}
|
||||||
|
\bibliography{<>}
|
||||||
|
]], {i(0)}, {
|
||||||
|
indent_string = ""
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
-- ----
|
-- ----
|
||||||
|
|
||||||
|
|
||||||
@@ -461,6 +610,19 @@ ls.add_snippets("tex", {
|
|||||||
{condition = in_mathzone}
|
{condition = in_mathzone}
|
||||||
),
|
),
|
||||||
|
|
||||||
|
s({trig = "rustcode"},
|
||||||
|
fmta(
|
||||||
|
[[
|
||||||
|
\begin{listing}[H]
|
||||||
|
\begin{rustcode}
|
||||||
|
<>
|
||||||
|
\end{rustcode}
|
||||||
|
\end{listing}
|
||||||
|
]],
|
||||||
|
{ i(1) }
|
||||||
|
)
|
||||||
|
),
|
||||||
|
|
||||||
s({
|
s({
|
||||||
trig = "notin",
|
trig = "notin",
|
||||||
snippetType="autosnippet",
|
snippetType="autosnippet",
|
||||||
|
|||||||
31
home/scripts/tex/safe-tex.sh
Normal file
31
home/scripts/tex/safe-tex.sh
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# designed to compile tex with isolation, in the case something like minted is used
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [[ $# -lt 1 ]]; then
|
||||||
|
echo "Usage: $0 <texfile> [tectonic args...]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
TEXFILE="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
mkdir -p ~/.cache/Tectonic
|
||||||
|
|
||||||
|
nix-shell -p bubblewrap tectonic cacert python313Packages.pygments which --run "
|
||||||
|
bwrap --ro-bind /nix /nix \
|
||||||
|
--bind \$(pwd) /workspace \
|
||||||
|
--bind ~/.cache/Tectonic ~/.cache/Tectonic \
|
||||||
|
--chdir /workspace \
|
||||||
|
--dev /dev \
|
||||||
|
--proc /proc \
|
||||||
|
--tmpfs /tmp \
|
||||||
|
--symlink \$(which bash) /bin/sh \
|
||||||
|
--ro-bind /etc/resolv.conf /etc/resolv.conf \
|
||||||
|
--ro-bind /etc/hosts /etc/hosts \
|
||||||
|
--ro-bind /etc/nsswitch.conf /etc/nsswitch.conf \
|
||||||
|
--setenv SSL_CERT_FILE \"\$SSL_CERT_FILE\" \
|
||||||
|
--setenv TMPDIR /tmp \
|
||||||
|
--setenv PATH \"\$PATH\" \
|
||||||
|
tectonic -Z shell-escape '$TEXFILE' --keep-intermediates $*
|
||||||
|
"
|
||||||
Reference in New Issue
Block a user