From 104ae1ec4250eea39d99da3001923c9dd9441925 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sat, 15 Oct 2022 15:06:38 +0200 Subject: [PATCH] Backup --- dotfiles/neovim/lua/my/snippets.lua | 3 +- dotfiles/neovim/lua/my/snippets/tex.lua | 8 ++ .../vscode-snippets/snippets/latex/core.json | 74 +++++++++++++++---- 3 files changed, 69 insertions(+), 16 deletions(-) create mode 100644 dotfiles/neovim/lua/my/snippets/tex.lua diff --git a/dotfiles/neovim/lua/my/snippets.lua b/dotfiles/neovim/lua/my/snippets.lua index dd9b526..9cb0ac5 100644 --- a/dotfiles/neovim/lua/my/snippets.lua +++ b/dotfiles/neovim/lua/my/snippets.lua @@ -1,7 +1,8 @@ local M = {} function M.setup() - require("luasnip.loaders.from_vscode").lazy_load({}) + -- require("luasnip").config.setup({ enable_autosnippets = false }) + require("luasnip.loaders.from_vscode").lazy_load() end return M diff --git a/dotfiles/neovim/lua/my/snippets/tex.lua b/dotfiles/neovim/lua/my/snippets/tex.lua new file mode 100644 index 0000000..b961f3a --- /dev/null +++ b/dotfiles/neovim/lua/my/snippets/tex.lua @@ -0,0 +1,8 @@ +local luasnip = require("luasnip") +local M = {} + +function M.setup() +end + +return M + diff --git a/dotfiles/vscode-snippets/snippets/latex/core.json b/dotfiles/vscode-snippets/snippets/latex/core.json index 2b0e4b4..b820ce5 100644 --- a/dotfiles/vscode-snippets/snippets/latex/core.json +++ b/dotfiles/vscode-snippets/snippets/latex/core.json @@ -12,7 +12,10 @@ "Absolute value": { "prefix": "abs", "description": "Absolute values", - "body": "|$1|$0" + "body": "|$1|$0", + "luasnip": { + "autotrigger": true + } }, "Lemma": { "prefix": "lemma", @@ -56,17 +59,26 @@ "Subscript": { "prefix": "ss", "description": "Subscript", - "body": "_{$1}$0" + "body": "_{$1}$0", + "luasnip": { + "autotrigger": true + } }, "Exponent": { "prefix": "ee", "description": "Exponent", - "body": "^{$1}$0" + "body": "^{$1}$0", + "luasnip": { + "autotrigger": true + } }, "Nth derivative": { "prefix": "dd", "description": "Nth derivative", - "body": "^{($1)}$0" + "body": "^{($1)}$0", + "luasnip": { + "autotrigger": true + } }, "Section": { "prefix": "section", @@ -121,47 +133,74 @@ "Sigma sum": { "prefix": "bsum", "description": "Create a sum using sigma notation", - "body": "\\sum_{$1 = $2}^{$3}$0" + "body": "\\sum_{$1 = $2}^{$3}$0", + "luasnip": { + "autotrigger": true + } }, "Pi product": { "prefix": "bproduct", "description": "Create a produt using pi notation", - "body": "\\product_{$1 = $2}^{$3}$0" + "body": "\\prod_{$1 = $2}^{$3}$0", + "luasnip": { + "autotrigger": true + } }, "Fraction": { "prefix": "frac", "description": "Create a fraction", - "body": "\\frac{$1}{$2}$0" + "body": "\\frac{$1}{$2}$0", + "luasnip": { + "autotrigger": true + } }, "Choose": { "prefix": "binom", "description": "Create a (n choose k) thingy", - "body": "\\binom{$1}{$2}$0" + "body": "\\binom{$1}{$2}$0", + "luasnip": { + "autotrigger": true + } }, "Limit": { "prefix": "lim", "description": "Create a limit", - "body": "\\lim _{$1 \\to $2}$0" + "body": "\\lim _{$1 \\to $2}$0", + "luasnip": { + "autotrigger": true + } }, "Limit to infinity": { "prefix": "ilim", "description": "Create a limit as a variable goes to infinity", - "body": "\\lim _{$1 \\to \\infty}$0" + "body": "\\lim _{$1 \\to \\infty}$0", + "luasnip": { + "autotrigger": true + } }, "Limit to negative infinity": { "prefix": "nlim", "description": "Create a limit as a variable goes to negative infinity", - "body": "\\lim _{$1 \\to -\\infty}$0" + "body": "\\lim _{$1 \\to -\\infty}$0", + "luasnip": { + "autotrigger": true + } }, "Limit to zero": { "prefix": "zlim", "description": "Create a limit as a variable goes to 0", - "body": "\\lim _{$1 \\to 0}$0" + "body": "\\lim _{$1 \\to 0}$0", + "luasnip": { + "autotrigger": true + } }, "Sqrt": { "prefix": "sqrt", "description": "Create a sqrt", - "body": "\\sqrt[$1]{$2}$0" + "body": "\\sqrt[$1]{$2}$0", + "luasnip": { + "autotrigger": true + } }, "Sin": { "prefix": "sin", @@ -183,10 +222,15 @@ "description": "Create an aligned environment", "body": ["\\begin{aligned}", "\t$0", "\\end{aligned}"] }, - "Explanation in math mode": { + "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": "&& \\text{$1}$0" + "body": "&& ($1) $0" }, "Let": { "prefix": "let",