diff options
| author | Mohammad Reza Karimi <m.r.karimi.j@gmail.com> | 2026-01-21 19:06:11 -0500 |
|---|---|---|
| committer | Mohammad Reza Karimi <m.r.karimi.j@gmail.com> | 2026-01-21 19:06:11 -0500 |
| commit | 6dd62b4cc8b2142135632483bfb55501645d55b8 (patch) | |
| tree | c4cf4b8a2bf34cc578ba83ca81d38363ac55e236 /after/ftplugin/tex.lua | |
| parent | aa5717f00fd14430c80939a68d7107c26de6e554 (diff) | |
big updates
Diffstat (limited to 'after/ftplugin/tex.lua')
| -rw-r--r-- | after/ftplugin/tex.lua | 38 |
1 files changed, 26 insertions, 12 deletions
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", "<C-i>", function() + local key = vim.api.nvim_replace_termcodes("Scemph<CR>", true, false, true) + vim.api.nvim_feedkeys(key, "v", false) +end, { desc = "Latex: Emphasize text" }) + +vim.keymap.set("v", "<C-b>", function() + local key = + vim.api.nvim_replace_termcodes("Sctextbf<CR>", true, false, true) + vim.api.nvim_feedkeys(key, "v", false) +end, { desc = "Latex: Make text bold" }) |
