Nvim: vimtex-doc

This commit is contained in:
Tobias Manske 2023-08-29 18:21:20 +02:00
parent 3e3ffaa3d3
commit 06b642ae28
Signed by: tobias
GPG Key ID: 9164B527694A0709

View File

@ -16,6 +16,7 @@ require('packer').startup(function(use)
use { -- LSP Configuration & Plugins use { -- LSP Configuration & Plugins
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
optional = true,
requires = { requires = {
-- Automatically install LSPs to stdpath for neovim -- Automatically install LSPs to stdpath for neovim
'williamboman/mason.nvim', 'williamboman/mason.nvim',
@ -45,6 +46,23 @@ require('packer').startup(function(use)
}, },
} }
use {
'lervag/vimtex',
lazy = false,
config = function()
vim.api.nvim_create_autocmd({ "FileType" }, {
group = vim.api.nvim_create_augroup("lazyvim_vimtex_conceal", { clear = true }),
pattern = { "bib", "tex" },
callback = function()
vim.wo.conceallevel = 2
vim.keymap.set('n', "K", "<plug>(vimtex-doc-package)", { desc = "[TeX] Show Package Documentation", remap = true })
end,
})
vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- Disable K mapping conflicts with LSP.
vim.g.vimtex_doc_handlers = { 'vimtex#doc#handlers#texdoc' }
end
}
use { -- Highlight, edit, and navigate code use { -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
run = function() run = function()
@ -139,6 +157,19 @@ require('packer').startup(function(use)
end end
} }
use {
"folke/which-key.nvim",
config = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
require("which-key").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
end
}
use 'majutsushi/tagbar' use 'majutsushi/tagbar'
-- Parens -- Parens
@ -594,7 +625,7 @@ local on_attach = function(client, bufnr)
-- See `:help K` for why this keymap -- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation') nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation') nmap('<M-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
-- Lesser used LSP functionality -- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')