feat: update nvim config to match 0.12 version

This commit is contained in:
2026-04-13 23:53:34 +02:00
parent 9f62daedcd
commit e5300b3686
18 changed files with 176 additions and 317 deletions

View File

@@ -1,28 +1,18 @@
{ {
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, "LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" },
"catppuccin": { "branch": "main", "commit": "a7788416689dbefea659d9e9415c87926b0ba5d8" }, "catppuccin": { "branch": "main", "commit": "426dbebe06b5c69fd846ceb17b42e12f890aedf1" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "copilot.lua": { "branch": "master", "commit": "ad7e729e9a6348f7da482be0271d452dbc4c8e2c" },
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"copilot.lua": { "branch": "master", "commit": "538f15c4eaad8661389a4a0d1ace2d6e079fac29" },
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" },
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "38499e0bda64bc0f3ec6e7f03f8e13dd11c0fa00" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "0a3b42c3e503df87aef6d6513e13148381495c3a" },
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, "mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" },
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, "nvim-lspconfig": { "branch": "master", "commit": "8a9378a822719346a0288fa004dab302ca3c0a8f" },
"nvim-lspconfig": { "branch": "master", "commit": "d93772c34327e6a8cf72e5a7d95234ce6c36cd19" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, "smart-splits.nvim": { "branch": "master", "commit": "09796a7ad0776c92518e0afae8688ef8d7f720e6" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"smart-splits.nvim": { "branch": "master", "commit": "96afd5d3b029ac354aaa369fb33b4613a0bbf2f0" },
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"tree-sitter-manager.nvim": { "branch": "main", "commit": "fa63bc63ae08b661843d9976a43becfbd3daf76c" },
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
"undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" }, "undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" },
"vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" },
"vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" },
"vimwiki": { "branch": "dev", "commit": "72792615e739d0eb54a9c8f7e0a46a6e2407c9e8" } "vimwiki": { "branch": "dev", "commit": "72792615e739d0eb54a9c8f7e0a46a6e2407c9e8" }
} }

View File

@@ -1,6 +0,0 @@
local cmp_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_lsp.default_capabilities()
vim.lsp.config('clangd', {
capabilities = capabilities,
})

View File

@@ -1,6 +0,0 @@
local cmp_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_lsp.default_capabilities()
vim.lsp.config('eslint', {
capabilities = capabilities,
})

View File

@@ -1,13 +0,0 @@
local cmp_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_lsp.default_capabilities()
vim.lsp.config('lua_ls', {
capabilities = capabilities,
settings = {
Lua = {
diagnostics = {
globals = { "vim" }
}
}
}
})

View File

@@ -1,6 +0,0 @@
local cmp_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_lsp.default_capabilities()
vim.lsp.config('pylsp', {
capabilities = capabilities,
})

View File

@@ -1,6 +0,0 @@
local cmp_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_lsp.default_capabilities()
vim.lsp.config('rust_analyzer', {
capabilities = capabilities,
})

View File

@@ -1,6 +0,0 @@
local cmp_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_lsp.default_capabilities()
vim.lsp.config('ts_ls', {
capabilities = capabilities,
})

View File

@@ -27,3 +27,9 @@ vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50 vim.opt.updatetime = 50
vim.opt.colorcolumn = "80" vim.opt.colorcolumn = "80"
-- Autocomplete menu settings
vim.opt.completeopt = { "menuone", "noselect", "popup" }
vim.opt.autocomplete = true
vim.opt.complete = "o" -- Include only omnifunc results
vim.opt.pumheight = 5

View File

@@ -1,7 +1,8 @@
return { return {
{ 'tpope/vim-fugitive', { 'tpope/vim-fugitive',
config = function () keys = {
vim.keymap.set("n", "<leader>gs", vim.cmd.Git); { "<leader>gs", vim.cmd.Git, desc = "Open Vim Fugitive" },
end },
} dependencies = { "nvim-lua/plenary.nvim" }
},
} }

View File

@@ -1,28 +0,0 @@
return {
{
"ThePrimeagen/git-worktree.nvim",
opt = {},
config = function()
require("telescope").load_extension("git_worktree")
end,
keys = {
{
"<leader>gw",
function()
require("telescope").extensions.git_worktree.git_worktrees()
end,
desc = "Git Worktree switch",
},
{
"<leader>gn",
function()
require("telescope").extensions.git_worktree.create_git_worktree()
end,
desc = "Git Worktree create",
},
},
dependencies = {
"nvim-telescope/telescope.nvim",
}
}
}

View File

