From 53f024e98241f5f27436e4530850143020935b12 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 20 Jan 2023 10:43:42 +0100 Subject: [PATCH 1/2] [nvim] fix: tex `env` snippet --- .config/nvim/after/ftplugin/tex.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/nvim/after/ftplugin/tex.lua b/.config/nvim/after/ftplugin/tex.lua index 537d757..45203e5 100644 --- a/.config/nvim/after/ftplugin/tex.lua +++ b/.config/nvim/after/ftplugin/tex.lua @@ -81,8 +81,10 @@ ls.add_snippets("tex", { s("env", { t({ "\\begin{" }), i(1, "foo"), - t({ "}", "\t" }), + t({ "}"}), i(2), + t({ "", "\t" }), + i(3), t({ "", "\\end{" }), f(copy,1), t({ "}"}), From e37b806428eec87879044055ce25ed85560ba14a Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 20 Jan 2023 10:44:32 +0100 Subject: [PATCH 2/2] [nvim] feat: add keymaps for pdf viewer pop-up --- .config/nvim/after/ftplugin/tex.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.config/nvim/after/ftplugin/tex.lua b/.config/nvim/after/ftplugin/tex.lua index 45203e5..c4feb6f 100644 --- a/.config/nvim/after/ftplugin/tex.lua +++ b/.config/nvim/after/ftplugin/tex.lua @@ -18,6 +18,18 @@ vim.keymap.set("i", "EE", "É") vim.keymap.set("i", "etc", "\\,etc.") vim.keymap.set("i", ":", "\\,:") +-- pdf viewer +vim.keymap.set("n", "zm", + ":!$READER main.pdf &", + { desc = "Open $READER on pdf of current file" } +) + +vim.keymap.set("n", "zz", + ":!$READER =expand('%:r').pdf &", + { desc = "Open $READER on pdf of current file" } +) + + -- Snippets local ls = require("luasnip")