diff --git a/dotfiles/neovim/ftplugin/tex.lua b/dotfiles/neovim/ftplugin/tex.lua index 80d5bc1..7f504f4 100644 --- a/dotfiles/neovim/ftplugin/tex.lua +++ b/dotfiles/neovim/ftplugin/tex.lua @@ -25,7 +25,7 @@ local abbreviations = { { "nuls", "\\varnothing" }, -- Other fancy symvols - { "ints", "\\mathbb{I}" }, + { "ints", "\\mathbb{Z}" }, { "nats", "\\mathbb{N}" }, { "rats", "\\mathbb{Q}" }, { "rrea", "\\mathbb{R}" }, @@ -44,6 +44,7 @@ local abbreviations = { { "etn", "^{-}" }, { "ett", "^{t}" }, { "tmat", "^{T}" }, -- Tranpose of a matrix + { "cmat", "^{*}" }, -- Conjugate of a matrix { "etp", "^{+}" }, -- Subscripts @@ -108,19 +109,21 @@ local abbreviations = { { "div", "\\|" }, { "ndiv", "\\not\\|\\:" }, - -- words { "rref", "reduced row echalon form" }, - { "thrf", "therefore" } } local abolishAbbreviations = { { "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" }, { "ib{p,s}", "integration by {parts,substitution}" }, - { "mx{,s}", "matri{x,ces}" } + { "mx{,s}", "matri{x,ces}" }, + { "thrf", "therefore" } } A.manyLocalAbbr(abbreviations) AB.abolishMany(abolishAbbreviations) -vim.keymap.set("n", "lc", "VimtexCompile", { desc = "Compile current buffer using vimtex" }) +vim.keymap.set("n", "lc", "VimtexCompile", { + desc = "Compile current buffer using vimtex", + buffer = true +}) diff --git a/dotfiles/neovim/lua/my/init.lua b/dotfiles/neovim/lua/my/init.lua index 9e1af05..bb1cd33 100644 --- a/dotfiles/neovim/lua/my/init.lua +++ b/dotfiles/neovim/lua/my/init.lua @@ -7,7 +7,6 @@ function M.setup() require("my.theme").setup() require("my.options").setup() require('my.keymaps').setup() - require('my.snippets').setup() require('my.plugins').setup() require("telescope.extensions.unicode").setupAbbreviations() end diff --git a/dotfiles/neovim/lua/my/keymaps.lua b/dotfiles/neovim/lua/my/keymaps.lua index b712aa4..044b583 100644 --- a/dotfiles/neovim/lua/my/keymaps.lua +++ b/dotfiles/neovim/lua/my/keymaps.lua @@ -77,7 +77,7 @@ function M.setup() name = "Go to" }, r = { - name = "Rename / Replace" + name = "Rename / Replace / Reload" }, [""] = { name = "Easymotion" diff --git a/dotfiles/neovim/lua/my/plugins/fzf-lua.lua b/dotfiles/neovim/lua/my/plugins/fzf-lua.lua deleted file mode 100644 index 2248a0b..0000000 --- a/dotfiles/neovim/lua/my/plugins/fzf-lua.lua +++ /dev/null @@ -1,18 +0,0 @@ -local M = {} - -local bindings = { - -- Open files with control + P - files = "", - -- See diagnostics with space + d - lsp_document_diagnostics = "d", - lsp_workspace_diagnostics = "D" -} - -function M.setup() - for action, keybind in pairs(bindings) do - -- Maps the keybind to the action - vim.keymap.set('n', keybind, require('fzf-lua')[action]) - end -end - -return M diff --git a/dotfiles/neovim/lua/my/plugins/init.lua b/dotfiles/neovim/lua/my/plugins/init.lua index 121ad4b..33b9232 100644 --- a/dotfiles/neovim/lua/my/plugins/init.lua +++ b/dotfiles/neovim/lua/my/plugins/init.lua @@ -6,6 +6,11 @@ function M.setup() require('fidget').setup() require('dressing').setup() + require("my.plugins.easymotion").setup() + require("my.plugins.autopairs").setup() + require("my.plugins.telescope").setup() + require("my.plugins.surround").setup() + env.vscode.unless(function() env.firevim.unless(function() require("presence"):setup({}) @@ -35,10 +40,6 @@ function M.setup() require("my.plugins.paperplanes").setup() end - require("my.plugins.easymotion").setup() - require("my.plugins.autopairs").setup() - require("my.plugins.telescope").setup() - require("my.plugins.surround").setup() require("my.plugins.hydra").setup() require("my.plugins.clipboard-image").setup() diff --git a/dotfiles/neovim/lua/my/plugins/luasnip.lua b/dotfiles/neovim/lua/my/plugins/luasnip.lua index 54c0b57..7c1fdb0 100644 --- a/dotfiles/neovim/lua/my/plugins/luasnip.lua +++ b/dotfiles/neovim/lua/my/plugins/luasnip.lua @@ -1,6 +1,10 @@ local M = {} local luasnip = require("luasnip") +local function reload() + require("luasnip.loaders.from_vscode").lazy_load() +end + function M.setup() vim.keymap.set("i", "", function() if luasnip.jumpable(1) then @@ -12,6 +16,12 @@ function M.setup() vim.keymap.set("i", "", function() luasnip.jump(-1) end) + + vim.keymap.set("n", "rs", reload, { + desc = "Reload luasnip snippets" + }) + + reload() end return M diff --git a/dotfiles/neovim/lua/my/plugins/vimtex.lua b/dotfiles/neovim/lua/my/plugins/vimtex.lua index dd5ced5..242f53d 100644 --- a/dotfiles/neovim/lua/my/plugins/vimtex.lua +++ b/dotfiles/neovim/lua/my/plugins/vimtex.lua @@ -1,12 +1,10 @@ -local global = require("my.helpers").global - local M = {} function M.setup() -- Viewer method vim.g.vimtex_view_method = "zathura" vim.g.Tex_DefaultTargetFormat = "pdf" - vim.g.vimtex_fold_enabled = 1 + vim.g.vimtex_fold_enabled = 0 vim.g.vimtex_compiler_latexmk = { options = { "-pdf", "-shell-escape", "-verbose", "-file-line-error", "-synctex=1", "-interaction=nonstopmode" diff --git a/dotfiles/neovim/lua/my/snippets.lua b/dotfiles/neovim/lua/my/snippets.lua deleted file mode 100644 index 9cb0ac5..0000000 --- a/dotfiles/neovim/lua/my/snippets.lua +++ /dev/null @@ -1,8 +0,0 @@ -local M = {} - -function M.setup() - -- require("luasnip").config.setup({ enable_autosnippets = false }) - require("luasnip.loaders.from_vscode").lazy_load() -end - -return M diff --git a/dotfiles/vscode-snippets/package.json b/dotfiles/vscode-snippets/package.json index a77b117..7735f3c 100644 --- a/dotfiles/vscode-snippets/package.json +++ b/dotfiles/vscode-snippets/package.json @@ -32,6 +32,12 @@ ], "path": "./snippets/latex/core.json" }, + { + "language": [ + "tex" + ], + "path": "./snippets/latex/explain.json" + }, { "language": [ "lua" diff --git a/dotfiles/vscode-snippets/snippets/latex/core.json b/dotfiles/vscode-snippets/snippets/latex/core.json index b820ce5..f7d7a1d 100644 --- a/dotfiles/vscode-snippets/snippets/latex/core.json +++ b/dotfiles/vscode-snippets/snippets/latex/core.json @@ -12,10 +12,7 @@ "Absolute value": { "prefix": "abs", "description": "Absolute values", - "body": "|$1|$0", - "luasnip": { - "autotrigger": true - } + "body": "|$1|$0" }, "Lemma": { "prefix": "lemma", @@ -59,26 +56,27 @@ "Subscript": { "prefix": "ss", "description": "Subscript", - "body": "_{$1}$0", - "luasnip": { - "autotrigger": true - } + "body": "_{$1}$0" }, "Exponent": { "prefix": "ee", "description": "Exponent", - "body": "^{$1}$0", - "luasnip": { - "autotrigger": true - } + "body": "^{$1}$0" }, "Nth derivative": { "prefix": "dd", "description": "Nth derivative", - "body": "^{($1)}$0", - "luasnip": { - "autotrigger": true - } + "body": "^{($1)}$0" + }, + "Overline": { + "prefix": "ol", + "description": "Overline", + "body": "\\overline{$1}$0" + }, + "Z Mod": { + "prefix": "zmod", + "description": "The set of Z/nZ", + "body": "\\mathbb{Z}/$1\\mathbb{Z}$0" }, "Section": { "prefix": "section", @@ -133,74 +131,47 @@ "Sigma sum": { "prefix": "bsum", "description": "Create a sum using sigma notation", - "body": "\\sum_{$1 = $2}^{$3}$0", - "luasnip": { - "autotrigger": true - } + "body": "\\sum_{$1 = $2}^{$3}$0" }, "Pi product": { "prefix": "bproduct", "description": "Create a produt using pi notation", - "body": "\\prod_{$1 = $2}^{$3}$0", - "luasnip": { - "autotrigger": true - } + "body": "\\prod_{$1 = $2}^{$3}$0" }, "Fraction": { "prefix": "frac", "description": "Create a fraction", - "body": "\\frac{$1}{$2}$0", - "luasnip": { - "autotrigger": true - } + "body": "\\frac{$1}{$2}$0" }, "Choose": { "prefix": "binom", "description": "Create a (n choose k) thingy", - "body": "\\binom{$1}{$2}$0", - "luasnip": { - "autotrigger": true - } + "body": "\\binom{$1}{$2}$0" }, "Limit": { "prefix": "lim", "description": "Create a limit", - "body": "\\lim _{$1 \\to $2}$0", - "luasnip": { - "autotrigger": true - } + "body": "\\lim _{$1 \\to $2}$0" }, "Limit to infinity": { "prefix": "ilim", "description": "Create a limit as a variable goes to infinity", - "body": "\\lim _{$1 \\to \\infty}$0", - "luasnip": { - "autotrigger": true - } + "body": "\\lim _{$1 \\to \\infty}$0" }, "Limit to negative infinity": { "prefix": "nlim", "description": "Create a limit as a variable goes to negative infinity", - "body": "\\lim _{$1 \\to -\\infty}$0", - "luasnip": { - "autotrigger": true - } + "body": "\\lim _{$1 \\to -\\infty}$0" }, "Limit to zero": { "prefix": "zlim", "description": "Create a limit as a variable goes to 0", - "body": "\\lim _{$1 \\to 0}$0", - "luasnip": { - "autotrigger": true - } + "body": "\\lim _{$1 \\to 0}$0" }, "Sqrt": { "prefix": "sqrt", "description": "Create a sqrt", - "body": "\\sqrt[$1]{$2}$0", - "luasnip": { - "autotrigger": true - } + "body": "\\sqrt[$1]{$2}$0" }, "Sin": { "prefix": "sin", diff --git a/dotfiles/vscode-snippets/snippets/latex/explain.json b/dotfiles/vscode-snippets/snippets/latex/explain.json new file mode 100644 index 0000000..0f0582a --- /dev/null +++ b/dotfiles/vscode-snippets/snippets/latex/explain.json @@ -0,0 +1,77 @@ +{ + "Text explanation in math mode": { + "prefix": "texpl", + "description": "Explain a step using text in math mode", + "body": "&& \\text{($1)}$0" + }, + "Explanation in math mode": { + "prefix": "expl", + "description": "Explain a step in math mode", + "body": "&& ($1) $0" + }, + "Explain division": { + "prefix": "exdiv", + "description": "Explain a division inside an equation", + "body": "&& \\left(\\frac{\\square}{$1}\\right)$0" + }, + "Explain fraction": { + "prefix": "exfract", + "description": "Explain a step which wraps both sides of an equation by a fraction", + "body": "&& \\left(\\frac{$1}{$2} \\right)$0" + }, + "Explain right multiplication": { + "prefix": "exmul", + "description": "Explain a right multiplication inside an equation", + "body": "&& \\left(\\square \\cdot $1 \\right)$0" + }, + "Explain left multiplication": { + "prefix": "exlmul", + "description": "Explain a left multiplication inside an equation", + "body": "&& \\left($1 \\cdot \\square\\right)$0" + }, + "Explain differentiation": { + "prefix": "exdiff", + "description": "Explain a step which differentiates both sides of an equation", + "body": "&& \\left( \\frac{d \\square} {d $1} \\right)$0" + }, + "Explain integration": { + "prefix": "exint", + "description": "Explain a step which integrates both sides of an equation", + "body": "&& \\left(\\int \\square d$1 \\right)$0" + }, + "Explain definite integration": { + "prefix": "exdint", + "description": "Explain a step which applies a definite integral to both sides of an equation", + "body": "&& \\left(\\int _{$1} ^{$2} \\square d$3 \\right)$0" + }, + "Explain addition": { + "prefix": "exadd", + "description": "Explain a step which adds to both sides of an equation", + "body": "&& \\left( \\square + $1 \\right)$0" + }, + "Explain subtraction": { + "prefix": "exsub", + "description": "Explain a step which subtracts from both sides of an equation", + "body": "&& \\left( \\square - $1 \\right)$0" + }, + "Explain negation": { + "prefix": "exneg", + "description": "Explain a step which negates both sides of an equation", + "body": "&& (- \\square )$0" + }, + "Explain power": { + "prefix": "expow", + "description": "Explain a step which raises both sides of an equation to a given power", + "body": "&& \\left( \\square ^{$1} \\right)$0" + }, + "Explain exponentiation": { + "prefix": "exexp", + "description": "Explain a step which raises a given value to both sides of an equation", + "body": "&& \\left( $1 ^{\\square} \\right)$0" + }, + "Explain natural logarithm": { + "prefix": "exln", + "description": "Explain a step which applies the ln function to both sides of an equation", + "body": "&& \\left( \\ln $1 \\right)$0" + } +} diff --git a/img/22-10-19-16-13-24.png b/img/22-10-19-16-13-24.png new file mode 100644 index 0000000..9273abf Binary files /dev/null and b/img/22-10-19-16-13-24.png differ diff --git a/modules/applications/default.nix b/modules/applications/default.nix index 448711c..4e6869b 100644 --- a/modules/applications/default.nix +++ b/modules/applications/default.nix @@ -25,6 +25,7 @@ # ./chromium.nix ./vieb.nix ./polybar.nix + ./hamachi.nix ]; } diff --git a/modules/applications/hamachi.nix b/modules/applications/hamachi.nix new file mode 100644 index 0000000..2630524 --- /dev/null +++ b/modules/applications/hamachi.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + services.logmein-hamachi.enable = true; + home-manager.users.adrielus.home.packages = [ + pkgs.logmein-hamachi + pkgs.unstable.haguichi + ]; +}