From 6dd62b4cc8b2142135632483bfb55501645d55b8 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Karimi Date: Wed, 21 Jan 2026 19:06:11 -0500 Subject: big updates --- after/ftplugin/fugitive.lua | 2 ++ after/ftplugin/tex.lua | 38 ++++++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 after/ftplugin/fugitive.lua (limited to 'after/ftplugin') diff --git a/after/ftplugin/fugitive.lua b/after/ftplugin/fugitive.lua new file mode 100644 index 0000000..2d1fbb5 --- /dev/null +++ b/after/ftplugin/fugitive.lua @@ -0,0 +1,2 @@ +vim.keymap.set("n", "p", "Git push", { buffer = true, remap = false }) +vim.keymap.set("n", "P", "Git pull", { buffer = true, remap = false }) diff --git a/after/ftplugin/tex.lua b/after/ftplugin/tex.lua index 963ab7f..5a51d91 100644 --- a/after/ftplugin/tex.lua +++ b/after/ftplugin/tex.lua @@ -1,19 +1,33 @@ vim.cmd([[setlocal shiftwidth=2 tabstop=2]]) vim.fn.call("vimtex#imaps#add_map", { - { - lhs = "++", - rhs = "\\item ", - leader = "", - wrapper = "vimtex#imaps#wrap_environment", - context = { "itemize", "enumerate", "description" }, - }, + { + lhs = "++", + rhs = "\\item ", + leader = "", + wrapper = "vimtex#imaps#wrap_environment", + context = { "itemize", "enumerate", "description" }, + }, }) vim.fn.call("vimtex#imaps#add_map", { - { - lhs = "e", - rhs = "\\eps", - wrapper = "vimtex#imaps#wrap_math", - }, + { + lhs = "e", + rhs = "\\eps", + wrapper = "vimtex#imaps#wrap_math", + }, }) + +vim.b.surround_101 = "\\begin{\1environment: \1}\r\\end{\1\1}" -- surround with e (environment) +vim.b.surround_99 = "\\\1command: \1{\r}" -- surround with c (command) + +vim.keymap.set("v", "", function() + local key = vim.api.nvim_replace_termcodes("Scemph", true, false, true) + vim.api.nvim_feedkeys(key, "v", false) +end, { desc = "Latex: Emphasize text" }) + +vim.keymap.set("v", "", function() + local key = + vim.api.nvim_replace_termcodes("Sctextbf", true, false, true) + vim.api.nvim_feedkeys(key, "v", false) +end, { desc = "Latex: Make text bold" }) -- cgit v1.2.3-71-gdd5e