@@ -1,152 +1,115 @@
return { return {
{ {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
keys = { dependencies = {
{ "<space>e", vim.diagnostic.open_float, mode = "n", desc = "Open diagnostic float" }, { 'williamboman/mason.nvim', opts = {} },
{ "[d", vim.diagnostic.goto_prev, mode = "n", desc = "Go to previous diagnostic" }, 'williamboman/mason-lspconfig.nvim',
{ "]d", vim.diagnostic.goto_next, mode = "n", desc = "Go to next diagnostic" }, },
{ "<space>q", vim.diagnostic.setloclist, mode = "n", desc = "Set location list with diagnostics" }, config = function()
}, vim.diagnostic.config({ float = { border = 'rounded' }, virtual_text = false })
config = function()
-- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('i', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', '<leader>f', function()
vim.lsp.buf.format { async = true }
end, opts)
end,
})
-- Set up diagnostics -- Define Servers
vim.diagnostic.config({ local servers = {
float = { lua_ls = {
focusable = false, settings = {
style = 'minimal', Lua = {
border = 'rounded', diagnostics = {
source = 'always', -- Recognize the `vim` global variable
header = '', globals = { "vim" }
prefix = '', },
} workspace = {
}) -- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
telemetry = {
enable = false,
},
}
}
},
pylsp = {},
ts_ls = {},
rust_analyzer = {},
eslint = {},
clangd = {},
}
-- Set up cmp -- Prepare Native Capabilities
local cmp = require('cmp') local capabilities = vim.lsp.protocol.make_client_capabilities()
local cmp_select_behavior = { behavior = cmp.SelectBehavior.Select } capabilities.textDocument.completion.completionItem.snippetSupport = true
cmp.setup({ -- Setup Servers
preselect = cmp.PreselectMode.None, require('mason-lspconfig').setup({
snippet = { ensure_installed = vim.tbl_keys(servers),
-- REQUIRED - you must specify a snippet engine handlers = {
expand = function(args) function(server_name)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users. local opts = servers[server_name] or {}
end, opts.capabilities = capabilities
}, vim.lsp.config(server_name, opts)
mapping = cmp.mapping.preset.insert({ vim.lsp.enable(server_name)
-- `Enter` key to confirm completion end,
['<CR>'] = cmp.mapping({ },
i = function(fallback) })
if cmp.visible() and cmp.get_active_entry() then
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
else
fallback()
end
end,
s = cmp.mapping.confirm({ select = true }),
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
}),
-- Alt+Space to trigger completion menu
['<M-Space>'] = cmp.mapping.complete(),
-- Tab to change item in completion menu -- LspAttach (Keybindings & Activation)
['<Tab>'] = cmp.mapping.select_next_item(cmp_select_behavior), vim.api.nvim_create_autocmd('LspAttach', {
-- Shift+Tab goes to the previus item in the completion menu callback = function(ev)
['<S-Tab>'] = cmp.mapping.select_prev_item(cmp_select_behavior), local opts = { buffer = ev.buf }
local client = vim.lsp.get_client_by_id(ev.data.client_id)
-- Navigate between documentation if client and client:supports_method('textDocument/completion') then
['<C-f>'] = cmp.mapping.scroll_docs(4), vim.lsp.completion.enable(true, client.id, ev.buf, {
['<C-d>'] = cmp.mapping.scroll_docs(-4), autotrigger = true,
}), autoselect = false,
sources = cmp.config.sources({ })
{ name = 'nvim_lsp' }, end
{ name = 'path' },
{ name = 'luasnip' },
{ name = 'buffer' },
-- Copilot Source
{ name = "copilot", group_index = 2 },
}),
})
end,
dependencies = {
'L3MON4D3/LuaSnip',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'hrsh7th/nvim-cmp',
'saadparwaiz1/cmp_luasnip',
{ 'j-hui/fidget.nvim', opts = {} },
},
},
{ vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
'mason-org/mason-lspconfig.nvim', vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
dependencies = { vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
{ 'mason-org/mason.nvim', opts = {} }, vim.keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, opts)
'neovim/nvim-lspconfig', vim.keymap.set('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, opts)
}, vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, opts)
opts = { vim.keymap.set('i', '<CR>', function()
ensure_installed = { 'eslint', 'ts_ls', 'rust_analyzer', 'lua_ls', 'clangd', 'pyright', 'ruff' }, return vim.fn.pumvisible() ~= 0 and '<C-y>' or '<CR>'
}, end, { expr = true, buffer = ev.buf })
},
{ vim.keymap.set('i', '<Tab>', function()
"L3MON4D3/LuaSnip", -- Snippet engine return vim.fn.pumvisible() ~= 0 and '<C-n>' or '<Tab>'
keys = { end, { expr = true, buffer = ev.buf })
-- Move up in snippet fields
{ vim.keymap.set('i', '<S-Tab>', function()
"<C-k>", return vim.fn.pumvisible() ~= 0 and '<C-p>' or '<S-Tab>'
function() end, { expr = true, buffer = ev.buf })
local ls = require("luasnip")
if ls.jumpable(-1) then vim.keymap.set('i', '<C-k>', function()
ls.jump(-1) vim.api.nvim_feedkeys(
end vim.api.nvim_replace_termcodes('<C-x><C-o>', true, false, true),
end, 'n', false
mode = { "i", "s" }, )
desc = "Jump to the previous snippet field", end, { buffer = ev.buf })
silent = true,
},
-- Move down in snippet fields -- Check if the server supports signature help and show function
{ -- signature when typing
"<C-j>", -- Inside LspAttach:
function() -- if client and client:supports_method('textDocument/signatureHelp') then
local ls = require("luasnip") -- -- Wrap the CursorMovedI in a group to prevent duplicates
if ls.expand_or_jumpable() then -- local sig_group = vim.api.nvim_create_augroup('UserSignatureHelp', { clear = false })
ls.expand_or_jump() -- vim.api.nvim_clear_autocmds({ group = sig_group, buffer = ev.buf })
end
end, -- vim.api.nvim_create_autocmd("CursorMovedI", {
mode = { "i", "s" }, -- group = sig_group,
desc = "Expand or jump to the next snippet field", -- buffer = ev.buf,
silent = true, -- callback = function()
}, -- pcall(vim.lsp.buf.signature_help, { focusable = false, silent = true })
}, -- end,
}, -- })
-- end
end,
})
end,
}
} }

