wrap the keymap settings in autocmd

This commit is contained in:
chilly 2025-09-29 13:39:30 +08:00
parent 4fb548d004
commit 3ddc6a0325

View file

@ -30,9 +30,15 @@ return {
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog" vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
vim.g.vimtex_mappings_enabled = false vim.g.vimtex_mappings_enabled = false
local augroup = vim.api.nvim_create_augroup("vimtexConfig", {})
vim.api.nvim_create_autocmd("FileType", {
pattern = "tex",
group = augroup,
callback = function(event)
local wk = require("which-key") local wk = require("which-key")
wk.add({ wk.add({
-- buffer = ev.buf, -- e.g. ev.buf or similar buffer = event.buf,
{ {
"<localleader>l", "<localleader>l",
group = "VimTeX", group = "VimTeX",
@ -536,6 +542,8 @@ return {
}, },
}) })
end, end,
})
end,
keys = { keys = {
{ "<localLeader>l", "", desc = "+vimtex", ft = "tex" }, { "<localLeader>l", "", desc = "+vimtex", ft = "tex" },
}, },