From 25e8a6c8cfd1ed99e1d02624591e268748ab03b5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 20 Jul 2023 09:19:35 +0200 Subject: [PATCH] refactor: move vimtex K to texlab --- lua/lazyvim/plugins/extras/lang/tex.lua | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/tex.lua b/lua/lazyvim/plugins/extras/lang/tex.lua index 63b8f555..e8d4feff 100644 --- a/lua/lazyvim/plugins/extras/lang/tex.lua +++ b/lua/lazyvim/plugins/extras/lang/tex.lua @@ -1,9 +1,10 @@ return { { "folke/which-key.nvim", + optional = true, opts = { defaults = { - ["l"] = { name = "+vimtex" }, + ["l"] = { name = "+vimtex" }, }, }, }, @@ -25,7 +26,6 @@ return { { "lervag/vimtex", - version = "*", lazy = false, -- lazy-loading will disable inverse search config = function() vim.api.nvim_create_autocmd({ "FileType" }, { @@ -36,14 +36,6 @@ return { end, }) - vim.api.nvim_create_autocmd({ "FileType" }, { - group = vim.api.nvim_create_augroup("lazyvim_vimtex_keymap", { clear = true }), - pattern = { "bib", "tex" }, - callback = function() - vim.keymap.set("n", "K", "(vimtex-doc-package)", { desc = "Vimtex Docs", silent = true }) - end, - }) - vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog" end, @@ -55,7 +47,11 @@ return { optional = true, opts = { servers = { - texlab = {}, + texlab = { + keys = { + { "K", "(vimtex-doc-package)", desc = "Vimtex Docs", silent = true }, + }, + }, }, }, },