]> git.rmz.io Git - dotfiles.git/blob - nvim/lua/plugins/lang/tex.lua
vim: do not set pastetoggle in nvim
[dotfiles.git] / nvim / lua / plugins / lang / tex.lua
1 return {
2 -- Add BibTeX/LaTeX to treesitter
3 {
4 "nvim-treesitter/nvim-treesitter",
5 opts = function(_, opts)
6 opts.highlight = opts.highlight or {}
7 if type(opts.ensure_installed) == "table" then
8 vim.list_extend(opts.ensure_installed, { "bibtex" })
9 end
10 if type(opts.highlight.disable) == "table" then
11 vim.list_extend(opts.highlight.disable, { "latex" })
12 else
13 opts.highlight.disable = { "latex" }
14 end
15 end,
16 },
17
18 {
19 "lervag/vimtex",
20 lazy = false, -- lazy-loading will disable inverse search
21 config = function()
22 vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover
23 vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
24 end,
25 keys = {
26 { "<localLeader>l", "", desc = "+vimtex", ft = "tex" },
27 },
28 },
29
30 -- Correctly setup lspconfig for LaTeX 🚀
31 {
32 "neovim/nvim-lspconfig",
33 optional = true,
34 opts = {
35 servers = {
36 texlab = {
37 keys = {
38 { "<Leader>K", "<plug>(vimtex-doc-package)", desc = "Vimtex Docs", silent = true },
39 },
40 },
41 },
42 },
43 },
44 }