View File

@@ -3,6 +3,7 @@ return {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets" }, dependencies = { "rafamadriz/friendly-snippets" },
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release) version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
enabled = false,
-- install jsregexp (optional!). -- install jsregexp (optional!).
build = "make install_jsregexp", build = "make install_jsregexp",
config = function () config = function ()

View File

@@ -1,25 +1,22 @@
return { return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
tag = "0.1.5", tag = "0.1.5",
config = function() opts = {
require('telescope').setup({ defaults = {
defaults = { mappings = {
mappings = { i = {
i = { ['<Tab>'] = 'move_selection_previous',
['<Tab>'] = 'move_selection_previous', ['<S-Tab>'] = 'move_selection_next',
['<S-Tab>'] = 'move_selection_next', ['<C-f>'] = 'preview_scrolling_up',
['<C-f>'] = 'preview_scrolling_up', }
} }
} }
} },
}) keys = {
local builtin = require('telescope.builtin') { "<leader>pf", function() require("telescope.builtin").find_files() end },
vim.keymap.set('n', '<leader>pf', builtin.find_files, {}) { "<leader>ps", function() require("telescope.builtin").grep_string({ search = vim.fn.input("Grep > ") }) end },
vim.keymap.set('n', '<leader>ps', function() { "<leader>gf", function() require("telescope.builtin").git_files() end },
builtin.grep_string({ search = vim.fn.input("Grep > ") }); { "<leader>gr", function() require("telescope.builtin").lsp_references() end },
end) },
vim.keymap.set('n', '<leader>gf', builtin.git_files, {}) dependencies = { "nvim-lua/plenary.nvim" }
vim.keymap.set('n', 'gr', builtin.lsp_references)
end,
dependencies = { "nvim-lua/plenary.nvim" }
} }

View File

@@ -1,20 +0,0 @@
return {
{
enabled = false,
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
}
}

View File

@@ -0,0 +1,25 @@
return {
"romus204/tree-sitter-manager.nvim",
dependencies = {}, -- tree-sitter CLI must be installed system-wide
opts = {
ensure_installed = {
"bash",
"c",
"cpp",
"css",
"go",
"html",
"javascript",
"json",
"lua",
"python",
"rust",
"typescript",
"yaml"
}, -- list of parsers to install at the start of a neovim session
-- Default Options
-- ensure_installed = {}, -- list of parsers to install at the start of a neovim session
-- border = nil, -- border style for the window (e.g. "rounded", "single"), if nil, use the default border style defined by 'vim.o.winborder'. See :h 'winborder' for more info.
-- auto_install = false, -- if enabled, install missing parsers when editing a new file
},
}

View File

@@ -1,32 +0,0 @@
return {
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate",
config = function()
require('nvim-treesitter.configs').setup({
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = {"javascript", "typescript", "rust", "c", "lua", "vim", "vimdoc", "query" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (for "all")
-- ignore_install = { "javascript" },
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
})
end
}
}

View File

@@ -1,6 +1,6 @@
return { return {
"folke/trouble.nvim", "folke/trouble.nvim",
opts = {}, -- for default options, refer to the configuration section for custom setup. opts = {},
cmd = "Trouble", cmd = "Trouble",
keys = { keys = {
{ {

View File

@@ -1,7 +1,6 @@
return { return {
{'mbbill/undotree', 'mbbill/undotree',
config = function () keys = {
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle) { "<leader>u", vim.cmd.UndotreeToggle, desc = "Toggle Undotree" },
end },
}
} }