updates
This commit is contained in:
parent
63bbeaca3b
commit
ce01469113
37 changed files with 1621 additions and 384 deletions
|
|
@ -6,6 +6,7 @@
|
|||
}: {
|
||||
# Enable sound with pipewire.
|
||||
hardware.pulseaudio.enable = false;
|
||||
hardware.alsa.enablePersistence = true;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -12,19 +12,19 @@
|
|||
networking.wireless.enable = true;
|
||||
environment.systemPackages = with pkgs; [wpa_supplicant_gui];
|
||||
networking.wireless.userControlled.enable = true;
|
||||
networking.wireless.environmentFile = config.sops.secrets."wireless.env".path;
|
||||
networking.wireless.secretsFile = config.sops.secrets."wireless.env".path;
|
||||
networking.wireless.networks = {
|
||||
"@home_uuid@" = {
|
||||
psk = "@home_psk@";
|
||||
"Tycho Station" = {
|
||||
pskRaw = "ext:home_psk";
|
||||
priority = 99;
|
||||
};
|
||||
"@school_uuid@" = {
|
||||
"CU-Wireless" = {
|
||||
auth = ''
|
||||
key_mgmt=WPA-EAP
|
||||
eap=PEAP
|
||||
phase2="auth=MSCHAPV2"
|
||||
identity="@school_identity@"
|
||||
password="@school_password@"
|
||||
identity="glengoodwin"
|
||||
password=ext:school_password
|
||||
'';
|
||||
priority = 89;
|
||||
};
|
||||
|
|
@ -34,8 +34,8 @@
|
|||
key_mgmt=WPA-EAP
|
||||
eap=PEAP
|
||||
phase2="auth=MSCHAPV2"
|
||||
identity="@eduroam_identity@"
|
||||
password="@school_password@"
|
||||
identity="ext:eduroam_identity"
|
||||
password="ext:school_password"
|
||||
'';
|
||||
priority = 79;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
stylix = {
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml";
|
||||
# base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml";
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml";
|
||||
# image = ./wallpaper.jpg;
|
||||
image = ../../wallpapers/nix-black-4k.png;
|
||||
image = ../../wallpapers/nixos-wallpaper-catppuccin-latte.png;
|
||||
#polarity = "dark";
|
||||
autoEnable = true;
|
||||
enable = true;
|
||||
|
|
|
|||
792
flake.lock
generated
792
flake.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -65,8 +65,8 @@
|
|||
};
|
||||
|
||||
stylix = {
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml";
|
||||
image = ../../wallpapers/nix-black-4k.png;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml";
|
||||
image = ../../wallpapers/nixos-wallpaper-catppuccin-latte.png;
|
||||
autoEnable = true;
|
||||
enable = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -65,8 +65,9 @@
|
|||
};
|
||||
|
||||
stylix = {
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml";
|
||||
image = ../../wallpapers/nix-black-4k.png;
|
||||
# base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml";
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml";
|
||||
image = ../../wallpapers/nixos-wallpaper-catppuccin-latte.png;
|
||||
# polarity = "dark";
|
||||
autoEnable = true;
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -20,9 +20,12 @@
|
|||
#sublime-music # A modern and feature-rich music player with a clean user interface and advanced playback options.
|
||||
thunderbird # Mozilla Thunderbird, a powerful and customizable email client with integrated calendaring and chat features.
|
||||
wireshark # Open-source network protocol analyzer for real-time packet inspection and analysis.
|
||||
inkscape
|
||||
nicotine-plus
|
||||
anki
|
||||
obsidian
|
||||
chromium
|
||||
vlc
|
||||
zotero
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,16 @@
|
|||
];
|
||||
command = "setlocal spell spelllang=en_us";
|
||||
}
|
||||
|
||||
{
|
||||
event = "FileType";
|
||||
pattern = [
|
||||
"tex"
|
||||
"latex"
|
||||
"markdown"
|
||||
];
|
||||
command = "setlocal wrap";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
plugins.bufferline = let
|
||||
mouse = {
|
||||
right =
|
||||
# lua
|
||||
# Lua
|
||||
"'vertical sbuffer %d'";
|
||||
close =
|
||||
# lua
|
||||
# Lua
|
||||
''
|
||||
function(bufnum)
|
||||
require("mini.bufremove").delete(bufnum)
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
close_icon = "";
|
||||
diagnostics = "nvim_lsp";
|
||||
diagnostics_indicator =
|
||||
# lua
|
||||
# Lua
|
||||
''
|
||||
function(count, level, diagnostics_dict, context)
|
||||
local s = ""
|
||||
|
|
@ -57,9 +57,7 @@
|
|||
};
|
||||
priority = 2;
|
||||
# icon = "";
|
||||
matcher.__raw =
|
||||
# lua
|
||||
''
|
||||
matcher.__raw = ''
|
||||
function(buf)
|
||||
return buf.name:match('%test') or buf.name:match('%.spec')
|
||||
end
|
||||
|
|
@ -73,9 +71,7 @@
|
|||
sp = "#494d64";
|
||||
};
|
||||
auto_close = false;
|
||||
matcher.__raw =
|
||||
# lua
|
||||
''
|
||||
matcher.__raw = ''
|
||||
function(buf)
|
||||
return buf.name:match('%.md') or buf.name:match('%.txt')
|
||||
end
|
||||
|
|
@ -94,9 +90,7 @@
|
|||
max_prefix_length = 15;
|
||||
modified_icon = "●";
|
||||
|
||||
numbers.__raw =
|
||||
# lua
|
||||
''
|
||||
numbers.__raw = ''
|
||||
function(opts)
|
||||
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
|
||||
end
|
||||
|
|
@ -122,61 +116,6 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
|
||||
# NOTE: fixes colorscheme with transparent_background
|
||||
# and better contrast selected tabs
|
||||
highlights = let
|
||||
commonBgColor = "#363a4f";
|
||||
commonFgColor = "#1e2030";
|
||||
|
||||
commonSelectedAttrs = {
|
||||
bg = commonBgColor;
|
||||
};
|
||||
|
||||
# Define a set with common selected attributes
|
||||
selectedAttrsSet = builtins.listToAttrs (
|
||||
map
|
||||
(name: {
|
||||
inherit name;
|
||||
value = commonSelectedAttrs;
|
||||
})
|
||||
[
|
||||
# "separator_selected" # Handled uniquely
|
||||
"buffer_selected"
|
||||
"tab_selected"
|
||||
"numbers_selected"
|
||||
"close_button_selected"
|
||||
"duplicate_selected"
|
||||
"modified_selected"
|
||||
"info_selected"
|
||||
"warning_selected"
|
||||
"error_selected"
|
||||
"hint_selected"
|
||||
"diagnostic_selected"
|
||||
"info_diagnostic_selected"
|
||||
"warning_diagnostic_selected"
|
||||
"error_diagnostic_selected"
|
||||
"hint_diagnostic_selected"
|
||||
]
|
||||
);
|
||||
in
|
||||
# Merge the common selected attributes with the unique attributes
|
||||
selectedAttrsSet
|
||||
// {
|
||||
fill = {
|
||||
bg = commonFgColor;
|
||||
};
|
||||
separator = {
|
||||
fg = commonFgColor;
|
||||
};
|
||||
separator_visible = {
|
||||
fg = commonFgColor;
|
||||
};
|
||||
separator_selected = {
|
||||
bg = commonBgColor;
|
||||
fg = commonFgColor;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -184,46 +123,41 @@
|
|||
{
|
||||
mode = "n";
|
||||
key = "<leader>bP";
|
||||
action = ":BufferLineTogglePin<cr>";
|
||||
action = "<cmd>BufferLineTogglePin<cr>";
|
||||
options = {
|
||||
desc = "Pin buffer toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bp";
|
||||
action = ":BufferLinePick<cr>";
|
||||
action = "<cmd>BufferLinePick<cr>";
|
||||
options = {
|
||||
desc = "Pick Buffer";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bsd";
|
||||
action = ":BufferLineSortByDirectory<cr>";
|
||||
action = "<cmd>BufferLineSortByDirectory<cr>";
|
||||
options = {
|
||||
desc = "Sort By Directory";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bse";
|
||||
action = ":BufferLineSortByExtension<cr>";
|
||||
action = "<cmd>BufferLineSortByExtension<cr>";
|
||||
options = {
|
||||
desc = "Sort By Extension";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bsr";
|
||||
action = ":BufferLineSortByRelativeDirectory<cr>";
|
||||
action = "<cmd>BufferLineSortByRelativeDirectory<cr>";
|
||||
options = {
|
||||
desc = "Sort By Relative Directory";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ _: {
|
|||
percentage = 0.25;
|
||||
};
|
||||
|
||||
flavour = "macchiato";
|
||||
# flavour = "macchiato";
|
||||
flavour = "latte";
|
||||
|
||||
integrations = {
|
||||
aerial = true;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@
|
|||
plugins = {
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
|
||||
formatOnSave =
|
||||
settings = {
|
||||
format_on_save =
|
||||
# lua
|
||||
''
|
||||
function(bufnr)
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
end
|
||||
'';
|
||||
|
||||
formatAfterSave =
|
||||
format_after_save =
|
||||
# lua
|
||||
''
|
||||
function(bufnr)
|
||||
|
|
@ -81,6 +81,7 @@
|
|||
return { lsp_fallback = true }
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
# NOTE:
|
||||
# Conform will run multiple formatters sequentially
|
||||
|
|
|
|||
|
|
@ -14,16 +14,22 @@ _: {
|
|||
./git-conflict.nix
|
||||
./gitsigns.nix
|
||||
./harpoon.nix
|
||||
# ./haskell-scope-highlighting.nix
|
||||
./illuminate.nix
|
||||
# ./obsidian.nix
|
||||
./indent-blankline.nix
|
||||
./lightbulb.nix
|
||||
./lualine.nix
|
||||
./luasnip.nix
|
||||
./lean.nix
|
||||
./lsp.nix
|
||||
./marks.nix
|
||||
./mark-radar.nix
|
||||
./mini.nix
|
||||
./mini-bufremove.nix
|
||||
./mini-surround.nix
|
||||
./mini-indentscope.nix
|
||||
./glow.nix
|
||||
./navic.nix
|
||||
./nix.nix
|
||||
./noice.nix
|
||||
|
|
@ -31,6 +37,7 @@ _: {
|
|||
./precognition.nix
|
||||
./spectre.nix
|
||||
./refactoring.nix
|
||||
./render-markdown.nix
|
||||
./telescope.nix
|
||||
./todo-comments.nix
|
||||
./toggleterm.nix
|
||||
|
|
|
|||
41
home-manager/modules/neovim/plugins/glow.nix
Normal file
41
home-manager/modules/neovim/plugins/glow.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{pkgs, ...}: let
|
||||
stylePkg = pkgs.fetchFromGitHub {
|
||||
owner = "catppuccin";
|
||||
repo = "glamour";
|
||||
rev = "f410083af1e9b2418bcd73dbbbc987461d4aa292";
|
||||
hash = "sha256-a7yR19KcxIS4UPhuhB+X0B+s8D5eytw0/EB0X4z46kA=";
|
||||
};
|
||||
in {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
glow = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
border = "single";
|
||||
style = "${stylePkg.outPath}/themes/catppuccin-latte.json";
|
||||
};
|
||||
};
|
||||
|
||||
which-key.settings.spec = [
|
||||
{
|
||||
__unkeyed = "<leader>p";
|
||||
mode = "n";
|
||||
group = "Preview";
|
||||
icon = " ";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>pg";
|
||||
action = "<cmd>Glow<CR>";
|
||||
options = {
|
||||
desc = "Glow (Markdown)";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.haskell-scope-highlighting = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
fromLua = [{paths = [../snippets];}];
|
||||
};
|
||||
extraFiles = {
|
||||
"personal/luasnip-helper-funcs.lua".text = ''
|
||||
"lua/personal/luasnip-helper-funcs.lua".text = ''
|
||||
local M = {}
|
||||
|
||||
local ls = require("luasnip")
|
||||
|
|
|
|||
7
home-manager/modules/neovim/plugins/mark-radar.nix
Normal file
7
home-manager/modules/neovim/plugins/mark-radar.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.mark-radar = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/marks.nix
Normal file
7
home-manager/modules/neovim/plugins/marks.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.marks = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
18
home-manager/modules/neovim/plugins/mini.nix
Normal file
18
home-manager/modules/neovim/plugins/mini.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.mini = {
|
||||
enable = true;
|
||||
mockDevIcons = true;
|
||||
|
||||
modules = {
|
||||
ai = {};
|
||||
align = {};
|
||||
basics = {};
|
||||
bracketed = {};
|
||||
git = {};
|
||||
icons = {};
|
||||
pairs = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home-manager/modules/neovim/plugins/obsidian.nix
Normal file
7
home-manager/modules/neovim/plugins/obsidian.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.obsidian = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>uP";
|
||||
key = "<leader>vp";
|
||||
action.__raw = ''
|
||||
function()
|
||||
if require("precognition").toggle() then
|
||||
|
|
|
|||
9
home-manager/modules/neovim/plugins/render-markdown.nix
Normal file
9
home-manager/modules/neovim/plugins/render-markdown.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
programs.nixvim = {
|
||||
plugins.render-markdown = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [python312Packages.pylatexenc];
|
||||
}
|
||||
|
|
@ -7,7 +7,12 @@
|
|||
|
||||
settings = {
|
||||
indent.enable = true;
|
||||
highlight.enable = true;
|
||||
highlight = {
|
||||
enable = true;
|
||||
disable = [
|
||||
"latex"
|
||||
];
|
||||
};
|
||||
incremental_selection.enable = true;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
plugins.vimtex = {
|
||||
enable = true;
|
||||
settings = {
|
||||
compiler_method = "latexrun";
|
||||
compiler_method = "pdflatex";
|
||||
toc_config = {
|
||||
split_pos = "vert topleft";
|
||||
split_width = 40;
|
||||
|
|
|
|||
92
home-manager/modules/neovim/snippets/tex/delimiter.lua
Normal file
92
home-manager/modules/neovim/snippets/tex/delimiter.lua
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
local helpers = require("personal.luasnip-helper-funcs")
|
||||
local get_visual = helpers.get_visual
|
||||
|
||||
-- Math context detection
|
||||
local tex = {}
|
||||
tex.in_mathzone = function()
|
||||
return vim.fn["vimtex#syntax#in_mathzone"]() == 1
|
||||
end
|
||||
tex.in_text = function()
|
||||
return not tex.in_mathzone()
|
||||
end
|
||||
|
||||
-- Return snippet tables
|
||||
return {
|
||||
-- LEFT/RIGHT PARENTHESES
|
||||
s(
|
||||
{ trig = "([^%a])l%(", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\left(<>\\right)", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- LEFT/RIGHT SQUARE BRACES
|
||||
s(
|
||||
{ trig = "([^%a])l%[", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\left[<>\\right]", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- LEFT/RIGHT CURLY BRACES
|
||||
s(
|
||||
{ trig = "([^%a])l%{", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\left\\{<>\\right\\}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- BIG PARENTHESES
|
||||
s(
|
||||
{ trig = "([^%a])b%(", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\big(<>\\big)", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- BIG SQUARE BRACES
|
||||
s(
|
||||
{ trig = "([^%a])b%[", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\big[<>\\big]", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- BIG CURLY BRACES
|
||||
s(
|
||||
{ trig = "([^%a])b%{", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\big\\{<>\\big\\}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- ESCAPED CURLY BRACES
|
||||
s(
|
||||
{ trig = "([^%a])\\%{", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 },
|
||||
fmta("<>\\{<>\\}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- LATEX QUOTATION MARK
|
||||
s(
|
||||
{ trig = "``", snippetType = "autosnippet" },
|
||||
fmta("``<>''", {
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
}
|
||||
221
home-manager/modules/neovim/snippets/tex/environments.lua
Normal file
221
home-manager/modules/neovim/snippets/tex/environments.lua
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
local helpers = require("personal.luasnip-helper-funcs")
|
||||
local get_visual = helpers.get_visual
|
||||
|
||||
-- Math context detection
|
||||
local tex = {}
|
||||
tex.in_mathzone = function()
|
||||
return vim.fn["vimtex#syntax#in_mathzone"]() == 1
|
||||
end
|
||||
tex.in_text = function()
|
||||
return not tex.in_mathzone()
|
||||
end
|
||||
|
||||
local line_begin = require("luasnip.extras.expand_conditions").line_begin
|
||||
|
||||
-- Return snippet tables
|
||||
return {
|
||||
-- GENERIC ENVIRONMENT
|
||||
s(
|
||||
{ trig = "new", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{<>}
|
||||
<>
|
||||
\end{<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
d(2, get_visual),
|
||||
rep(1),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "def", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{definition}[<>]
|
||||
<>
|
||||
\end{definition}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
d(2, get_visual),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- ENVIRONMENT WITH ONE EXTRA ARGUMENT
|
||||
s(
|
||||
{ trig = "n2", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{<>}{<>}
|
||||
<>
|
||||
\end{<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
d(3, get_visual),
|
||||
rep(1),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- ENVIRONMENT WITH TWO EXTRA ARGUMENTS
|
||||
s(
|
||||
{ trig = "n3", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{<>}{<>}{<>}
|
||||
<>
|
||||
\end{<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
i(3),
|
||||
d(4, get_visual),
|
||||
rep(1),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- TOPIC ENVIRONMENT (my custom tcbtheorem environment)
|
||||
s(
|
||||
{ trig = "nt", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{topic}{<>}{<>}
|
||||
<>
|
||||
\end{topic}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
d(3, get_visual),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- EQUATION
|
||||
s(
|
||||
{ trig = "nn", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{equation*}
|
||||
<>
|
||||
\end{equation*}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- SPLIT EQUATION
|
||||
s(
|
||||
{ trig = "ss", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{equation*}
|
||||
\begin{split}
|
||||
<>
|
||||
\end{split}
|
||||
\end{equation*}
|
||||
]],
|
||||
{
|
||||
d(1, get_visual),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- ALIGN
|
||||
s(
|
||||
{ trig = "all", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{align*}
|
||||
<>
|
||||
\end{align*}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- ITEMIZE
|
||||
s(
|
||||
{ trig = "itt", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{itemize}
|
||||
|
||||
\item <>
|
||||
|
||||
\end{itemize}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- ENUMERATE
|
||||
s(
|
||||
{ trig = "enn", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{enumerate}
|
||||
|
||||
\item <>
|
||||
|
||||
\end{enumerate}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
)
|
||||
),
|
||||
-- INLINE MATH
|
||||
s(
|
||||
{ trig = "([^%l])mm", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>$<>$", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- INLINE MATH ON NEW LINE
|
||||
s(
|
||||
{ trig = "^mm", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("$<>$", {
|
||||
i(1),
|
||||
})
|
||||
),
|
||||
-- FIGURE
|
||||
s(
|
||||
{ trig = "fig" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}[htb!]
|
||||
\centering
|
||||
\includegraphics[width=<>\linewidth]{<>}
|
||||
\caption{<>}
|
||||
\label{fig:<>}
|
||||
\end{figure}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
i(3),
|
||||
i(4),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
}
|
||||
106
home-manager/modules/neovim/snippets/tex/fonts.lua
Normal file
106
home-manager/modules/neovim/snippets/tex/fonts.lua
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
local helpers = require("personal.luasnip-helper-funcs")
|
||||
local get_visual = helpers.get_visual
|
||||
|
||||
-- A logical OR of `line_begin` and the regTrig '[^%a]trig'
|
||||
function line_begin_or_non_letter(line_to_cursor, matched_trigger)
|
||||
local line_begin = line_to_cursor:sub(1, -(#matched_trigger + 1)):match("^%s*$")
|
||||
local non_letter = line_to_cursor:sub(-(#matched_trigger + 1), -(#matched_trigger + 1)):match("[^%a]")
|
||||
return line_begin or non_letter
|
||||
end
|
||||
|
||||
-- Math context detection
|
||||
local tex = {}
|
||||
tex.in_mathzone = function()
|
||||
return vim.fn["vimtex#syntax#in_mathzone"]() == 1
|
||||
end
|
||||
tex.in_text = function()
|
||||
return not tex.in_mathzone()
|
||||
end
|
||||
|
||||
local line_begin = function(line_to_cursor, matched_trigger)
|
||||
-- +1 because `string.sub("abcd", 1, -2)` -> abc
|
||||
return line_to_cursor:sub(1, -(#matched_trigger + 1)):match("^%s*$")
|
||||
end
|
||||
|
||||
-- Return snippet tables
|
||||
return {
|
||||
-- TYPEWRITER i.e. \texttt
|
||||
s(
|
||||
{ trig = "([^%a])tt", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 },
|
||||
fmta("<>\\texttt{<>}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
}),
|
||||
{ condition = tex.in_text }
|
||||
),
|
||||
-- ITALIC i.e. \textit
|
||||
s(
|
||||
{ trig = "([^%a])tii", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\textit{<>}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- BOLD i.e. \textbf
|
||||
s(
|
||||
{ trig = "tbb", snippetType = "autosnippet" },
|
||||
fmta("\\textbf{<>}", {
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- MATH ROMAN i.e. \mathrm
|
||||
s(
|
||||
{ trig = "([^%a])rmm", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\mathrm{<>}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- MATH CALIGRAPHY i.e. \mathcal
|
||||
s(
|
||||
{ trig = "([^%a])mcc", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\mathcal{<>}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- MATH BOLDFACE i.e. \mathbf
|
||||
s(
|
||||
{ trig = "([^%a])mbf", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\mathbf{<>}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- MATH BLACKBOARD i.e. \mathbb
|
||||
s(
|
||||
{ trig = "([^%a])mbb", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\mathbb{<>}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- REGULAR TEXT i.e. \text (in math environments)
|
||||
s(
|
||||
{ trig = "([^%a])tee", regTrig = true, wordTrig = false, snippetType = "autosnippet" },
|
||||
fmta("<>\\text{<>}", {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
d(1, get_visual),
|
||||
}),
|
||||
{ condition = tex.in_mathzone }
|
||||
),
|
||||
}
|
||||
19
home-manager/modules/neovim/snippets/tex/luatex.lua
Normal file
19
home-manager/modules/neovim/snippets/tex/luatex.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
local helpers = require("personal.luasnip-helper-funcs")
|
||||
local get_visual = helpers.get_visual
|
||||
local line_begin = require("luasnip.extras.expand_conditions").line_begin
|
||||
|
||||
-- Return snippet tables
|
||||
return {
|
||||
-- tex.sprint
|
||||
s(
|
||||
{ trig = "tpp", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
tex.sprint(<>)
|
||||
]],
|
||||
{
|
||||
d(1, get_visual),
|
||||
}
|
||||
)
|
||||
),
|
||||
}
|
||||
|
|
@ -1,8 +1,12 @@
|
|||
local helpers = require("personal.luasnip-helper-funcs")
|
||||
local get_visual = helpers.get_visual
|
||||
|
||||
local ls = require("luasnip")
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local r = ls.restore_node
|
||||
-- Math context detection
|
||||
local tex = {}
|
||||
-- local function in_mathzone() return vim.api.nvim_eval('vimtex#syntax#in_mathzone()') == 1 end
|
||||
tex.in_mathzone = function()
|
||||
return vim.fn["vimtex#syntax#in_mathzone"]() == 1
|
||||
end
|
||||
|
|
@ -10,8 +14,31 @@ tex.in_text = function()
|
|||
return not tex.in_mathzone()
|
||||
end
|
||||
|
||||
tex.generate_matrix = function(args, snip)
|
||||
local rows = tonumber(snip.captures[2])
|
||||
local cols = tonumber(snip.captures[3])
|
||||
local nodes = {}
|
||||
local ins_indx = 1
|
||||
for j = 1, rows do
|
||||
table.insert(nodes, r(ins_indx, tostring(j) .. "x1", i(1)))
|
||||
ins_indx = ins_indx + 1
|
||||
for k = 2, cols do
|
||||
table.insert(nodes, t(" & "))
|
||||
table.insert(nodes, r(ins_indx, tostring(j) .. "x" .. tostring(k), i(1)))
|
||||
ins_indx = ins_indx + 1
|
||||
end
|
||||
table.insert(nodes, t({ "\\\\", "" }))
|
||||
end
|
||||
-- fix last node.
|
||||
nodes[#nodes] = t("\\\\")
|
||||
return sn(nil, nodes)
|
||||
end
|
||||
|
||||
-- Return snippet tables
|
||||
return {
|
||||
s({ trig = "vton", snippetType = "autosnippet" }, {
|
||||
t("\\vec{v}_1, \\cdots, \\vec{v}_n"),
|
||||
}),
|
||||
-- SUPERSCRIPT
|
||||
s(
|
||||
{ trig = "([%w%)%]%}])'", wordTrig = false, regTrig = true, snippetType = "autosnippet" },
|
||||
|
|
@ -397,6 +424,15 @@ return {
|
|||
}),
|
||||
{ condition = tex.in_mathzone }
|
||||
),
|
||||
|
||||
-- { trig = "([^%a])lim", wordTrig = false, regTrig = true, snippetType = "autosnippet" },
|
||||
-- fmta("<>\\lim_{<>}", {
|
||||
-- f(function(_, snip)
|
||||
-- return snip.captures[1]
|
||||
-- end),
|
||||
-- }),
|
||||
-- { condition = tex.in_mathzone }
|
||||
-- ),
|
||||
--
|
||||
-- BEGIN STATIC SNIPPETS
|
||||
--
|
||||
|
|
@ -489,4 +525,36 @@ return {
|
|||
s({ trig = "xx", snippetType = "autosnippet" }, {
|
||||
t("\\times "),
|
||||
}),
|
||||
s(
|
||||
{
|
||||
trig = "([bBpvV])mat(%d+)x(%d+)([ar])",
|
||||
name = "[bBpvV]matrix",
|
||||
dscr = "matrices",
|
||||
regTrig = true,
|
||||
hidden = true,
|
||||
},
|
||||
fmta(
|
||||
[[
|
||||
\begin{<>}<>
|
||||
<>
|
||||
\end{<>}]],
|
||||
{
|
||||
f(function(_, snip)
|
||||
return snip.captures[1] .. "matrix"
|
||||
end),
|
||||
f(function(_, snip)
|
||||
if snip.captures[4] == "a" then
|
||||
out = string.rep("c", tonumber(snip.captures[3]) - 1)
|
||||
return "[" .. out .. "|c]"
|
||||
end
|
||||
return ""
|
||||
end),
|
||||
d(1, tex.generate_matrix),
|
||||
f(function(_, snip)
|
||||
return snip.captures[1] .. "matrix"
|
||||
end),
|
||||
}
|
||||
),
|
||||
{ condition = tex.in_math, show_condition = tex.in_math }
|
||||
),
|
||||
}
|
||||
|
|
|
|||
58
home-manager/modules/neovim/snippets/tex/static.lua
Normal file
58
home-manager/modules/neovim/snippets/tex/static.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
local helpers = require("personal.luasnip-helper-funcs")
|
||||
local get_visual = helpers.get_visual
|
||||
|
||||
local line_begin = require("luasnip.extras.expand_conditions").line_begin
|
||||
|
||||
-- Environment/syntax context detection
|
||||
local tex = {}
|
||||
tex.in_mathzone = function()
|
||||
return vim.fn["vimtex#syntax#in_mathzone"]() == 1
|
||||
end
|
||||
tex.in_text = function()
|
||||
return not tex.in_mathzone()
|
||||
end
|
||||
tex.in_tikz = function()
|
||||
local is_inside = vim.fn["vimtex#env#is_inside"]("tikzpicture")
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
-- Return snippet tables
|
||||
return {
|
||||
s({ trig = "q" }, {
|
||||
t("\\quad "),
|
||||
}),
|
||||
s({ trig = "qq", snippetType = "autosnippet" }, {
|
||||
t("\\qquad "),
|
||||
}),
|
||||
s({ trig = "npp", snippetType = "autosnippet" }, {
|
||||
t({ "\\newpage", "" }),
|
||||
}, { condition = line_begin }),
|
||||
s({ trig = "which", snippetType = "autosnippet" }, {
|
||||
t("\\text{ for which } "),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "all", snippetType = "autosnippet" }, {
|
||||
t("\\text{ for all } "),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "and", snippetType = "autosnippet" }, {
|
||||
t("\\quad \\text{and} \\quad"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "forall", snippetType = "autosnippet" }, {
|
||||
t("\\text{ for all } "),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "toc", snippetType = "autosnippet" }, {
|
||||
t("\\tableofcontents"),
|
||||
}, { condition = line_begin }),
|
||||
s({ trig = "inff", snippetType = "autosnippet" }, {
|
||||
t("\\infty"),
|
||||
}),
|
||||
s({ trig = "ii", snippetType = "autosnippet" }, {
|
||||
t("\\item "),
|
||||
}, { condition = line_begin }),
|
||||
s(
|
||||
{ trig = "--", snippetType = "autosnippet" },
|
||||
{ t("% --------------------------------------------- %") },
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- HLINE WITH EXTRA VERTICAL SPACE
|
||||
s({ trig = "hl" }, { t("\\hline {\\rule{0pt}{2.5ex}} \\hspace{-7pt}") }, { condition = line_begin }),
|
||||
}
|
||||
192
home-manager/modules/neovim/snippets/tex/system.lua
Normal file
192
home-manager/modules/neovim/snippets/tex/system.lua
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
local helpers = require("personal.luasnip-helper-funcs")
|
||||
local get_visual = helpers.get_visual
|
||||
|
||||
local line_begin = require("luasnip.extras.expand_conditions").line_begin
|
||||
|
||||
-- Math context detection
|
||||
local tex = {}
|
||||
tex.in_mathzone = function()
|
||||
return vim.fn["vimtex#syntax#in_mathzone"]() == 1
|
||||
end
|
||||
tex.in_text = function()
|
||||
return not tex.in_mathzone()
|
||||
end
|
||||
|
||||
-- Return snippet tables
|
||||
return {
|
||||
-- ANNOTATE (custom command for annotating equation derivations)
|
||||
s(
|
||||
{ trig = "ann", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\annotate{<>}{<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
d(2, get_visual),
|
||||
}
|
||||
)
|
||||
),
|
||||
-- REFERENCE
|
||||
s(
|
||||
{ trig = " RR", snippetType = "autosnippet", wordTrig = false },
|
||||
fmta(
|
||||
[[
|
||||
~\ref{<>}
|
||||
]],
|
||||
{
|
||||
d(1, get_visual),
|
||||
}
|
||||
)
|
||||
),
|
||||
-- DOCUMENTCLASS
|
||||
s(
|
||||
{ trig = "dcc", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[=[
|
||||
\documentclass[<>]{<>}
|
||||
]=],
|
||||
{
|
||||
i(1, "a4paper"),
|
||||
i(2, "article"),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- USE A LATEX PACKAGE
|
||||
s(
|
||||
{ trig = "pack", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\usepackage{<>}
|
||||
]],
|
||||
{
|
||||
d(1, get_visual),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- INPUT a LaTeX file
|
||||
s(
|
||||
{ trig = "inn", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\input{<><>}
|
||||
]],
|
||||
{
|
||||
i(1, "~/dotfiles/config/latex/templates/"),
|
||||
i(2),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
-- LABEL
|
||||
s(
|
||||
{ trig = "lbl", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\label{<>}
|
||||
]],
|
||||
{
|
||||
d(1, get_visual),
|
||||
}
|
||||
)
|
||||
),
|
||||
-- HPHANTOM
|
||||
s(
|
||||
{ trig = "hpp", snippetType = "autosnippet" },
|
||||
fmta(
|
||||
[[
|
||||
\hphantom{<>}
|
||||
]],
|
||||
{
|
||||
d(1, get_visual),
|
||||
}
|
||||
)
|
||||
),
|
||||
s(
|
||||
{ trig = "TODOO", snippetType = "autosnippet" },
|
||||
fmta([[\TODO{<>}]], {
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
s(
|
||||
{ trig = "nc" },
|
||||
fmta([[\newcommand{<>}{<>}]], {
|
||||
i(1),
|
||||
i(2),
|
||||
}),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
s(
|
||||
{ trig = "sii", snippetType = "autosnippet" },
|
||||
fmta([[\si{<>}]], {
|
||||
i(1),
|
||||
})
|
||||
),
|
||||
s(
|
||||
{ trig = "qtt" },
|
||||
fmta([[\qty{<>}{<>}]], {
|
||||
i(1),
|
||||
i(2),
|
||||
})
|
||||
),
|
||||
-- URL
|
||||
s(
|
||||
{ trig = "url" },
|
||||
fmta([[\url{<>}]], {
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- href command with URL in visual selection
|
||||
s(
|
||||
{ trig = "LU", snippetType = "autosnippet" },
|
||||
fmta([[\href{<>}{<>}]], {
|
||||
d(1, get_visual),
|
||||
i(2),
|
||||
})
|
||||
),
|
||||
-- href command with text in visual selection
|
||||
s(
|
||||
{ trig = "LL", snippetType = "autosnippet" },
|
||||
fmta([[\href{<>}{<>}]], {
|
||||
i(1),
|
||||
d(2, get_visual),
|
||||
})
|
||||
),
|
||||
-- HSPACE
|
||||
s(
|
||||
{ trig = "hss", snippetType = "autosnippet" },
|
||||
fmta([[\hspace{<>}]], {
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- VSPACE
|
||||
s(
|
||||
{ trig = "vss", snippetType = "autosnippet" },
|
||||
fmta([[\vspace{<>}]], {
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- SECTION
|
||||
s(
|
||||
{ trig = "h1", snippetType = "autosnippet" },
|
||||
fmta([[\section{<>}]], {
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- SUBSECTION
|
||||
s(
|
||||
{ trig = "h2", snippetType = "autosnippet" },
|
||||
fmta([[\subsection{<>}]], {
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
-- SUBSUBSECTION
|
||||
s(
|
||||
{ trig = "h3", snippetType = "autosnippet" },
|
||||
fmta([[\subsubsection{<>}]], {
|
||||
d(1, get_visual),
|
||||
})
|
||||
),
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
|
||||
|
||||
\begin{align*}
|
||||
|
||||
\end{align*}
|
||||
84
home-manager/modules/neovim/snippets/tex/tmp.lua
Normal file
84
home-manager/modules/neovim/snippets/tex/tmp.lua
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
local helpers = require("personal.luasnip-helper-funcs")
|
||||
local get_visual = helpers.get_visual
|
||||
|
||||
local line_begin = require("luasnip.extras.expand_conditions").line_begin
|
||||
|
||||
-- Math context detection
|
||||
local tex = {}
|
||||
tex.in_mathzone = function()
|
||||
return vim.fn["vimtex#syntax#in_mathzone"]() == 1
|
||||
end
|
||||
tex.in_text = function()
|
||||
return not tex.in_mathzone()
|
||||
end
|
||||
|
||||
return {
|
||||
|
||||
-- Equation, choice for labels
|
||||
s(
|
||||
{
|
||||
trig = "beq",
|
||||
dscr = "Expands 'beq' into an equation environment, with a choice for labels",
|
||||
snippetType = "autosnippet",
|
||||
},
|
||||
fmta(
|
||||
[[
|
||||
\begin{equation}<>
|
||||
<>
|
||||
\end{equation}
|
||||
]],
|
||||
{
|
||||
c(1, {
|
||||
sn(
|
||||
2, -- Choose to specify an equation label
|
||||
{
|
||||
t("\\label{eq:"),
|
||||
i(1),
|
||||
t("}"),
|
||||
}
|
||||
),
|
||||
t([[]]), -- Choose no label
|
||||
}, {}),
|
||||
i(2),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
-- Figure environment
|
||||
s(
|
||||
{ trig = "foofig", dscr = "Use 'fig' for figure environmennt, with options" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}<>
|
||||
\centering
|
||||
\includegraphics<>{<>}
|
||||
\caption{<>}
|
||||
\label{fig:<>}
|
||||
\end{figure}
|
||||
]],
|
||||
{
|
||||
-- Optional [htbp] field
|
||||
c(1, {
|
||||
t([[]]), -- Choice 1, empty
|
||||
t("[htbp]"), -- Choice 2, this may be turned into a snippet
|
||||
}, {}),
|
||||
-- Options for includegraphics
|
||||
c(2, {
|
||||
t([[]]), -- Choice 1, empty
|
||||
sn(
|
||||
3, -- Choice 2, this may be turned into a snippet
|
||||
{
|
||||
t("[width="),
|
||||
i(1),
|
||||
t("\\textwidth]"),
|
||||
}
|
||||
),
|
||||
}, {}),
|
||||
i(3, "filename"),
|
||||
i(4, "text"),
|
||||
i(5, "label"),
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
),
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
shellAliases = {
|
||||
update = "sudo nixos-rebuild switch";
|
||||
clean = "nix-collect-garbage -d";
|
||||
repair = "nix-store --repair --verify --check-contents";
|
||||
reload = "source ~/.zshrc";
|
||||
|
||||
"." = "cd ../";
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
../../common/networking
|
||||
../../common/virtualization
|
||||
../../common/nixos
|
||||
../../common/gui
|
||||
|
||||
./syncthing.nix
|
||||
./auditd.nix
|
||||
|
|
@ -46,6 +48,7 @@
|
|||
ssh.enable = true;
|
||||
ssh_guard.enable = true;
|
||||
nfs.enable = true;
|
||||
steam.enable = true;
|
||||
|
||||
# Bootloader.
|
||||
boot = {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
stdenv,
|
||||
...
|
||||
}: {
|
||||
{pkgs, ...}: {
|
||||
boot.kernelPackages = pkgs.linuxPackages_hardened;
|
||||
boot.kernelParams = [
|
||||
# Disable slab merging to prevent heap exploitation
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
restic_key: ENC[AES256_GCM,data:DzpWvFP5gyhrnLVIYgu9ouotWqkOAHehihSKf/TqJE+sHTD4vnIScfhzoKzdkoDoWfkcmQ==,iv:q83qNYuP/3mngvg+kUfOVToogL8VTvZ6HiGIztpnP/s=,tag:YNWwbma0HmPKqYCS1L5kQQ==,type:str]
|
||||
wireless.env: ENC[AES256_GCM,data:LzvMh6lfM9pnS3joSK3SUqEZDfP+Qk7NQmROWny1XhvQ0SkihvlM40YgA4ZGtwcPO1OnrDy6Srfvy+fuOqqt1XEK6qIOSir6cODkGQbKBa1Ui347P28tw6hgEHM57EYTAfMMwaHTtglPAvN/7YvdMPMT+EwcoyCzj5efRR6pZ0FeLSOtzKeYwe4oaRX1MP+THooSzw+zuoGmU6x3Dq4E8hruFd2o0ug3OEj2r95LVmGnnUiiLxU8YhDd+PXXyz8T6fFdapN1,iv:pdXqMqiR3qEQG1LvXqXWB8vpM6d2/Curv4gvuLOOatI=,tag:7H2wST9Mx9C3RCsOeUD1Vw==,type:str]
|
||||
wireless.env: ENC[AES256_GCM,data:/5i0Kv+VFTtVpaD7tfO2ahePu20eYkUYAqoh39PA2aoMWywLddQEQy4arj2Nvcw8hsRk760Kiq4wz3c23dPDqy7rU980NF2RaP4ODMIiQISfYeQP9coD84JhlnSTW+7EkhV520naqJgIYY0IsA8OxR/5euyFMHOL75FKnBh1ILY2DPSsJNG2m2ldw+US7E+7r4REl8tDqKfCIL5tznmbVTbPrer7cwrXe+ScFaholmqSntaB06yIIO3yr88TmE6EXF6oLCXU,iv:DPOqx7M7E83+DYjGFPZy44cxrta/3953IDjXL40rLAc=,tag:KmYBpQKgshMSgxnC96T1bQ==,type:str]
|
||||
home_uuid: ENC[AES256_GCM,data:VX92mQuoYXpPxe6EzQ==,iv:3i7Ll7rITrOTYMKK4tHy+IU5DVWFbFjrFHQ3uw3Gr7g=,tag:0bp/XaR4JOdFYpSVtpxm5A==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
|
|
@ -15,8 +16,8 @@ sops:
|
|||
US9oa0pORXRVWWlyYlZZTGhXdTdOaWsKClqIK/YNJIIGFqOO0t4oni8dRTTXQniG
|
||||
ioIwAOdEgE/n0vcYhHXxLxWlTeqGZF076g7EFfIqiSNqrDtacRnazg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-09-13T19:21:22Z"
|
||||
mac: ENC[AES256_GCM,data:dzWc9v24u1tT8ZeVCXawKn3IovFxlfs6B8yrgzkn7rZGtZDN5iAwTStuZtRYW8tydNuY7KZa9dH/9+Eh7YW9iGsumzQ3ewCHCyg9kdBpC9yGGDkIw41mKG3aweFERtXfq0WWnqDHnr7ZGrtPfsEOxvMG+uKU7K3lslhlcyeQf+U=,iv:BNXwcKP5vOHxbKX8fD3lbEuzhuHqAI5qi8mXtleG6p4=,tag:7WPAxw8IfE+flxzAentE6Q==,type:str]
|
||||
lastmodified: "2024-10-03T04:35:54Z"
|
||||
mac: ENC[AES256_GCM,data:6h43edjI9ouW2vbTcydrvbrqDb7GmMVgXBUk8nHyd0mV5QzR0ZeGzl+WXN5cwTRqwahAMsFax6riWyCFyMAEHIC66ucQhhPKH90vsKpm7/Nh037lbIfbYnqVG5PTdRzLo0zELkNmB5NX7j0amgynEX3xm1ipcWPGowTQiVjkQ98=,iv:zsVRb2ahPZ27hOkdhjmDl3px0wBri+xIwSvya2Kg8Hg=,tag:qrDuyDrIfccOnvqekiNnWA==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.9.0
|
||||
|
|
|
|||
BIN
wallpapers/nixos-wallpaper-catppuccin-latte.png
Normal file
BIN
wallpapers/nixos-wallpaper-catppuccin-latte.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 372 KiB |
Loading…
Add table
Add a link
Reference in a new issue