From e5300b3686decfc3fa50049e833d07eb265ef3c8 Mon Sep 17 00:00:00 2001 From: Daniele Pintore Date: Mon, 13 Apr 2026 23:53:34 +0200 Subject: [PATCH] feat: update nvim config to match 0.12 version --- .config/nvim/lazy-lock.json | 28 +-- .config/nvim/lsp/clangd.lua | 6 - .config/nvim/lsp/eslint.lua | 6 - .config/nvim/lsp/lua_ls.lua | 13 -- .config/nvim/lsp/pylsp.lua | 6 - .config/nvim/lsp/rust_analyzer.lua | 6 - .config/nvim/lsp/ts_ls.lua | 6 - .config/nvim/lua/configs/set.lua | 6 + .config/nvim/lua/plugins/fugitive.lua | 9 +- .config/nvim/lua/plugins/git-worktree.lua | 28 --- .config/nvim/lua/plugins/lsp.lua | 247 +++++++++----------- .config/nvim/lua/plugins/snippets.lua | 1 + .config/nvim/lua/plugins/telescope.lua | 43 ++-- .config/nvim/lua/plugins/tmux-navigator.lua | 20 -- .config/nvim/lua/plugins/tree-sitter.lua | 25 ++ .config/nvim/lua/plugins/treesitter.lua | 32 --- .config/nvim/lua/plugins/trouble.lua | 2 +- .config/nvim/lua/plugins/undotree.lua | 9 +- 18 files changed, 176 insertions(+), 317 deletions(-) delete mode 100644 .config/nvim/lsp/clangd.lua delete mode 100644 .config/nvim/lsp/eslint.lua delete mode 100644 .config/nvim/lsp/lua_ls.lua delete mode 100644 .config/nvim/lsp/pylsp.lua delete mode 100644 .config/nvim/lsp/rust_analyzer.lua delete mode 100644 .config/nvim/lsp/ts_ls.lua delete mode 100644 .config/nvim/lua/plugins/git-worktree.lua delete mode 100644 .config/nvim/lua/plugins/tmux-navigator.lua create mode 100644 .config/nvim/lua/plugins/tree-sitter.lua delete mode 100644 .config/nvim/lua/plugins/treesitter.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 2241c42..36daa7d 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,28 +1,18 @@ { - "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, - "catppuccin": { "branch": "main", "commit": "a7788416689dbefea659d9e9415c87926b0ba5d8" }, - "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "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" }, + "LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" }, + "catppuccin": { "branch": "main", "commit": "426dbebe06b5c69fd846ceb17b42e12f890aedf1" }, + "copilot.lua": { "branch": "master", "commit": "ad7e729e9a6348f7da482be0271d452dbc4c8e2c" }, "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "38499e0bda64bc0f3ec6e7f03f8e13dd11c0fa00" }, - "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, - "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, - "nvim-lspconfig": { "branch": "master", "commit": "d93772c34327e6a8cf72e5a7d95234ce6c36cd19" }, - "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "smart-splits.nvim": { "branch": "master", "commit": "96afd5d3b029ac354aaa369fb33b4613a0bbf2f0" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "0a3b42c3e503df87aef6d6513e13148381495c3a" }, + "mason.nvim": { "branch": "main", "commit": "b03fb0f20bc1d43daf558cda981a2be22e73ac42" }, + "nvim-lspconfig": { "branch": "master", "commit": "8a9378a822719346a0288fa004dab302ca3c0a8f" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "smart-splits.nvim": { "branch": "master", "commit": "09796a7ad0776c92518e0afae8688ef8d7f720e6" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "tree-sitter-manager.nvim": { "branch": "main", "commit": "fa63bc63ae08b661843d9976a43becfbd3daf76c" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" }, "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, - "vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" }, "vimwiki": { "branch": "dev", "commit": "72792615e739d0eb54a9c8f7e0a46a6e2407c9e8" } } diff --git a/.config/nvim/lsp/clangd.lua b/.config/nvim/lsp/clangd.lua deleted file mode 100644 index 2bb46d5..0000000 --- a/.config/nvim/lsp/clangd.lua +++ /dev/null @@ -1,6 +0,0 @@ -local cmp_lsp = require("cmp_nvim_lsp") -local capabilities = cmp_lsp.default_capabilities() - -vim.lsp.config('clangd', { - capabilities = capabilities, -}) diff --git a/.config/nvim/lsp/eslint.lua b/.config/nvim/lsp/eslint.lua deleted file mode 100644 index c8bcc6f..0000000 --- a/.config/nvim/lsp/eslint.lua +++ /dev/null @@ -1,6 +0,0 @@ -local cmp_lsp = require("cmp_nvim_lsp") -local capabilities = cmp_lsp.default_capabilities() - -vim.lsp.config('eslint', { - capabilities = capabilities, -}) diff --git a/.config/nvim/lsp/lua_ls.lua b/.config/nvim/lsp/lua_ls.lua deleted file mode 100644 index 0b7f7e7..0000000 --- a/.config/nvim/lsp/lua_ls.lua +++ /dev/null @@ -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" } - } - } - } -}) diff --git a/.config/nvim/lsp/pylsp.lua b/.config/nvim/lsp/pylsp.lua deleted file mode 100644 index c9d5184..0000000 --- a/.config/nvim/lsp/pylsp.lua +++ /dev/null @@ -1,6 +0,0 @@ -local cmp_lsp = require("cmp_nvim_lsp") -local capabilities = cmp_lsp.default_capabilities() - -vim.lsp.config('pylsp', { - capabilities = capabilities, -}) diff --git a/.config/nvim/lsp/rust_analyzer.lua b/.config/nvim/lsp/rust_analyzer.lua deleted file mode 100644 index c496cd2..0000000 --- a/.config/nvim/lsp/rust_analyzer.lua +++ /dev/null @@ -1,6 +0,0 @@ -local cmp_lsp = require("cmp_nvim_lsp") -local capabilities = cmp_lsp.default_capabilities() - -vim.lsp.config('rust_analyzer', { - capabilities = capabilities, -}) diff --git a/.config/nvim/lsp/ts_ls.lua b/.config/nvim/lsp/ts_ls.lua deleted file mode 100644 index 8dcadf2..0000000 --- a/.config/nvim/lsp/ts_ls.lua +++ /dev/null @@ -1,6 +0,0 @@ -local cmp_lsp = require("cmp_nvim_lsp") -local capabilities = cmp_lsp.default_capabilities() - -vim.lsp.config('ts_ls', { - capabilities = capabilities, -}) diff --git a/.config/nvim/lua/configs/set.lua b/.config/nvim/lua/configs/set.lua index 3c9abae..4a40ae3 100644 --- a/.config/nvim/lua/configs/set.lua +++ b/.config/nvim/lua/configs/set.lua @@ -27,3 +27,9 @@ vim.opt.isfname:append("@-@") vim.opt.updatetime = 50 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 diff --git a/.config/nvim/lua/plugins/fugitive.lua b/.config/nvim/lua/plugins/fugitive.lua index d2d7e88..cdc4eec 100644 --- a/.config/nvim/lua/plugins/fugitive.lua +++ b/.config/nvim/lua/plugins/fugitive.lua @@ -1,7 +1,8 @@ return { { 'tpope/vim-fugitive', - config = function () - vim.keymap.set("n", "gs", vim.cmd.Git); - end - } + keys = { + { "gs", vim.cmd.Git, desc = "Open Vim Fugitive" }, + }, + dependencies = { "nvim-lua/plenary.nvim" } + }, } diff --git a/.config/nvim/lua/plugins/git-worktree.lua b/.config/nvim/lua/plugins/git-worktree.lua deleted file mode 100644 index 9d60b0e..0000000 --- a/.config/nvim/lua/plugins/git-worktree.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - { - "ThePrimeagen/git-worktree.nvim", - opt = {}, - config = function() - require("telescope").load_extension("git_worktree") - end, - keys = { - { - "gw", - function() - require("telescope").extensions.git_worktree.git_worktrees() - end, - desc = "Git Worktree switch", - }, - { - "gn", - function() - require("telescope").extensions.git_worktree.create_git_worktree() - end, - desc = "Git Worktree create", - }, - }, - dependencies = { - "nvim-telescope/telescope.nvim", - } - } -} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 7d00e87..d0d87d3 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,152 +1,115 @@ return { - { - 'neovim/nvim-lspconfig', - keys = { - { "e", vim.diagnostic.open_float, mode = "n", desc = "Open diagnostic float" }, - { "[d", vim.diagnostic.goto_prev, mode = "n", desc = "Go to previous diagnostic" }, - { "]d", vim.diagnostic.goto_next, mode = "n", desc = "Go to next diagnostic" }, - { "q", vim.diagnostic.setloclist, mode = "n", desc = "Set location list with diagnostics" }, - }, - 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', '', vim.lsp.buf.signature_help, opts) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, opts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) - vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) - vim.keymap.set('n', 'f', function() - vim.lsp.buf.format { async = true } - end, opts) - end, - }) + { + 'neovim/nvim-lspconfig', + dependencies = { + { 'williamboman/mason.nvim', opts = {} }, + 'williamboman/mason-lspconfig.nvim', + }, + config = function() + vim.diagnostic.config({ float = { border = 'rounded' }, virtual_text = false }) - -- Set up diagnostics - vim.diagnostic.config({ - float = { - focusable = false, - style = 'minimal', - border = 'rounded', - source = 'always', - header = '', - prefix = '', - } - }) + -- Define Servers + local servers = { + lua_ls = { + settings = { + Lua = { + diagnostics = { + -- Recognize the `vim` global variable + globals = { "vim" } + }, + 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 - local cmp = require('cmp') - local cmp_select_behavior = { behavior = cmp.SelectBehavior.Select } + -- Prepare Native Capabilities + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.completion.completionItem.snippetSupport = true - cmp.setup({ - preselect = cmp.PreselectMode.None, - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = cmp.mapping.preset.insert({ - -- `Enter` key to confirm completion - [''] = 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 - [''] = cmp.mapping.complete(), + -- Setup Servers + require('mason-lspconfig').setup({ + ensure_installed = vim.tbl_keys(servers), + handlers = { + function(server_name) + local opts = servers[server_name] or {} + opts.capabilities = capabilities + vim.lsp.config(server_name, opts) + vim.lsp.enable(server_name) + end, + }, + }) - -- Tab to change item in completion menu - [''] = cmp.mapping.select_next_item(cmp_select_behavior), - -- Shift+Tab goes to the previus item in the completion menu - [''] = cmp.mapping.select_prev_item(cmp_select_behavior), + -- LspAttach (Keybindings & Activation) + vim.api.nvim_create_autocmd('LspAttach', { + callback = function(ev) + local opts = { buffer = ev.buf } + local client = vim.lsp.get_client_by_id(ev.data.client_id) - -- Navigate between documentation - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.scroll_docs(-4), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { 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 = {} }, - }, - }, + if client and client:supports_method('textDocument/completion') then + vim.lsp.completion.enable(true, client.id, ev.buf, { + autotrigger = true, + autoselect = false, + }) + end - { - 'mason-org/mason-lspconfig.nvim', - dependencies = { - { 'mason-org/mason.nvim', opts = {} }, - 'neovim/nvim-lspconfig', - }, + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) + vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, opts) + vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) - opts = { - ensure_installed = { 'eslint', 'ts_ls', 'rust_analyzer', 'lua_ls', 'clangd', 'pyright', 'ruff' }, - }, - }, + vim.keymap.set('i', '', function() + return vim.fn.pumvisible() ~= 0 and '' or '' + end, { expr = true, buffer = ev.buf }) - { - "L3MON4D3/LuaSnip", -- Snippet engine - keys = { - -- Move up in snippet fields - { - "", - function() - local ls = require("luasnip") - if ls.jumpable(-1) then - ls.jump(-1) - end - end, - mode = { "i", "s" }, - desc = "Jump to the previous snippet field", - silent = true, - }, - -- Move down in snippet fields - { - "", - function() - local ls = require("luasnip") - if ls.expand_or_jumpable() then - ls.expand_or_jump() - end - end, - mode = { "i", "s" }, - desc = "Expand or jump to the next snippet field", - silent = true, - }, - }, - }, + vim.keymap.set('i', '', function() + return vim.fn.pumvisible() ~= 0 and '' or '' + end, { expr = true, buffer = ev.buf }) + + vim.keymap.set('i', '', function() + return vim.fn.pumvisible() ~= 0 and '' or '' + end, { expr = true, buffer = ev.buf }) + + vim.keymap.set('i', '', function() + vim.api.nvim_feedkeys( + vim.api.nvim_replace_termcodes('', true, false, true), + 'n', false + ) + end, { buffer = ev.buf }) + + + -- Check if the server supports signature help and show function + -- signature when typing + -- Inside LspAttach: + -- if client and client:supports_method('textDocument/signatureHelp') then + -- -- Wrap the CursorMovedI in a group to prevent duplicates + -- local sig_group = vim.api.nvim_create_augroup('UserSignatureHelp', { clear = false }) + -- vim.api.nvim_clear_autocmds({ group = sig_group, buffer = ev.buf }) + + -- vim.api.nvim_create_autocmd("CursorMovedI", { + -- group = sig_group, + -- buffer = ev.buf, + -- callback = function() + -- pcall(vim.lsp.buf.signature_help, { focusable = false, silent = true }) + -- end, + -- }) + -- end + end, + }) + end, + } } diff --git a/.config/nvim/lua/plugins/snippets.lua b/.config/nvim/lua/plugins/snippets.lua index 1424db3..7b92fd4 100644 --- a/.config/nvim/lua/plugins/snippets.lua +++ b/.config/nvim/lua/plugins/snippets.lua @@ -3,6 +3,7 @@ return { "L3MON4D3/LuaSnip", dependencies = { "rafamadriz/friendly-snippets" }, version = "v2.*", -- Replace by the latest released major (first number of latest release) + enabled = false, -- install jsregexp (optional!). build = "make install_jsregexp", config = function () diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index f4624de..41b85a6 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,25 +1,22 @@ return { - "nvim-telescope/telescope.nvim", - tag = "0.1.5", - config = function() - require('telescope').setup({ - defaults = { - mappings = { - i = { - [''] = 'move_selection_previous', - [''] = 'move_selection_next', - [''] = 'preview_scrolling_up', - } - } - } - }) - local builtin = require('telescope.builtin') - vim.keymap.set('n', 'pf', builtin.find_files, {}) - vim.keymap.set('n', 'ps', function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }); - end) - vim.keymap.set('n', 'gf', builtin.git_files, {}) - vim.keymap.set('n', 'gr', builtin.lsp_references) - end, - dependencies = { "nvim-lua/plenary.nvim" } + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + opts = { + defaults = { + mappings = { + i = { + [''] = 'move_selection_previous', + [''] = 'move_selection_next', + [''] = 'preview_scrolling_up', + } + } + } + }, + keys = { + { "pf", function() require("telescope.builtin").find_files() end }, + { "ps", function() require("telescope.builtin").grep_string({ search = vim.fn.input("Grep > ") }) end }, + { "gf", function() require("telescope.builtin").git_files() end }, + { "gr", function() require("telescope.builtin").lsp_references() end }, + }, + dependencies = { "nvim-lua/plenary.nvim" } } diff --git a/.config/nvim/lua/plugins/tmux-navigator.lua b/.config/nvim/lua/plugins/tmux-navigator.lua deleted file mode 100644 index a6c805c..0000000 --- a/.config/nvim/lua/plugins/tmux-navigator.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - { - enabled = false, - "christoomey/vim-tmux-navigator", - cmd = { - "TmuxNavigateLeft", - "TmuxNavigateDown", - "TmuxNavigateUp", - "TmuxNavigateRight", - "TmuxNavigatePrevious", - }, - keys = { - { "", "TmuxNavigateLeft" }, - { "", "TmuxNavigateDown" }, - { "", "TmuxNavigateUp" }, - { "", "TmuxNavigateRight" }, - { "", "TmuxNavigatePrevious" }, - }, - } -} diff --git a/.config/nvim/lua/plugins/tree-sitter.lua b/.config/nvim/lua/plugins/tree-sitter.lua new file mode 100644 index 0000000..2775033 --- /dev/null +++ b/.config/nvim/lua/plugins/tree-sitter.lua @@ -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 + }, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua deleted file mode 100644 index ebc2329..0000000 --- a/.config/nvim/lua/plugins/treesitter.lua +++ /dev/null @@ -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 - } -} diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua index d0c3db7..d979d52 100644 --- a/.config/nvim/lua/plugins/trouble.lua +++ b/.config/nvim/lua/plugins/trouble.lua @@ -1,6 +1,6 @@ return { "folke/trouble.nvim", - opts = {}, -- for default options, refer to the configuration section for custom setup. + opts = {}, cmd = "Trouble", keys = { { diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua index 8c7e557..9ba1f1c 100644 --- a/.config/nvim/lua/plugins/undotree.lua +++ b/.config/nvim/lua/plugins/undotree.lua @@ -1,7 +1,6 @@ return { - {'mbbill/undotree', - config = function () - vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) - end - } + 'mbbill/undotree', + keys = { + { "u", vim.cmd.UndotreeToggle, desc = "Toggle Undotree" }, + }, }