--[[-- File : conf.d/lvim/ftplugin/tex.lua Author : Jeff Lance Date : 06.08.2023 11:07:22 Last Modified Date: 15.08.2023 00:46:47 Last Modified By : Jeff Lance --]] -- local opts = {} local status_ok, whk = pcall(require, "which-key") if not status_ok then return end -- Shortcuts -- -- old way making the LaTeX menu appears with the LSP and Lunar one -- whk.register { -- ["L"] = { -- name = "LSP, Lunar, LaTeX", -- we edit the title of the L shortcut -- } -- } vim.g.maplocalleader = " " -- we define a leader available only from tex files whk.register { ["l"] = {} -- empties the default VimTeX menu mapping } whk.register { [""] = { -- to set a completly new using only the localleader key name = "LaTeX", c = { "VimtexCompileSS", "Single-shot compile project" }, C = { name = "Compile", s = { "VimtexStop", "Stop compile" }, c = { "VimtexCompileSelected", "Compile Selected" }, }, d = { "VimtexDocPackage", "Open Doc for package" }, e = { "VimtexErrors", "Look at the errors" }, m = { "VimtexToggleMain", "Toggle Main" }, o = { "VimtexView", "View pdf" }, s = { "VimtexStatus", "Look at the status" }, T = { name = "TOC", o = { "VimtexTocOpen", "Open TOC" }, t = { "VimtexTocToggle", "Toggle TOC" }, }, V = { name = "VimTeX", c = { "edit /home/jeff/.config/lvim/ftplugin/tex.lua", "Edit configuration" }, s = { "edit /home/jeff/.config/lvim/luasnippets/tex.lua", "Edit snippets" }, i = { "VimtexInfo", "Vimtex Info" }, }, } } -- Linters -- local linters = require("lvim.lsp.null-ls.linters") linters.setup({ { command = "chktex", filetypes = { "tex" } }, }) -- Formatters -- local formatters = require("lvim.lsp.null-ls.formatters") formatters.setup({ { command = "latexindent", filetypes = { "tex" } }, })