From 0ca50395ebad3417334adf13822d5e1406ccbc2b Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 18 Sep 2023 03:15:13 +0300 Subject: [PATCH] Vim latex setup improvements (and more) --- common/themes/default.nix | 2 +- dotfiles/neovim/ftplugin/tex.lua | 9 ++++++++- dotfiles/neovim/lazy-lock.json | 3 +-- dotfiles/neovim/lua/my/plugins/hydra.lua | 4 +++- dotfiles/neovim/lua/my/plugins/venn.lua | 5 +++-- .../vscode-snippets/snippets/latex/explain.json | 10 ++++++++++ hosts/nixos/common/global/wireless/default.nix | 1 + .../common/global/wireless/wifi_passwords.age | Bin 740 -> 794 bytes hosts/nixos/common/optional/slambda.nix | 1 + 9 files changed, 28 insertions(+), 7 deletions(-) diff --git a/common/themes/default.nix b/common/themes/default.nix index 3fd8c7f..58a8212 100644 --- a/common/themes/default.nix +++ b/common/themes/default.nix @@ -25,7 +25,7 @@ let catppuccin-macchiato = { stylix = { - image = ./wallpapers/spaceship.jpg; + image = ./wallpapers/nix-catppuccin.png; base16Scheme = "${inputs.catppuccin-base16}/base16/macchiato.yaml"; polarity = "dark"; }; diff --git a/dotfiles/neovim/ftplugin/tex.lua b/dotfiles/neovim/ftplugin/tex.lua index 4b692dd..8f30fe7 100644 --- a/dotfiles/neovim/ftplugin/tex.lua +++ b/dotfiles/neovim/ftplugin/tex.lua @@ -46,8 +46,9 @@ local abbreviations = { { "lambda", "\\lambda" }, { "omega", "\\omega" }, { "Omega", "\\Omega" }, - { "nuls", "\\varnothing" }, -- Other fancy symvols + { "nuls", "\\varnothing" }, + -- Other fancy symvols { "tmat", "^T" }, -- Tranpose of a matrix { "cmat", "^*" }, -- Conjugate of a matrix { "sneg", "^C" }, -- Set complement @@ -60,7 +61,9 @@ local abbreviations = { { "sdiff", "\\setminus" }, { "sst", "\\subset" }, + { "spt", "\\supset" }, { "sseq", "\\subseteq" }, + { "speq", "\\supseteq" }, { "nin", "\\not\\in" }, { "iin", "\\in" }, { "tto", "\\to" }, @@ -90,11 +93,15 @@ local abbreviations = { { "div", "\\|" }, { "ndiv", "\\not\\|\\:" }, { "perp", "\\perp" }, + + -- Custom commands { "abs", "\\abs" }, -- custom abs command { "norm", "\\norm" }, -- custom norm command { "iprod", "\\iprod" }, -- custom inner product command { "diprod", "\\dprod" }, -- custom self inner product command { "prob", "\\prob" }, -- custom probability function + { "dist", "\\dist" }, -- custom dist function + { "diam", "\\diam" }, -- custom diam operator } -- Todo: convert exponents and subscripts diff --git a/dotfiles/neovim/lazy-lock.json b/dotfiles/neovim/lazy-lock.json index 18b0f2a..6d6ffe1 100644 --- a/dotfiles/neovim/lazy-lock.json +++ b/dotfiles/neovim/lazy-lock.json @@ -23,7 +23,6 @@ "idris2-nvim": { "branch": "main", "commit": "3a2b4d2b5ffeab9e47298456c59c31b4e1ddebc9" }, "inc-rename.nvim": { "branch": "main", "commit": "ed0f6f2b917cac4eb3259f907da0a481b27a3b7e" }, "iron.nvim": { "branch": "master", "commit": "7f876ee3e1f4ea1e5284b1b697cdad5b256e8046" }, - "jupytext.vim": { "branch": "master", "commit": "32c1e37b2edf63a7e38d0deb92cc3f1462cc4dcd" }, "kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" }, "kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" }, "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, @@ -32,7 +31,6 @@ "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, "magma-nvim": { "branch": "main", "commit": "ff3deba8a879806a51c005e50782130246143d06" }, - "mind.nvim": { "branch": "master", "commit": "002137dd7cf97865ebd01b6a260209d2daf2da66" }, "mini.files": { "branch": "main", "commit": "dea80a8147aa4e3025c34d2e2aaa6f2aeb7b21dd" }, "mini.operators": { "branch": "main", "commit": "15f137f28412517e2248d39cf0663bd3a87aa24a" }, "mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" }, @@ -66,6 +64,7 @@ "typst.vim": { "branch": "main", "commit": "6a99324a138c2da69589a8ab2e49375774e43d77" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "venn.nvim": { "branch": "main", "commit": "c114563960b8fb1197695d42798d1f3e7190b798" }, + "vim-abolish": { "branch": "master", "commit": "cb3dcb220262777082f63972298d57ef9e9455ec" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-teal": { "branch": "master", "commit": "d2aa107b257879e774680792a2aebaf9cd5742e0" }, "vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" }, diff --git a/dotfiles/neovim/lua/my/plugins/hydra.lua b/dotfiles/neovim/lua/my/plugins/hydra.lua index 42db5e7..04abfce 100644 --- a/dotfiles/neovim/lua/my/plugins/hydra.lua +++ b/dotfiles/neovim/lua/my/plugins/hydra.lua @@ -216,9 +216,11 @@ function H.pad(text, length, justify) return H.pad_around(text, length) elseif justify == "right" then return H.pad_left(text, length) - else + elseif justify == "left" then return H.pad_right(text, length) end + + error("No justify provided") end function H.directional(h, j, k, l, spacing_amount) diff --git a/dotfiles/neovim/lua/my/plugins/venn.lua b/dotfiles/neovim/lua/my/plugins/venn.lua index 63b93ea..bccc771 100644 --- a/dotfiles/neovim/lua/my/plugins/venn.lua +++ b/dotfiles/neovim/lua/my/plugins/venn.lua @@ -7,7 +7,7 @@ local M = { } local venn_hint_old = [[ - ^^^Arrow^^^ Select region with + ^^^Draw arrow^^^ Select region with ^ ^ _K_ ^ ^ _f_: surround it with box _H_ ^ ^ _L_ ^ ^ _J_ ^ ^ __ @@ -16,12 +16,13 @@ local venn_hint_old = [[ local H = require("my.plugins.hydra").hint local venn_hint = H.concat_many_h({ - H.add_title("Arrow", H.directional("H", "J", "K", "L", 3)), + H.add_title("Draw arrows", H.directional("H", "J", "K", "L", 3)), H.add_title( "Actions", H.concat_many_w({ H.concat_h("", ": select region"), H.concat_h(H.pad_right(H.highlight("f"), 5), ": surround with box"), + H.concat_h(H.pad_right(H.highlight(""), 5), ": quit"), }, { justify = "left" }) ), }, 3).value diff --git a/dotfiles/vscode-snippets/snippets/latex/explain.json b/dotfiles/vscode-snippets/snippets/latex/explain.json index 0f0582a..3a55002 100644 --- a/dotfiles/vscode-snippets/snippets/latex/explain.json +++ b/dotfiles/vscode-snippets/snippets/latex/explain.json @@ -73,5 +73,15 @@ "prefix": "exln", "description": "Explain a step which applies the ln function to both sides of an equation", "body": "&& \\left( \\ln $1 \\right)$0" + }, + "Explain triangle inequality": { + "prefix": "extrin", + "description": "Explain a step using the triangle inequality in math mode", + "body": "&& \\text{(Triangle inequality on $ $1 $)}$0" + }, + "Explain being bounded": { + "prefix": "exbound", + "description": "Explain that something is bounded in math mode", + "body": "&& \\text{($ $1 $ is bounded)}$0" } } diff --git a/hosts/nixos/common/global/wireless/default.nix b/hosts/nixos/common/global/wireless/default.nix index aea9411..3b71b5c 100644 --- a/hosts/nixos/common/global/wireless/default.nix +++ b/hosts/nixos/common/global/wireless/default.nix @@ -20,6 +20,7 @@ "Sailhorse".psk = "@NL_PLACE_0_PASS@"; "Ziggo1721699".psk = "@NL_PLACE_1_PASS@"; + "Konijntjes".psk = "@NL_PLACE_1_PODS_PASS@"; "InfoEdu12".psk = "@INFOEDU_PASS@"; "ZTE_F7A321".psk = "@MADALINA_PASS@"; diff --git a/hosts/nixos/common/global/wireless/wifi_passwords.age b/hosts/nixos/common/global/wireless/wifi_passwords.age index da9e2372acc045e1bb2a67dda88b34f113acef53..adf81cb505bbc7c3781a68863ea8b3a96cd97931 100644 GIT binary patch delta 743 zcmVn}dNOENNh?-YS8r8UNK`^gWm7eE zNLOlAV+w6XPDe;VdTCizb#-TGMMO(%Yj|Q=QZ-RZXH!#TR8}>1a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