nvim config update

This commit is contained in:
Never Gude 2026-01-19 13:44:27 +01:00
parent 44d00ebb21
commit 66b146e4b5
3 changed files with 34 additions and 27 deletions

Binary file not shown.

View file

@ -58,6 +58,9 @@ vim.keymap.set({ "n" }, "<A-j>", "<C-w>j")
vim.keymap.set({ "n" }, "<A-k>", "<C-w>k")
vim.keymap.set({ "n" }, "<A-l>", "<C-w>l")
vim.keymap.set('n', '<leader>ld', vim.lsp.buf.definition, { desc = 'vim.lsp.buf.definition()' })
vim.keymap.set('n', '<leader>lf', vim.lsp.buf.format, { desc = 'vim.lsp.buf.format()' })
-- [[ Basic Autocommands ]].
-- See `:h lua-guide-autocommands`, `:h autocmd`, `:h nvim_create_autocmd()`
-- Highlight when yanking (copying) text.
@ -134,14 +137,14 @@ vim.filetype.add({
})
-- Install nvim-treesitter
vim.pack.add({"https://github.com/nvim-treesitter/nvim-treesitter"})
vim.pack.add({ "https://github.com/nvim-treesitter/nvim-treesitter" })
require("nvim-treesitter").install('latex', 'lua', 'c', 'ocaml')
-- See `:h lsp-quickstart` for more details.
vim.pack.add({"https://github.com/mason-org/mason.nvim"})
vim.pack.add({ "https://github.com/mason-org/mason.nvim" })
require("mason").setup()
vim.lsp.enable({'lua_ls', 'texlab', 'clangd', 'ocaml-lsp'})
vim.lsp.enable({ 'lua_ls', 'texlab', 'clangd', 'ocaml-lsp' })
vim.diagnostic.config({
@ -156,11 +159,11 @@ vim.diagnostic.config({
virtual_text = true, -- Show inline diagnostics
})
vim.keymap.set("n", "<leader>dn", "]d", {desc = "Jump to next diagnostic"})
vim.keymap.set("n", "<leader>dp", "[d", {desc = "Jump to previous diagnostic"})
vim.keymap.set("n", "<leader>dN", "]D", {desc = "Jump to last diagnostic"})
vim.keymap.set("n", "<leader>dP", "[D", {desc = "Jump to first diagnostic"})
vim.keymap.set("n", "<leader>ds", "<C-w>d", {desc = "Display diagnostic on current line"})
vim.keymap.set("n", "<leader>dn", "]d", { desc = "Jump to next diagnostic" })
vim.keymap.set("n", "<leader>dp", "[d", { desc = "Jump to previous diagnostic" })
vim.keymap.set("n", "<leader>dN", "]D", { desc = "Jump to last diagnostic" })
vim.keymap.set("n", "<leader>dP", "[D", { desc = "Jump to first diagnostic" })
vim.keymap.set("n", "<leader>ds", "<C-w>d", { desc = "Display diagnostic on current line" })
-- [[ UI Configuration ]]
vim.pack.add({
@ -181,6 +184,11 @@ vim.o.winborder = "none"
-- Use mini.completion
require("mini.completion").setup()
local imap_expr = function(lhs, rhs)
vim.keymap.set('i', lhs, rhs, { expr = true })
end
imap_expr('<Tab>', [[pumvisible() ? "\<C-n>" : "\<Tab>"]])
imap_expr('<S-Tab>', [[pumvisible() ? "\<C-p>" : "\<S-Tab>"]])
-- Snipped integration for mini.completion
require("mini.snippets").setup()
@ -266,4 +274,3 @@ hipatterns.setup({
-- Use mini.notify
require("mini.notify").setup()

View file

@ -140,13 +140,13 @@ return {
rootDirectory = nil,
build = {
executable = 'latexmk',
args = { '-pdf', '-interaction=nonstopmode', '-synctex=1', '%f' },
onSave = false,
forwardSearchAfter = false,
args = { '-lualatex', '-interaction=nonstopmode', '-synctex=1', '%f' },
onSave = true,
forwardSearchAfter = true,
},
forwardSearch = {
executable = nil,
args = {},
executable = 'okular',
args = {'--unique', 'file:%p#src:%l%f'},
},
chktex = {
onOpenAndSave = false,