From f5c919558b57afa7bdb921f4538c31ad9fcef9c2 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:05:40 +0200 Subject: [PATCH 001/140] which-key v3 update (#1022) * which-key v3 update * remove unneeded brackets from which-key registration --- init.lua | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 88658ef3..907ef90c 100644 --- a/init.lua +++ b/init.lua @@ -280,19 +280,15 @@ require('lazy').setup({ require('which-key').setup() -- Document existing key chains - require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, + require('which-key').add { + { 'c', group = '[C]ode' }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, } - -- visual mode - require('which-key').register({ - ['h'] = { 'Git [H]unk' }, - }, { mode = 'v' }) end, }, From 3e55ff1a83dc7a9813d8f2220cefd90b07aacdab Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 16 Jul 2024 18:06:47 +0200 Subject: [PATCH 002/140] fix(lazy): added error handling for bootstrap (#1001) --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 907ef90c..f5205caf 100644 --- a/init.lua +++ b/init.lua @@ -209,7 +209,10 @@ vim.api.nvim_create_autocmd('TextYankPost', { local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + if vim.v.shell_error ~= 0 then + error('Error cloning lazy.nvim:\n' .. out) + end end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath) From 2df5137e59c28fc9148148db8ed4a9f7abf73b4f Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 17 Jul 2024 21:37:31 -0400 Subject: [PATCH 003/140] fix: add required parsers from nvim-treesitter --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index f5205caf..624e23d8 100644 --- a/init.lua +++ b/init.lua @@ -834,7 +834,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { From 202910d3fae9a9b9e4f3f390fc69e36e6350180c Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 21 Jul 2024 22:22:10 +0200 Subject: [PATCH 004/140] Fix neo-tree keymap description (#932) The lazy.nvim keys parameter does not need the `desc` to be inside a table in the way that vim.keymap.set() does. With this fix the keymap description will be properly shown for example in telescope keymap search --- lua/kickstart/plugins/neo-tree.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c793b885..f126d68a 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -11,7 +11,7 @@ return { }, cmd = 'Neotree', keys = { - { '\\', ':Neotree reveal', { desc = 'NeoTree reveal' } }, + { '\\', ':Neotree reveal', desc = 'NeoTree reveal' }, }, opts = { filesystem = { From 1cdf6fb377f4594f803b5aa675777635b6d18074 Mon Sep 17 00:00:00 2001 From: Tom Kuson Date: Sun, 21 Jul 2024 22:22:44 +0200 Subject: [PATCH 005/140] Remove redundant require (#959) --- lua/kickstart/plugins/lint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 7f0dc42f..ca9bc237 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -47,7 +47,7 @@ return { vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, callback = function() - require('lint').try_lint() + lint.try_lint() end, }) end, From 4bbca64157af07cf0550c16d336cfd7513d10946 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:24:57 +0200 Subject: [PATCH 006/140] Make debug lazy loadable (#978) --- lua/kickstart/plugins/debug.lua | 35 +++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 31dfecf5..196f2c6d 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -24,6 +24,28 @@ return { -- Add your own debuggers here 'leoluz/nvim-dap-go', }, + keys = function(_, keys) + local dap = require 'dap' + local dapui = require 'dapui' + return { + -- Basic debugging keymaps, feel free to change to your liking! + { '', dap.continue, desc = 'Debug: Start/Continue' }, + { '', dap.step_into, desc = 'Debug: Step Into' }, + { '', dap.step_over, desc = 'Debug: Step Over' }, + { '', dap.step_out, desc = 'Debug: Step Out' }, + { 'b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, + { + 'B', + function() + dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') + end, + desc = 'Debug: Set Breakpoint', + }, + -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. + { '', dapui.toggle, desc = 'Debug: See last session result.' }, + unpack(keys), + } + end, config = function() local dap = require 'dap' local dapui = require 'dapui' @@ -45,16 +67,6 @@ return { }, } - -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Start/Continue' }) - vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) - vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) - vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) - vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) - vim.keymap.set('n', 'B', function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, { desc = 'Debug: Set Breakpoint' }) - -- Dap UI setup -- For more information, see |:help nvim-dap-ui| dapui.setup { @@ -77,9 +89,6 @@ return { }, } - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - vim.keymap.set('n', '', dapui.toggle, { desc = 'Debug: See last session result.' }) - dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close From c405d3fd4f5e105c3c7a43dcddcb96f01ca70dee Mon Sep 17 00:00:00 2001 From: Artyom <84637383+MZhuvka@users.noreply.github.com> Date: Sun, 21 Jul 2024 23:33:26 +0300 Subject: [PATCH 007/140] Update README.md | %userprofile%\appdata\local -> %localappdata% (#963) - Replace `%userprofile%\AppData\Local\nvim\` and `$env:USERPROFILE\AppData\Local\nvim` to `%localappdata%\nvim` and `$env:LOCALAPPDATA\nvim respectfully` --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f445b65e..3f19854c 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,8 @@ Neovim's configurations are located under the following paths, depending on your | OS | PATH | | :- | :--- | | Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` | -| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` | +| Windows (cmd)| `%localappdata%\nvim\` | +| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` | #### Recommended Step @@ -77,13 +77,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO If you're using `cmd.exe`: ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git %localappdata%\nvim\ ``` If you're using `powershell.exe` ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git $env:LOCALAPPDATA\nvim\ ``` From b36d84ddf0b88ab71593d25bf68b48cae9d578eb Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:34:17 +0200 Subject: [PATCH 008/140] Make conform.nvim be lazy-loadable again (#977) The PR that disabled lazy loading (#818) was to fix plugin not being loaded before write. This sets up lazy to load conform before write. --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 624e23d8..de4264b2 100644 --- a/init.lua +++ b/init.lua @@ -626,7 +626,8 @@ require('lazy').setup({ { -- Autoformat 'stevearc/conform.nvim', - lazy = false, + event = { 'BufWritePre' }, + cmd = { 'ConformInfo' }, keys = { { 'f', From 07a9f446a30487439a6c922a7b4a4aa5756ee1d9 Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Sun, 21 Jul 2024 13:34:51 -0700 Subject: [PATCH 009/140] Fix comment about mini.ai example (#985) This example wasn't using `'` so this makes more sense --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index de4264b2..8e252894 100644 --- a/init.lua +++ b/init.lua @@ -801,7 +801,7 @@ require('lazy').setup({ -- -- Examples: -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [']quote + -- - yinq - [Y]ank [I]nside [N]ext [Q]uote -- - ci' - [C]hange [I]nside [']quote require('mini.ai').setup { n_lines = 500 } From 7513ec8a7dd579957ce2d9b44e05c1da18d7d0e3 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Mon, 22 Jul 2024 02:35:07 +0200 Subject: [PATCH 010/140] Neovim 0.10 updates (#936) * Neovim 0.10 updates Provide the buffer for which to enable inlay hints Co-authored-by: Matt Mirus * refactor: replace vim.loop with vim.uv * Upgrade folke/neodev (sunsetting) to folke/lazydev * Update checkhealth for 0.10 release --------- Co-authored-by: Matt Mirus Co-authored-by: mrr11k Co-authored-by: Seb Tomasini --- init.lua | 29 +++++++++++------------------ lua/kickstart/health.lua | 6 +++--- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/init.lua b/init.lua index 8e252894..a1c900f5 100644 --- a/init.lua +++ b/init.lua @@ -162,9 +162,6 @@ vim.opt.hlsearch = true vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier @@ -207,7 +204,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not vim.loop.fs_stat(lazypath) then +if not vim.uv.fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } if vim.v.shell_error ~= 0 then @@ -237,11 +234,6 @@ require('lazy').setup({ -- -- Use `opts = {}` to force a plugin to be loaded. -- - -- This is equivalent to: - -- require('Comment').setup({}) - - -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -419,9 +411,9 @@ require('lazy').setup({ -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, - -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { 'folke/lazydev.nvim', ft = 'lua', opts = {} }, }, config = function() -- Brief aside: **What is LSP?** @@ -498,10 +490,6 @@ require('lazy').setup({ -- or a suggestion from your LSP for this to activate. map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') - -- Opens a popup that displays documentation about the word under your cursor - -- See `:help K` for why this keymap. - map('K', vim.lsp.buf.hover, 'Hover Documentation') - -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') @@ -512,7 +500,7 @@ require('lazy').setup({ -- -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client.server_capabilities.documentHighlightProvider then + if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -539,9 +527,9 @@ require('lazy').setup({ -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code - if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then + if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') end end, @@ -765,6 +753,11 @@ require('lazy').setup({ -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps }, sources = { + { + name = 'lazydev', + -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it + group_index = 0, + }, { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' }, diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index 04df77b3..b59d0864 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -6,13 +6,13 @@ --]] local check_version = function() - local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch) - if not vim.version.cmp then + local verstr = tostring(vim.version()) + if not vim.version.ge then vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) return end - if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then + if vim.version.ge(vim.version(), '0.10-dev') then vim.health.ok(string.format("Neovim version is: '%s'", verstr)) else vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) From 620732789b56ba7770bf12211ad2820309136ff1 Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Sun, 21 Jul 2024 19:08:09 -0700 Subject: [PATCH 011/140] Update lazydev config to fix "Undefined field `fs_stat`" LSP error (#1040) 7513ec8a7dd579957ce2d9b44e05c1da18d7d0e3 switched from neodev to lazydev, but in the process it introduced an LSP error in `init.lua`, which degrades the desired "first timer" experience of kickstart.nvim. This commit follows the configuration suggested in https://github.com/folke/lazydev.nvim/tree/6184ebbbc8045d70077659b7d30c705a588dc62f#-installation which resolves the LSP error. --- init.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index a1c900f5..77181309 100644 --- a/init.lua +++ b/init.lua @@ -413,7 +413,17 @@ require('lazy').setup({ -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/lazydev.nvim', ft = 'lua', opts = {} }, + { + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + }, + }, + }, + { 'Bilal2453/luvit-meta', lazy = true }, }, config = function() -- Brief aside: **What is LSP?** From 56b9114bf29cdc0c0f5de78b5deae1fe0ab65db1 Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:00:35 -0700 Subject: [PATCH 013/140] Update comment about the toggle inlay hints keymap (#1041) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 77181309..0d380e8d 100644 --- a/init.lua +++ b/init.lua @@ -533,7 +533,7 @@ require('lazy').setup({ }) end - -- The following autocommand is used to enable inlay hints in your + -- The following code creates a keymap to toggle inlay hints in your -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code From f00b2866de46fab6fcac519b70dbec1d0c683f9b Mon Sep 17 00:00:00 2001 From: Arvin Verain Date: Mon, 29 Jul 2024 00:39:54 +0800 Subject: [PATCH 014/140] Remove redundant hlsearch option (#1058) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 0d380e8d..bfbb676a 100644 --- a/init.lua +++ b/init.lua @@ -157,8 +157,8 @@ vim.opt.scrolloff = 10 -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` --- Set highlight on search, but clear on pressing in normal mode -vim.opt.hlsearch = true +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps From 1cef2325e0d28ec99c1d8446be4ea58b73028901 Mon Sep 17 00:00:00 2001 From: Brandon Clark Date: Sun, 28 Jul 2024 12:43:08 -0400 Subject: [PATCH 015/140] Modify conform comments to prevent deprecation warning when used (#1057) --- init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index bfbb676a..d4d7b8c2 100644 --- a/init.lua +++ b/init.lua @@ -653,9 +653,8 @@ require('lazy').setup({ -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- - -- You can use a sub-list to tell conform to run *until* a formatter - -- is found. - -- javascript = { { "prettierd", "prettier" } }, + -- You can use 'stop_after_first' to run the first available formatter from the list + -- javascript = { "prettierd", "prettier", stop_after_first = true }, }, }, }, From fd66454c4a02abb44568159e7447060b962e1b5d Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Sun, 28 Jul 2024 17:39:34 -0400 Subject: [PATCH 016/140] refactor: remove lazydev and luvit-meta as lsp dependencies (#1047) --- init.lua | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index d4d7b8c2..5f442b6b 100644 --- a/init.lua +++ b/init.lua @@ -399,7 +399,22 @@ require('lazy').setup({ end, }, - { -- LSP Configuration & Plugins + -- LSP Plugins + { + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins + -- used for completion, annotations and signatures of Neovim apis + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + }, + }, + }, + { 'Bilal2453/luvit-meta', lazy = true }, + { + -- Main LSP Configuration 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs and related tools to stdpath for Neovim @@ -410,20 +425,6 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, - - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - { - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = 'luvit-meta/library', words = { 'vim%.uv' } }, - }, - }, - }, - { 'Bilal2453/luvit-meta', lazy = true }, }, config = function() -- Brief aside: **What is LSP?** From 84cc12354dbe0ebda180d445f54820def8c4638f Mon Sep 17 00:00:00 2001 From: abeldekat <58370433+abeldekat@users.noreply.github.com> Date: Sun, 28 Jul 2024 21:41:34 +0000 Subject: [PATCH 017/140] performance: defer clipboard because xsel and pbcopy can be slow (#1049) --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 5f442b6b..ee1d3b49 100644 --- a/init.lua +++ b/init.lua @@ -111,9 +111,12 @@ vim.opt.mouse = 'a' vim.opt.showmode = false -- Sync clipboard between OS and Neovim. +-- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.opt.clipboard = 'unnamedplus' +vim.schedule(function() + vim.opt.clipboard = 'unnamedplus' +end) -- Enable break indent vim.opt.breakindent = true From bb9f84ca8f37c97ae248575680fc73c72ced471d Mon Sep 17 00:00:00 2001 From: jstrot <44594069+jstrot@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:01:19 -0400 Subject: [PATCH 018/140] Remove treesitter prefer_git option (#1061) - It's not safe and can corrupt other git repos - nvim-treesiter maintainers consider `prefer_git` as deprecated and no longer needed. See nvim-treesitter PR for details: https://github.com/nvim-treesitter/nvim-treesitter/pull/6959 --- init.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/init.lua b/init.lua index ee1d3b49..04c5896c 100644 --- a/init.lua +++ b/init.lua @@ -856,8 +856,6 @@ require('lazy').setup({ config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - -- Prefer git instead of curl in order to improve connectivity in some environments - require('nvim-treesitter.install').prefer_git = true ---@diagnostic disable-next-line: missing-fields require('nvim-treesitter.configs').setup(opts) From 186018483039b20dc39d7991e4fb28090dd4750e Mon Sep 17 00:00:00 2001 From: jstrot <44594069+jstrot@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:02:37 -0400 Subject: [PATCH 019/140] Add explicit dependency of nvim-lspconfig on cmp-nvim-lsp (#1042) --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 04c5896c..220d3045 100644 --- a/init.lua +++ b/init.lua @@ -428,6 +428,9 @@ require('lazy').setup({ -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, + + -- Allows extra capabilities provided by nvim-cmp + 'hrsh7th/cmp-nvim-lsp', }, config = function() -- Brief aside: **What is LSP?** From c1ae9092cbd2b75ee25284a594209a8147609cef Mon Sep 17 00:00:00 2001 From: theoboldalex <44616505+theoboldalex@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:49:25 +0100 Subject: [PATCH 020/140] Update README.md (#1091) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f19854c..0b56eab3 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ External Requirements: - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true - Language Setup: - - If want to write Typescript, you need `npm` - - If want to write Golang, you will need `go` + - If you want to write Typescript, you need `npm` + - If you want to write Golang, you will need `go` - etc. > **NOTE** From 554a054bf9e0f04b637b7913b17327606f0ec9d0 Mon Sep 17 00:00:00 2001 From: Matt Gallagher <46973220+mattgallagher92@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:53:57 +0100 Subject: [PATCH 021/140] Add note in README about lazy-lock.json (#1090) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0b56eab3..53ae459c 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,10 @@ fork to your machine using one of the commands below, depending on your OS. > Your fork's url will be something like this: > `https://github.com//kickstart.nvim.git` +You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file +too - it's ignored in the kickstart repo to make maintenance easier, but it's +[recommmended to track it in version control](https://lazy.folke.io/usage/lockfile). + #### Clone kickstart.nvim > **NOTE** > If following the recommended step above (i.e., forking the repo), replace From ce0c7340fff68fb45d817478a8c0facb24425149 Mon Sep 17 00:00:00 2001 From: "Michael L." Date: Thu, 22 Aug 2024 22:56:33 +0200 Subject: [PATCH 022/140] Check for loop or uv for lazypath (#1095) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 220d3045..314a05b6 100644 --- a/init.lua +++ b/init.lua @@ -207,7 +207,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not vim.uv.fs_stat(lazypath) then +if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } if vim.v.shell_error ~= 0 then From ac78e7d9e77048fa7d5b0711f85aab93508e71a7 Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:00:39 -0400 Subject: [PATCH 023/140] refactor: update treesitter and which-key config (#1068) --- init.lua | 60 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/init.lua b/init.lua index 314a05b6..41b5a97b 100644 --- a/init.lua +++ b/init.lua @@ -275,7 +275,44 @@ require('lazy').setup({ 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading - require('which-key').setup() + require('which-key').setup { + icons = { + -- set icon mappings to true if you have a Nerd Font + mappings = vim.g.have_nerd_font, + -- If you are using a Nerd Font: set icons.keys to an empty table which will use the + -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table + keys = vim.g.have_nerd_font and {} or { + Up = ' ', + Down = ' ', + Left = ' ', + Right = ' ', + C = ' ', + M = ' ', + D = ' ', + S = ' ', + CR = ' ', + Esc = ' ', + ScrollWheelDown = ' ', + ScrollWheelUp = ' ', + NL = ' ', + BS = ' ', + Space = ' ', + Tab = ' ', + F1 = '', + F2 = '', + F3 = '', + F4 = '', + F5 = '', + F6 = '', + F7 = '', + F8 = '', + F9 = '', + F10 = '', + F11 = '', + F12 = '', + }, + }, + } -- Document existing key chains require('which-key').add { @@ -843,6 +880,8 @@ require('lazy').setup({ { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', + main = 'nvim-treesitter.configs', -- Sets main module to use for opts + -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed @@ -856,19 +895,12 @@ require('lazy').setup({ }, indent = { enable = true, disable = { 'ruby' } }, }, - config = function(_, opts) - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - - ---@diagnostic disable-next-line: missing-fields - require('nvim-treesitter.configs').setup(opts) - - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - end, + -- There are additional nvim-treesitter modules that you can use to interact + -- with nvim-treesitter. You should go explore a few and see what interests you: + -- + -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` + -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context + -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the From d452633b35d4dd9ada06efeca95750beaf0f584f Mon Sep 17 00:00:00 2001 From: Bayram Kazik <48856944+bayramkzk@users.noreply.github.com> Date: Sun, 25 Aug 2024 00:31:43 +0300 Subject: [PATCH 024/140] Include visual mode in LSP code action keymap (#1060) (#1064) --- init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 41b5a97b..13ea93a2 100644 --- a/init.lua +++ b/init.lua @@ -316,7 +316,7 @@ require('lazy').setup({ -- Document existing key chains require('which-key').add { - { 'c', group = '[C]ode' }, + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, { 'd', group = '[D]ocument' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, @@ -507,8 +507,9 @@ require('lazy').setup({ -- -- In this case, we create a function that lets us more easily define mappings specific -- for LSP related items. It sets the mode, buffer and description for us each time. - local map = function(keys, func, desc) - vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end -- Jump to the definition of the word under your cursor. @@ -542,7 +543,7 @@ require('lazy').setup({ -- Execute a code action, usually your cursor needs to be on top of an error -- or a suggestion from your LSP for this to activate. - map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') + map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. From f49cc6c93525326d6db409191c1c36dcc2e41b6e Mon Sep 17 00:00:00 2001 From: Bayram Kazik <48856944+bayramkzk@users.noreply.github.com> Date: Mon, 26 Aug 2024 06:23:17 +0300 Subject: [PATCH 025/140] Enable silent option for default neo-tree plugin keybinding (#1108) --- lua/kickstart/plugins/neo-tree.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index f126d68a..bd442269 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -11,7 +11,7 @@ return { }, cmd = 'Neotree', keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal' }, + { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, }, opts = { filesystem = { From e4a5300bdbdc644a3a265513b386aa30c2337088 Mon Sep 17 00:00:00 2001 From: Harshit Pant <97608579+pantharshit007@users.noreply.github.com> Date: Mon, 26 Aug 2024 08:57:46 +0530 Subject: [PATCH 026/140] Fix: updated the windows installation commands (#1101) * Update README.md * Update README.md * Fix: updated the windows installation commands --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 53ae459c..e14cbe22 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO If you're using `cmd.exe`: ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git %localappdata%\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim" ``` If you're using `powershell.exe` ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git $env:LOCALAPPDATA\nvim\ +git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" ``` From c76c323a7cc30186a77e2a68c7ecd8f62973cad9 Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Sun, 25 Aug 2024 23:28:26 -0400 Subject: [PATCH 027/140] fix: remove deprecated opt for conform.nvim (#1070) - changed lsp_fallback -> lsp_format - updated format_on_save function to reflect change above --- init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 13ea93a2..edc41822 100644 --- a/init.lua +++ b/init.lua @@ -675,7 +675,7 @@ require('lazy').setup({ { 'f', function() - require('conform').format { async = true, lsp_fallback = true } + require('conform').format { async = true, lsp_format = 'fallback' } end, mode = '', desc = '[F]ormat buffer', @@ -688,9 +688,15 @@ require('lazy').setup({ -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. local disable_filetypes = { c = true, cpp = true } + local lsp_format_opt + if disable_filetypes[vim.bo[bufnr].filetype] then + lsp_format_opt = 'never' + else + lsp_format_opt = 'fallback' + end return { timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + lsp_format = lsp_format_opt, } end, formatters_by_ft = { From 24d368f9ff3a951f9760c3c0e776a52726401f4f Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:17:22 -0400 Subject: [PATCH 028/140] cleanup: refactor which-key configuration for cleaner setup (#1102) - Moved `which-key` configuration from inline `config` to `opts` for better organization. - Updated the key mappings setup to use `spec` for defining existing key chains. - Removed deprecated or unnecessary comments and code. This change aligns with updated `which-key` configuration practices, improving readability and maintainability as recommended by @VlaDexa in #1068. --- init.lua | 96 +++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/init.lua b/init.lua index edc41822..2513d537 100644 --- a/init.lua +++ b/init.lua @@ -274,57 +274,55 @@ require('lazy').setup({ { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' - config = function() -- This is the function that runs, AFTER loading - require('which-key').setup { - icons = { - -- set icon mappings to true if you have a Nerd Font - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = ' ', - Down = ' ', - Left = ' ', - Right = ' ', - C = ' ', - M = ' ', - D = ' ', - S = ' ', - CR = ' ', - Esc = ' ', - ScrollWheelDown = ' ', - ScrollWheelUp = ' ', - NL = ' ', - BS = ' ', - Space = ' ', - Tab = ' ', - F1 = '', - F2 = '', - F3 = '', - F4 = '', - F5 = '', - F6 = '', - F7 = '', - F8 = '', - F9 = '', - F10 = '', - F11 = '', - F12 = '', - }, + opts = { + icons = { + -- set icon mappings to true if you have a Nerd Font + mappings = vim.g.have_nerd_font, + -- If you are using a Nerd Font: set icons.keys to an empty table which will use the + -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table + keys = vim.g.have_nerd_font and {} or { + Up = ' ', + Down = ' ', + Left = ' ', + Right = ' ', + C = ' ', + M = ' ', + D = ' ', + S = ' ', + CR = ' ', + Esc = ' ', + ScrollWheelDown = ' ', + ScrollWheelUp = ' ', + NL = ' ', + BS = ' ', + Space = ' ', + Tab = ' ', + F1 = '', + F2 = '', + F3 = '', + F4 = '', + F5 = '', + F6 = '', + F7 = '', + F8 = '', + F9 = '', + F10 = '', + F11 = '', + F12 = '', }, - } - -- Document existing key chains - require('which-key').add { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - } - end, + -- Document existing key chains + spec = { + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + }, + }, + }, }, -- NOTE: Plugins can specify dependencies. From a22976111e406ec0e4903ae78bf66a1fc0125b8a Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 26 Aug 2024 22:43:59 +0200 Subject: [PATCH 029/140] Fix the which-key spec issue caused by recent cleanup (#1113) The recent cleanup accidentally broke the leader key specs because the spec block was in the wrong level of braces. That resulted in which-key no longer showing the description of the key chains such as [S]earch and others. --- init.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index 2513d537..13c8143d 100644 --- a/init.lua +++ b/init.lua @@ -310,17 +310,17 @@ require('lazy').setup({ F11 = '', F12 = '', }, + }, - -- Document existing key chains - spec = { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - }, + -- Document existing key chains + spec = { + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, }, }, From 7201dc480134f41dd1be1f8f9b8f8470aac82a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Baquero?= <88566759+Cheveniko@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:27:24 -0500 Subject: [PATCH 030/140] feat: update references of tsserver to ts_ls (#1131) --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 13c8143d..ea86b792 100644 --- a/init.lua +++ b/init.lua @@ -614,8 +614,8 @@ require('lazy').setup({ -- Some languages (like typescript) have entire language plugins that can be useful: -- https://github.com/pmizio/typescript-tools.nvim -- - -- But for many setups, the LSP (`tsserver`) will work just fine - -- tsserver = {}, + -- But for many setups, the LSP (`ts_ls`) will work just fine + -- ts_ls = {}, -- lua_ls = { @@ -656,7 +656,7 @@ require('lazy').setup({ local server = servers[server_name] or {} -- This handles overriding only values explicitly passed -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for tsserver) + -- certain features of an LSP (for example, turning off formatting for ts_ls) server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) require('lspconfig')[server_name].setup(server) end, From 4120893b8a1f31a0957f2f891f7fbef73ddfb9b1 Mon Sep 17 00:00:00 2001 From: Bastien Traverse Date: Tue, 24 Sep 2024 17:06:14 +0200 Subject: [PATCH 031/140] fix: update lazy uninstall information link (#1148) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e14cbe22..800ca990 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ examples of adding popularly requested plugins. `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. * What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information + * See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information * Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? * The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily use to `git clone` as a basis for their own. From 5ed1bc38dc6467a2e69e3b6ad04f9b92f3ca882f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20NICOLAS?= Date: Wed, 30 Oct 2024 16:41:46 +0100 Subject: [PATCH 032/140] Disable linting autocmd for readonly buffers (#1202) * Disable linting autocmd for readonly buffers This should avoid linting in buffers outside of the user's control, having in mind especially the handy LSP pop-ups that describe your hovered symbol using markdown. Co-authored-by: Robin Gruyters <2082795+rgruyters@users.noreply.github.com> * Justify guarding try_lint in readonly buffers Co-authored-by: Robin Gruyters <2082795+rgruyters@users.noreply.github.com> --------- Co-authored-by: Robin Gruyters <2082795+rgruyters@users.noreply.github.com> --- lua/kickstart/plugins/lint.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index ca9bc237..907c6bf3 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -47,7 +47,12 @@ return { vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, callback = function() - lint.try_lint() + -- Only run the linter in buffers that you can modify in order to + -- avoid superfluous noise, notably within the handy LSP pop-ups that + -- describe the hovered symbol using Markdown. + if vim.opt_local.modifiable:get() then + lint.try_lint() + end end, }) end, From fb7f6a1c137ad32eca00926ceefa2b8a69e03d0a Mon Sep 17 00:00:00 2001 From: sam <110125971+samarth-na@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:19:16 +0530 Subject: [PATCH 033/140] samarth-nagar fix: lazy help tag on line 931 (#1167) * samarth-nagar fix: lazy help tag on line 931 found in issue #1152 * fixed white space --------- Co-authored-by: sam <110125971+samarth-nagar@users.noreply.github.com> --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ea86b792..e588129f 100644 --- a/init.lua +++ b/init.lua @@ -928,8 +928,12 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` -- { import = 'custom.plugins' }, + -- + -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` + -- Or use telescope! + -- In normal mode type `sh` then write `lazy.nvim-plugin` + -- you can continue same window with `sr` which resumes last telescope search }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the From d09d9bc6dc25f3e5de1856a9af4e1af98ab85461 Mon Sep 17 00:00:00 2001 From: gloomy-lemon-debatable <91877885+gloomy-lemon-debatable@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:50:27 +0000 Subject: [PATCH 034/140] Change diagnostic symbols if vim.g.have_nerd_font is true (#1195) * feat: Change diagnostic symbols if vim.g.have_nerd_font is true * feat: Comment out changes regarding diagnostic symbols so that only those who want to change them can do so --------- Co-authored-by: name --- init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.lua b/init.lua index e588129f..b58677d1 100644 --- a/init.lua +++ b/init.lua @@ -588,6 +588,15 @@ require('lazy').setup({ end, }) + -- Change diagnostic symbols in the sign column (gutter) + -- if vim.g.have_nerd_font then + -- local signs = { Error = '', Warn = '', Hint = '', Info = '' } + -- for type, icon in pairs(signs) do + -- local hl = 'DiagnosticSign' .. type + -- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + -- end + -- end + -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. From be678aa341bfa88f3b7ad8d85b7b76200d25e15d Mon Sep 17 00:00:00 2001 From: gloomy-lemon-debatable <91877885+gloomy-lemon-debatable@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:01:42 +0000 Subject: [PATCH 035/140] Set breakpoint icons and their highlight colors (#1194) * feat: Set breakpoint icons and their highlight colors * docs: Delete reference URL (written in PR) feat: "Break" and "Stop" arguments of vim.api.nvim_set_hl are changed because they are too common nouns feat: Comment out changes regarding diagnostic symbols so that only those who want to change them can do so --------- Co-authored-by: name --- lua/kickstart/plugins/debug.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 196f2c6d..2226d963 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -89,6 +89,18 @@ return { }, } + -- Change breakpoint icons + -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) + -- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) + -- local breakpoint_icons = vim.g.have_nerd_font + -- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } + -- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } + -- for type, icon in pairs(breakpoint_icons) do + -- local tp = 'Dap' .. type + -- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' + -- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) + -- end + dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close From 2ba39c69736597b60f6033aa3f8526e7c28343d5 Mon Sep 17 00:00:00 2001 From: Will Winder Date: Wed, 30 Oct 2024 14:58:52 -0400 Subject: [PATCH 036/140] Remove two because there are more than two. (#1213) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b58677d1..4ce35f4b 100644 --- a/init.lua +++ b/init.lua @@ -917,7 +917,7 @@ require('lazy').setup({ -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, - -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. From e5dc5f6d1ce598fdbee87e1bbd57062bdc1971b9 Mon Sep 17 00:00:00 2001 From: gloomy-lemon-debatable <91877885+gloomy-lemon-debatable@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:37:22 +0900 Subject: [PATCH 037/140] feat: Change to prepare for upcoming deprecation of configuring diagnostic-signs using sign_define() (#1232) --- init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 4ce35f4b..e3b7b56c 100644 --- a/init.lua +++ b/init.lua @@ -590,11 +590,12 @@ require('lazy').setup({ -- Change diagnostic symbols in the sign column (gutter) -- if vim.g.have_nerd_font then - -- local signs = { Error = '', Warn = '', Hint = '', Info = '' } + -- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' } + -- local diagnostic_signs = {} -- for type, icon in pairs(signs) do - -- local hl = 'DiagnosticSign' .. type - -- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) + -- diagnostic_signs[vim.diagnostic.severity[type]] = icon -- end + -- vim.diagnostic.config { signs = { text = diagnostic_signs } } -- end -- LSP servers and clients are able to communicate to each other what features they support. From 9dfb1b230f42a56bda0906e4693f4c9c4d5930eb Mon Sep 17 00:00:00 2001 From: Anjishnu Banerjee <107052359+kaezrr@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:10:51 +0530 Subject: [PATCH 038/140] Fix nvim-dap not lazy loading (#1216) * Fix nvim-dap not lazy loading The keys property had local variables 'dap' and 'dap-ui' that used `require` and prevented all DAP related plugins from lazy-loading. Fixed this by changing keys to a table and substituting the local variables with a lamba function * Make debug keybind descriptions more consistent --- lua/kickstart/plugins/debug.lua | 75 +++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 22 deletions(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 2226d963..753cb0ce 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -24,28 +24,59 @@ return { -- Add your own debuggers here 'leoluz/nvim-dap-go', }, - keys = function(_, keys) - local dap = require 'dap' - local dapui = require 'dapui' - return { - -- Basic debugging keymaps, feel free to change to your liking! - { '', dap.continue, desc = 'Debug: Start/Continue' }, - { '', dap.step_into, desc = 'Debug: Step Into' }, - { '', dap.step_over, desc = 'Debug: Step Over' }, - { '', dap.step_out, desc = 'Debug: Step Out' }, - { 'b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, - { - 'B', - function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, - desc = 'Debug: Set Breakpoint', - }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { '', dapui.toggle, desc = 'Debug: See last session result.' }, - unpack(keys), - } - end, + keys = { + -- Basic debugging keymaps, feel free to change to your liking! + { + '', + function() + require('dap').continue() + end, + desc = 'Debug: Start/Continue', + }, + { + '', + function() + require('dap').step_into() + end, + desc = 'Debug: Step Into', + }, + { + '', + function() + require('dap').step_over() + end, + desc = 'Debug: Step Over', + }, + { + '', + function() + require('dap').step_out() + end, + desc = 'Debug: Step Out', + }, + { + 'b', + function() + require('dap').toggle_breakpoint() + end, + desc = 'Debug: Toggle Breakpoint', + }, + { + 'B', + function() + require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') + end, + desc = 'Debug: Set Breakpoint', + }, + -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. + { + '', + function() + require('dapui').toggle() + end, + desc = 'Debug: See last session result.', + }, + }, config = function() local dap = require 'dap' local dapui = require 'dapui' From 8d1ef972bc32faa86fee21a57f9033b41f612ebb Mon Sep 17 00:00:00 2001 From: Miha <79801427+mihasket@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:41:50 +0100 Subject: [PATCH 039/140] fix: which-key comment typo (#1227) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index e3b7b56c..08717d53 100644 --- a/init.lua +++ b/init.lua @@ -279,7 +279,7 @@ require('lazy').setup({ -- set icon mappings to true if you have a Nerd Font mappings = vim.g.have_nerd_font, -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default whick-key.nvim defined Nerd Font icons, otherwise define a string table + -- default which-key.nvim defined Nerd Font icons, otherwise define a string table keys = vim.g.have_nerd_font and {} or { Up = ' ', Down = ' ', From 7bc9d19a4d086330b72b9f21e72431e9b31839b0 Mon Sep 17 00:00:00 2001 From: ben fleis Date: Thu, 12 Dec 2024 16:50:55 +0100 Subject: [PATCH 040/140] Tweak outdated comment about lazy's `config` key usage. (#1250) Remove outdated comment describing use of `config` key, replacing with corrected `opt` key note. Fixes #1249 --- init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 08717d53..b29693ac 100644 --- a/init.lua +++ b/init.lua @@ -267,9 +267,8 @@ require('lazy').setup({ -- which loads which-key before all the UI elements are loaded. Events can be -- normal autocommands events (`:help autocmd-events`). -- - -- Then, because we use the `config` key, the configuration only runs - -- after the plugin has been loaded: - -- config = function() ... end + -- Then, because we use the `opt` key (recommended), the configuration runs + -- after the plugin has been loaded as `require(MODULE).setup(opts)`. { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', From a2df3ea9ebec39de1c9a6f76320bf27a257ebf50 Mon Sep 17 00:00:00 2001 From: Artem Dragunov Date: Thu, 12 Dec 2024 18:51:58 +0300 Subject: [PATCH 041/140] Use consistent syntax style for { ... } "pseudocode" (#1247) ``` require('gitsigns').setup({ ... }) ``` This was the first occurrence It may be nice to have the same style everywhere Cosmetic change (just to make docs/comments even more perfect) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index b29693ac..8e56a216 100644 --- a/init.lua +++ b/init.lua @@ -628,8 +628,8 @@ require('lazy').setup({ -- lua_ls = { - -- cmd = {...}, - -- filetypes = { ...}, + -- cmd = { ... }, + -- filetypes = { ... }, -- capabilities = {}, settings = { Lua = { From bcdb4cd2525d517864b8221ddce3c5652ac35f9e Mon Sep 17 00:00:00 2001 From: ben fleis Date: Thu, 12 Dec 2024 22:26:20 +0100 Subject: [PATCH 042/140] Issue 1249 which key comments (#1263) * Tweak outdated comment about lazy's `config` key usage. Remove outdated comment describing use of `config` key, replacing with corrected `opt` key note. Fixes #1249 * fix typo opt -> opts Fixes #1250 --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 8e56a216..ee8fbc99 100644 --- a/init.lua +++ b/init.lua @@ -267,7 +267,7 @@ require('lazy').setup({ -- which loads which-key before all the UI elements are loaded. Events can be -- normal autocommands events (`:help autocmd-events`). -- - -- Then, because we use the `opt` key (recommended), the configuration runs + -- Then, because we use the `opts` key (recommended), the configuration runs -- after the plugin has been loaded as `require(MODULE).setup(opts)`. { -- Useful plugin to show you pending keybinds. From de44f491016126204824fac2b5a7d7e544a769be Mon Sep 17 00:00:00 2001 From: Scott Swensen Date: Sat, 14 Dec 2024 22:42:39 -0700 Subject: [PATCH 043/140] fix(gitsigns): make visual mode descriptions consistent with normal mode (#1266) --- lua/kickstart/plugins/gitsigns.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 4bcc70f4..c269bc06 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -36,10 +36,10 @@ return { -- visual mode map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'stage git hunk' }) + end, { desc = 'git [s]tage hunk' }) map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'reset git hunk' }) + end, { desc = 'git [r]eset hunk' }) -- normal mode map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) From e84e187f3c0c98ad258706a41768b5a93d411e1a Mon Sep 17 00:00:00 2001 From: George Date: Sun, 29 Dec 2024 18:39:47 +0200 Subject: [PATCH 044/140] Fix README.md grammar and typos (#1291) --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 800ca990..08cecfa3 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ If you are experiencing issues, please make sure you have the latest versions. External Requirements: - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation) -- Clipboard tool (xclip/xsel/win32yank or other depending on platform) +- Clipboard tool (xclip/xsel/win32yank or other depending on the platform) - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true - Language Setup: @@ -56,12 +56,12 @@ so that you have your own copy that you can modify, then install by cloning the fork to your machine using one of the commands below, depending on your OS. > **NOTE** -> Your fork's url will be something like this: +> Your fork's URL will be something like this: > `https://github.com//kickstart.nvim.git` You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file too - it's ignored in the kickstart repo to make maintenance easier, but it's -[recommmended to track it in version control](https://lazy.folke.io/usage/lockfile). +[recommended to track it in version control](https://lazy.folke.io/usage/lockfile). #### Clone kickstart.nvim > **NOTE** @@ -101,7 +101,7 @@ nvim ``` That's it! Lazy will install all the plugins you have. Use `:Lazy` to view -current plugin status. Hit `q` to close the window. +the current plugin status. Hit `q` to close the window. Read through the `init.lua` file in your configuration folder for more information about extending and exploring Neovim. That also includes @@ -114,9 +114,9 @@ examples of adding popularly requested plugins. ### FAQ -* What should I do if I already have a pre-existing neovim configuration? +* What should I do if I already have a pre-existing Neovim configuration? * You should back it up and then delete all associated files. - * This includes your existing init.lua and the neovim files in `~/.local` + * This includes your existing init.lua and the Neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` * Can I keep my existing configuration in parallel to kickstart? * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` @@ -174,7 +174,7 @@ run in cmd as **admin**: winget install --accept-source-agreements chocolatey.chocolatey ``` -2. install all requirements using choco, exit previous cmd and +2. install all requirements using choco, exit the previous cmd and open a new one so that choco path is set, and run in cmd as **admin**: ``` choco install -y neovim git ripgrep wget fd unzip gzip mingw make From 7ddaab3ffda3f79c8dc16242e609a20b222f7551 Mon Sep 17 00:00:00 2001 From: Ihsan Tonuzi <115842560+iton0@users.noreply.github.com> Date: Sun, 29 Dec 2024 12:00:16 -0500 Subject: [PATCH 045/140] chore: add pre-issue requirements (#1288) * chore: add pre-issue requirements Based on #1285 * docs: add header about documentation Based on #1285 --- .github/ISSUE_TEMPLATE/bug_report.md | 11 +++++++++-- README.md | 7 ++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2ad4d31d..55b45b0d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -9,6 +9,13 @@ assignees: '' +## Before Reporting an Issue +- I have read the kickstart.nvim README.md. +- I have read the appropiate plugin's documentation. +- I have searched that this issue has not been reported before. + +- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.** + ## Describe the bug @@ -18,8 +25,8 @@ assignees: '' ## Desktop -- OS: -- Terminal: +- OS: +- Terminal: ## Neovim Version diff --git a/README.md b/README.md index 08cecfa3..aa5f4fc8 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,15 @@ nvim That's it! Lazy will install all the plugins you have. Use `:Lazy` to view the current plugin status. Hit `q` to close the window. +#### Read The Friendly Documentation + Read through the `init.lua` file in your configuration folder for more information about extending and exploring Neovim. That also includes examples of adding popularly requested plugins. +> [!NOTE] +> For more information about a particular plugin check its repository's documentation. + ### Getting Started @@ -135,7 +140,7 @@ examples of adding popularly requested plugins. * The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily use to `git clone` as a basis for their own. As you progress in learning Neovim and Lua, you might consider splitting `init.lua` - into smaller parts. A fork of kickstart that does this while maintaining the + into smaller parts. A fork of kickstart that does this while maintaining the same functionality is available here: * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) * Discussions on this topic can be found here: From a8f539562a8c5d822dd5c0ca1803d963c60ad544 Mon Sep 17 00:00:00 2001 From: Ryan Jensen Date: Sun, 29 Dec 2024 11:04:10 -0600 Subject: [PATCH 046/140] Fix which-key delay settings (#1276) The which-key plugin used to rely on vim.opt.timeoutlen, but it was updated a few months ago to use its own opt.delay instead. https://github.com/folke/which-key.nvim/blob/8ab96b38a2530eacba5be717f52e04601eb59326/NEWS.md?plain=1#L10 I set which-key's delay to 0 ms because it makes it feel snappy and responsive! That way, we give new users a good first impression. --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ee8fbc99..7758df93 100644 --- a/init.lua +++ b/init.lua @@ -135,7 +135,6 @@ vim.opt.signcolumn = 'yes' vim.opt.updatetime = 250 -- Decrease mapped sequence wait time --- Displays which-key popup sooner vim.opt.timeoutlen = 300 -- Configure how new splits should be opened @@ -274,6 +273,9 @@ require('lazy').setup({ 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' opts = { + -- delay between pressing a key and opening which-key (milliseconds) + -- this setting is independent of vim.opt.timeoutlen + delay = 0, icons = { -- set icon mappings to true if you have a Nerd Font mappings = vim.g.have_nerd_font, From db4867acb939b548cf3c60641e1661783551248d Mon Sep 17 00:00:00 2001 From: Tomas Gareau Date: Tue, 7 Jan 2025 09:44:29 -0600 Subject: [PATCH 047/140] fix: prevent mason setup from being run twice (#1298) * fix: prevent mason setup from being run twice Addresses https://github.com/nvim-lua/kickstart.nvim/issues/1297 Currently, we're calling `require('mason').setup(...)` twice: * once when setting it as a dependency of `nvim-lspconfig` (since we set `config = true`) * once in the `config` function we define for `nvim-lspconfig` Calling setup twice can cause issues with, e.g., setting the `PATH` option: you might append Mason's bin dir in one setup call and prepend it in the other. We've kept the setup of `mason` in the `nvim-lspconfig` dependencies table since leaving it to the `config` function caused some plugin-loading-order related issues in the past. See: * https://github.com/nvim-lua/kickstart.nvim/pull/210 * https://github.com/nvim-lua/kickstart.nvim/issues/554 * https://github.com/nvim-lua/kickstart.nvim/pull/555 * https://github.com/nvim-lua/kickstart.nvim/pull/865 * docs: tweak comments per review feedback --- init.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 7758df93..610018e8 100644 --- a/init.lua +++ b/init.lua @@ -457,7 +457,9 @@ require('lazy').setup({ 'neovim/nvim-lspconfig', dependencies = { -- Automatically install LSPs and related tools to stdpath for Neovim - { 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants + -- Mason must be loaded before its dependents so we need to set it up here. + -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` + { 'williamboman/mason.nvim', opts = {} }, 'williamboman/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', @@ -646,13 +648,16 @@ require('lazy').setup({ } -- Ensure the servers and tools above are installed - -- To check the current status of installed tools and/or manually install - -- other tools, you can run + -- + -- To check the current status of installed tools and/or manually install + -- other tools, you can run -- :Mason -- - -- You can press `g?` for help in this menu. - require('mason').setup() - + -- You can press `g?` for help in this menu. + -- + -- `mason` had to be setup earlier: to configure its options see the + -- `dependencies` table for `nvim-lspconfig` above. + -- -- You can add other tools here that you want Mason to install -- for you, so that they are available from within Neovim. local ensure_installed = vim.tbl_keys(servers or {}) From f6abf682fffba362ff4c6f8157ef72822adda289 Mon Sep 17 00:00:00 2001 From: Nhan Luu <62146587+nhld@users.noreply.github.com> Date: Thu, 16 Jan 2025 02:37:03 +0700 Subject: [PATCH 048/140] chore: remove redundant comment (#1307) --- init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/init.lua b/init.lua index 610018e8..edbc3783 100644 --- a/init.lua +++ b/init.lua @@ -464,7 +464,6 @@ require('lazy').setup({ 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, -- Allows extra capabilities provided by nvim-cmp From ff89769e4583b4f2c170df0d8ccacb950d5dd4e6 Mon Sep 17 00:00:00 2001 From: Nhan Luu <62146587+nhld@users.noreply.github.com> Date: Thu, 16 Jan 2025 02:37:36 +0700 Subject: [PATCH 049/140] chore: fix typo in bug report issue template (#1306) --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 55b45b0d..86598b8d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -11,7 +11,7 @@ assignees: '' ## Before Reporting an Issue - I have read the kickstart.nvim README.md. -- I have read the appropiate plugin's documentation. +- I have read the appropriate plugin's documentation. - I have searched that this issue has not been reported before. - [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.** From 5bdde24dfb353d365d908c5dd700f412ed2ffb17 Mon Sep 17 00:00:00 2001 From: Diorman Colmenares <229201+diorman@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:38:26 -0800 Subject: [PATCH 050/140] Use luals 3rd library for luv (#1303) --- init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.lua b/init.lua index edbc3783..4eae8e7d 100644 --- a/init.lua +++ b/init.lua @@ -447,11 +447,10 @@ require('lazy').setup({ opts = { library = { -- Load luvit types when the `vim.uv` word is found - { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, }, }, }, - { 'Bilal2453/luvit-meta', lazy = true }, { -- Main LSP Configuration 'neovim/nvim-lspconfig', From abdbfce0f8610e8661ccf27c1ba13b8134b78673 Mon Sep 17 00:00:00 2001 From: Ryan Nevius Date: Sat, 15 Feb 2025 04:23:31 +0100 Subject: [PATCH 051/140] chore(docs): Update README.md (#1344) Neovim has renamed the "linux64" binary to "linux-x86_64". --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index aa5f4fc8..3cabe656 100644 --- a/README.md +++ b/README.md @@ -212,14 +212,14 @@ sudo apt update sudo apt install make gcc ripgrep unzip git xclip curl # Now we install nvim -curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz -sudo rm -rf /opt/nvim-linux64 -sudo mkdir -p /opt/nvim-linux64 -sudo chmod a+rX /opt/nvim-linux64 -sudo tar -C /opt -xzf nvim-linux64.tar.gz +curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz +sudo rm -rf /opt/nvim-linux-x86_64 +sudo mkdir -p /opt/nvim-linux-x86_64 +sudo chmod a+rX /opt/nvim-linux-x86_64 +sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz # make it available in /usr/local/bin, distro installs to /usr/bin -sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/ +sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/ ```
Fedora Install Steps From 71ad926ab18fed072b8a9af6a22c8cbb302e3257 Mon Sep 17 00:00:00 2001 From: bleacheda <60625523+bleacheda@users.noreply.github.com> Date: Sat, 15 Feb 2025 05:32:50 +0200 Subject: [PATCH 052/140] =?UTF-8?q?docs:=20clarify=20using=20opts=20=3D=20?= =?UTF-8?q?{}=20vs=20config=20=3D=20function()=20...=20require('plu?= =?UTF-8?q?=E2=80=A6=20(#1316)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: clarify using opts = {} vs config = function() ... require('plugin').setup({}) .. end The current documentation mentioning that using "require" is equivalent to using "opts" without detailing the use in the "config = function()" block seems inaccurate. Lower in the configuration the "config = function()" block is used without clarifying why it needed and what it does. This clarification may help new users understand the difference between the two, or how and where to place the "require" statement. * Update init.lua * remove whitespace --- init.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 4eae8e7d..99c7c9cb 100644 --- a/init.lua +++ b/init.lua @@ -234,12 +234,22 @@ require('lazy').setup({ -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. -- - -- Use `opts = {}` to force a plugin to be loaded. + -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded. -- + -- Alternatively, use `config = function() ... end` for full control over the configuration. + -- If you prefer to call `setup` explicitly, use: + -- { + -- 'lewis6991/gitsigns.nvim', + -- config = function() + -- require('gitsigns').setup({ + -- -- Your gitsigns configuration here + -- }) + -- end, + -- } + -- -- Here is a more advanced example where we pass configuration - -- options to `gitsigns.nvim`. This is equivalent to the following Lua: - -- require('gitsigns').setup({ ... }) + -- options to `gitsigns.nvim`. -- -- See `:help gitsigns` to understand what the configuration keys do { -- Adds git related signs to the gutter, as well as utilities for managing changes From 94f551b8039a3f6399d2ea3373c4774005ede4db Mon Sep 17 00:00:00 2001 From: Erlan Rangel Date: Fri, 14 Feb 2025 23:48:37 -0600 Subject: [PATCH 053/140] fix (#1319): gitsigns deprecated functions (#1321) - This commit change two functions that are marked as deprecated now: `gitsigns.stage_hunk` and `gitsigns.toggle_deleted` --- lua/kickstart/plugins/gitsigns.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index c269bc06..cbbd22d2 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -44,7 +44,7 @@ return { map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) - map('n', 'hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' }) + map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) @@ -54,7 +54,7 @@ return { end, { desc = 'git [D]iff against last commit' }) -- Toggles map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) + map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) end, }, }, From d2c006819a5473f958276b028e16636f347df823 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Sun, 16 Feb 2025 22:37:44 -0500 Subject: [PATCH 054/140] Add a blurb about installing missing emoji on Ubuntu Right next to the nerdfonts blurb as requested. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3cabe656..92841110 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ External Requirements: - Clipboard tool (xclip/xsel/win32yank or other depending on the platform) - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true +- Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji` - Language Setup: - If you want to write Typescript, you need `npm` - If you want to write Golang, you will need `go` From db78c0b217fd9525e2cbcbffd18abbbbddc75b2e Mon Sep 17 00:00:00 2001 From: Jonas Zeltner Date: Mon, 17 Feb 2025 04:42:19 +0100 Subject: [PATCH 055/140] fix: arguments for the `vim.lsp.Client.supports_method` method (#1356) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 99c7c9cb..7ef6120b 100644 --- a/init.lua +++ b/init.lua @@ -564,7 +564,7 @@ require('lazy').setup({ -- -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -591,7 +591,7 @@ require('lazy').setup({ -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code - if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') From 76e06fec5cf0aceaf06d50d1f934a8cfde3bc3df Mon Sep 17 00:00:00 2001 From: GeloCraft <115651305+gelocraft@users.noreply.github.com> Date: Tue, 18 Feb 2025 02:01:07 +0800 Subject: [PATCH 056/140] feat(diagnostic): add diagnostic config (#1335) Co-authored-by: gelocraft --- init.lua | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 7ef6120b..d91174b5 100644 --- a/init.lua +++ b/init.lua @@ -599,15 +599,34 @@ require('lazy').setup({ end, }) - -- Change diagnostic symbols in the sign column (gutter) - -- if vim.g.have_nerd_font then - -- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' } - -- local diagnostic_signs = {} - -- for type, icon in pairs(signs) do - -- diagnostic_signs[vim.diagnostic.severity[type]] = icon - -- end - -- vim.diagnostic.config { signs = { text = diagnostic_signs } } - -- end + -- Diagnostic Config + -- See :help vim.diagnostic.Opts + vim.diagnostic.config { + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = vim.diagnostic.severity.ERROR }, + signs = vim.g.have_nerd_font and { + text = { + [vim.diagnostic.severity.ERROR] = '󰅚 ', + [vim.diagnostic.severity.WARN] = '󰀪 ', + [vim.diagnostic.severity.INFO] = '󰋽 ', + [vim.diagnostic.severity.HINT] = '󰌶 ', + }, + } or {}, + virtual_text = { + source = 'if_many', + spacing = 2, + format = function(diagnostic) + local diagnostic_message = { + [vim.diagnostic.severity.ERROR] = diagnostic.message, + [vim.diagnostic.severity.WARN] = diagnostic.message, + [vim.diagnostic.severity.INFO] = diagnostic.message, + [vim.diagnostic.severity.HINT] = diagnostic.message, + } + return diagnostic_message[diagnostic.severity] + end, + }, + } -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. From ebca680deaf83b49f4b9f51f1f7d5823cd68ecfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Guerra?= Date: Tue, 18 Feb 2025 01:10:48 +0100 Subject: [PATCH 057/140] perf: load tokyonight.nvim in the intended way (#1360) Fixes #1357 --- init.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index d91174b5..b57a4b9b 100644 --- a/init.lua +++ b/init.lua @@ -874,14 +874,18 @@ require('lazy').setup({ -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. 'folke/tokyonight.nvim', priority = 1000, -- Make sure to load this before all the other start plugins. - init = function() + config = function() + ---@diagnostic disable-next-line: missing-fields + require('tokyonight').setup { + styles = { + comments = { italic = false }, -- Disable italics in comments + }, + } + -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. vim.cmd.colorscheme 'tokyonight-night' - - -- You can configure highlights by doing something like: - vim.cmd.hi 'Comment gui=none' end, }, From 282cbb9c82138262bb8a5fe60573ba4626abe425 Mon Sep 17 00:00:00 2001 From: Rob Date: Tue, 18 Feb 2025 00:12:06 +0000 Subject: [PATCH 058/140] feat: add basic function signature help (#1358) * feat: add basic function signature help * Update init.lua Co-authored-by: makeworld <25111343+makew0rld@users.noreply.github.com> --------- Co-authored-by: makeworld <25111343+makew0rld@users.noreply.github.com> --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index b57a4b9b..de34808e 100644 --- a/init.lua +++ b/init.lua @@ -786,6 +786,8 @@ require('lazy').setup({ -- into multiple repos for maintenance purposes. 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', + 'hrsh7th/cmp-path', + 'htsh7th/cmp-nvim-lsp-signature-help', }, config = function() -- See `:help cmp` @@ -862,6 +864,7 @@ require('lazy').setup({ { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' }, + { name = 'nvim_lsp_signature_help' }, }, } end, From 7c49ba1cb7fe761df7ec25d4cbb9d21c0f9552d3 Mon Sep 17 00:00:00 2001 From: Aryan Rajoria <57455619+aryan-rajoria@users.noreply.github.com> Date: Tue, 18 Feb 2025 00:05:15 -0500 Subject: [PATCH 059/140] Fix: fix the cmp-nvim-lsp-signature-help link (#1363) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index de34808e..c8f2dc5b 100644 --- a/init.lua +++ b/init.lua @@ -787,7 +787,7 @@ require('lazy').setup({ 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', 'hrsh7th/cmp-path', - 'htsh7th/cmp-nvim-lsp-signature-help', + 'hrsh7th/cmp-nvim-lsp-signature-help', }, config = function() -- See `:help cmp` From e64aa51ef29dfd17bf44711c697f00caff195165 Mon Sep 17 00:00:00 2001 From: Jonas Zeltner Date: Tue, 18 Feb 2025 17:15:13 +0100 Subject: [PATCH 060/140] fix: regression introduced in db78c0b217fd9525e2cbcbffd18abbbbddc75b2e (#1367) --- init.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index c8f2dc5b..22ee9e48 100644 --- a/init.lua +++ b/init.lua @@ -558,13 +558,26 @@ require('lazy').setup({ -- For example, in C this would take you to the header. map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) + ---@param client vim.lsp.Client + ---@param method vim.lsp.protocol.Method + ---@param bufnr? integer some lsp support methods only in specific files + ---@return boolean + local function client_supports_method(client, method, bufnr) + if vim.fn.has 'nvim-0.11' == 1 then + return client:supports_method(method, bufnr) + else + return client.supports_method(method, { bufnr = bufnr }) + end + end + -- The following two autocommands are used to highlight references of the -- word under your cursor when your cursor rests there for a little while. -- See `:help CursorHold` for information about when this is executed -- -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then + if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -591,7 +604,7 @@ require('lazy').setup({ -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code - if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then + if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') From ea60b2b01f3931cb0bb0ab746ccb65107a8c55cd Mon Sep 17 00:00:00 2001 From: Ari Pollak Date: Wed, 19 Feb 2025 09:38:58 -0500 Subject: [PATCH 061/140] Remove duplicate cmp-path (#1369) --- init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/init.lua b/init.lua index 22ee9e48..40c8f59d 100644 --- a/init.lua +++ b/init.lua @@ -799,7 +799,6 @@ require('lazy').setup({ -- into multiple repos for maintenance purposes. 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-path', - 'hrsh7th/cmp-path', 'hrsh7th/cmp-nvim-lsp-signature-help', }, config = function() From 34e7d29aa7b6e95cf09d62baf4c9082db5b129c0 Mon Sep 17 00:00:00 2001 From: Chris Patti Date: Wed, 19 Feb 2025 09:40:16 -0500 Subject: [PATCH 062/140] Propsed fix for init.lua warnings as per https://github.com/nvim-lua/kickstart.nvim/issues/1305#issuecomment-2657770325 (#1354) --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index 40c8f59d..5cac3d14 100644 --- a/init.lua +++ b/init.lua @@ -707,6 +707,8 @@ require('lazy').setup({ require('mason-tool-installer').setup { ensure_installed = ensure_installed } require('mason-lspconfig').setup { + ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) + automatic_installation = false, handlers = { function(server_name) local server = servers[server_name] or {} From 38f4744e254af1b2ce5384d66d7c7da3b5f67106 Mon Sep 17 00:00:00 2001 From: Crypto-Spartan <29098151+Crypto-Spartan@users.noreply.github.com> Date: Wed, 12 Mar 2025 17:24:44 -0400 Subject: [PATCH 063/140] feat: add `vim.opt.confirm = true` (#1384) --- init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.lua b/init.lua index 5cac3d14..1427b6c7 100644 --- a/init.lua +++ b/init.lua @@ -156,6 +156,11 @@ vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 +-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), +-- instead raise a dialog asking if you wish to save the current file(s) +-- See `:help 'confirm'` +vim.opt.confirm = true + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` From 2abcb39fae23eb08acf347ef8011365da9f311f9 Mon Sep 17 00:00:00 2001 From: Luca Saccarola <96259932+saccarosium@users.noreply.github.com> Date: Thu, 20 Mar 2025 23:16:35 +0100 Subject: [PATCH 064/140] fix: use correct github abmonition syntax (#1414) --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 92841110..8ace8b9b 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,13 @@ External Requirements: - If you want to write Golang, you will need `go` - etc. -> **NOTE** +> [!NOTE] > See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes > and quick install snippets ### Install Kickstart -> **NOTE** +> [!NOTE] > [Backup](#FAQ) your previous configuration (if any exists) Neovim's configurations are located under the following paths, depending on your OS: @@ -56,7 +56,7 @@ Neovim's configurations are located under the following paths, depending on your so that you have your own copy that you can modify, then install by cloning the fork to your machine using one of the commands below, depending on your OS. -> **NOTE** +> [!NOTE] > Your fork's URL will be something like this: > `https://github.com//kickstart.nvim.git` @@ -65,7 +65,8 @@ too - it's ignored in the kickstart repo to make maintenance easier, but it's [recommended to track it in version control](https://lazy.folke.io/usage/lockfile). #### Clone kickstart.nvim -> **NOTE** + +> [!NOTE] > If following the recommended step above (i.e., forking the repo), replace > `nvim-lua` with `` in the commands below From 5e2d7e184b9d097c683792a8e5daed50a395cb0b Mon Sep 17 00:00:00 2001 From: RulentWave <49258216+RulentWave@users.noreply.github.com> Date: Mon, 24 Mar 2025 15:33:53 -0400 Subject: [PATCH 065/140] changed Conform's format_on_save lambda so that buffers that match disable_filetypes return nil. This allows you to enable a formatter for langages in the disable_filetypes table to have a formatter that can be run manually with Leader-f but doesnt enable format_on_save for them (#1395) --- init.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index 1427b6c7..fe030ddf 100644 --- a/init.lua +++ b/init.lua @@ -749,16 +749,14 @@ require('lazy').setup({ -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. local disable_filetypes = { c = true, cpp = true } - local lsp_format_opt if disable_filetypes[vim.bo[bufnr].filetype] then - lsp_format_opt = 'never' + return nil else - lsp_format_opt = 'fallback' + return { + timeout_ms = 500, + lsp_format = 'fallback', + } end - return { - timeout_ms = 500, - lsp_format = lsp_format_opt, - } end, formatters_by_ft = { lua = { 'stylua' }, From e947649cb0ee5ac3c75593288df04d4f58359106 Mon Sep 17 00:00:00 2001 From: Sander Date: Mon, 24 Mar 2025 20:34:57 +0100 Subject: [PATCH 066/140] feat(keymap): move windows without `` (#1368) --- init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init.lua b/init.lua index fe030ddf..cbf9ff65 100644 --- a/init.lua +++ b/init.lua @@ -194,6 +194,12 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- NOTE: Some terminals have coliding keymaps or are not able to send distinct keycodes +-- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) +-- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) +-- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) +-- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` From 8a5a52f6470619b5408e63120d91b976dd08c618 Mon Sep 17 00:00:00 2001 From: dasvh Date: Wed, 9 Apr 2025 16:39:17 +0200 Subject: [PATCH 067/140] fix: minor misspellings (#1450) * fix: minor misspellings * revert change for `-Bbuild` --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index cbf9ff65..1f8d9c87 100644 --- a/init.lua +++ b/init.lua @@ -194,7 +194,7 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) --- NOTE: Some terminals have coliding keymaps or are not able to send distinct keycodes +-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes -- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) -- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) From 1a5787bc573b35bd6a96ac998d46ff6460e534af Mon Sep 17 00:00:00 2001 From: "Theo P." <63016528+theopn@users.noreply.github.com> Date: Wed, 9 Apr 2025 11:01:57 -0400 Subject: [PATCH 068/140] Change LSP Keybindings to Match the Default `gr` Bindings Introduced in Neovim 0.11 (#1427) * refactor: change LSP keybindings to the default gr bindings introduced in 0.11 * refactor: modify existing LSP functions to follow convention --- init.lua | 58 ++++++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/init.lua b/init.lua index 1f8d9c87..bafc6669 100644 --- a/init.lua +++ b/init.lua @@ -336,11 +336,7 @@ require('lazy').setup({ -- Document existing key chains spec = { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, @@ -532,42 +528,42 @@ require('lazy').setup({ vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end - -- Jump to the definition of the word under your cursor. - -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . - map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + -- Rename the variable under your cursor. + -- Most Language Servers support renaming across files, etc. + map('grn', vim.lsp.buf.rename, '[R]e[n]ame') + + -- Execute a code action, usually your cursor needs to be on top of an error + -- or a suggestion from your LSP for this to activate. + map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) -- Find references for the word under your cursor. - map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') -- Jump to the implementation of the word under your cursor. -- Useful when your language has ways of declaring types without an actual implementation. - map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press . + map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + + -- WARN: This is not Goto Definition, this is Goto Declaration. + -- For example, in C this would take you to the header. + map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols') + + -- Fuzzy find all the symbols in your current workspace. + -- Similar to document symbols, except searches over your entire project. + map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols') -- Jump to the type of the word under your cursor. -- Useful when you're not sure what type a variable is and you want to see -- the definition of its *type*, not where it was *defined*. - map('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - - -- Rename the variable under your cursor. - -- Most Language Servers support renaming across files, etc. - map('rn', vim.lsp.buf.rename, '[R]e[n]ame') - - -- Execute a code action, usually your cursor needs to be on top of an error - -- or a suggestion from your LSP for this to activate. - map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) - - -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header. - map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) ---@param client vim.lsp.Client From 9929044f2432758bc0a7c3fab13414e49f316443 Mon Sep 17 00:00:00 2001 From: Dmytro Onypko Date: Wed, 9 Apr 2025 16:05:40 +0100 Subject: [PATCH 069/140] Remove Telescope `0.1` branch lock (#1448) --- init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/init.lua b/init.lua index bafc6669..0b4bed8e 100644 --- a/init.lua +++ b/init.lua @@ -353,7 +353,6 @@ require('lazy').setup({ { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', event = 'VimEnter', - branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', { -- If encountering errors, see telescope-fzf-native README for installation instructions From d350db2449da40df003c40d440f909d74e2d4e70 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Wed, 9 Apr 2025 17:25:57 -0400 Subject: [PATCH 070/140] feat: switch nvim-cmp for blink.cmp (#1426) --- init.lua | 158 ++++++++++++---------------- lua/kickstart/plugins/autopairs.lua | 10 +- 2 files changed, 70 insertions(+), 98 deletions(-) diff --git a/init.lua b/init.lua index 0b4bed8e..776c6873 100644 --- a/init.lua +++ b/init.lua @@ -481,8 +481,8 @@ require('lazy').setup({ -- Useful status updates for LSP. { 'j-hui/fidget.nvim', opts = {} }, - -- Allows extra capabilities provided by nvim-cmp - 'hrsh7th/cmp-nvim-lsp', + -- Allows extra capabilities provided by blink.cmp + 'saghen/blink.cmp', }, config = function() -- Brief aside: **What is LSP?** @@ -649,10 +649,9 @@ require('lazy').setup({ -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. - -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. - -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) + -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. + -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers. + local capabilities = require('blink.cmp').get_lsp_capabilities() -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. @@ -771,12 +770,14 @@ require('lazy').setup({ }, { -- Autocompletion - 'hrsh7th/nvim-cmp', - event = 'InsertEnter', + 'saghen/blink.cmp', + event = 'VimEnter', + version = '1.*', dependencies = { - -- Snippet Engine & its associated nvim-cmp source + -- Snippet Engine { 'L3MON4D3/LuaSnip', + version = '2.*', build = (function() -- Build Step is needed for regex support in snippets. -- This step is not supported in many windows environments. @@ -797,95 +798,74 @@ require('lazy').setup({ -- end, -- }, }, + opts = {}, }, - 'saadparwaiz1/cmp_luasnip', - - -- Adds other completion capabilities. - -- nvim-cmp does not ship with all sources by default. They are split - -- into multiple repos for maintenance purposes. - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-nvim-lsp-signature-help', + 'folke/lazydev.nvim', }, - config = function() - -- See `:help cmp` - local cmp = require 'cmp' - local luasnip = require 'luasnip' - luasnip.config.setup {} - - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { completeopt = 'menu,menuone,noinsert' }, - - -- For an understanding of why these mappings were - -- chosen, you will need to read `:help ins-completion` + --- @module 'blink.cmp' + --- @type blink.cmp.Config + opts = { + keymap = { + -- 'default' (recommended) for mappings similar to built-in completions + -- to accept ([y]es) the completion. + -- This will auto-import if your LSP supports it. + -- This will expand snippets if the LSP sent a snippet. + -- 'super-tab' for tab to accept + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- For an understanding of why the 'default' preset is recommended, + -- you will need to read `:help ins-completion` -- -- No, but seriously. Please read `:help ins-completion`, it is really good! - mapping = cmp.mapping.preset.insert { - -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), - -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), + -- + -- All presets have the following mappings: + -- /: move to right/left of your snippet expansion + -- : Open menu or open docs if already open + -- / or /: Select next/previous item + -- : Hide menu + -- : Toggle signature help + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + preset = 'default', - -- Scroll the documentation window [b]ack / [f]orward - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + }, - -- Accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = 'mono', + }, - -- If you prefer more traditional completion keymaps, - -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), + completion = { + -- By default, you may press `` to show the documentation. + -- Optionally, set `auto_show = true` to show the documentation after a delay. + documentation = { auto_show = false, auto_show_delay_ms = 500 }, + }, - -- Manually trigger a completion from nvim-cmp. - -- Generally you don't need this, because nvim-cmp will display - -- completions whenever it has completion options available. - [''] = cmp.mapping.complete {}, - - -- Think of as moving to the right of your snippet expansion. - -- So if you have a snippet that's like: - -- function $name($args) - -- $body - -- end - -- - -- will move you to the right of each of the expansion locations. - -- is similar, except moving you backwards. - [''] = cmp.mapping(function() - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function() - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - end - end, { 'i', 's' }), - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + sources = { + default = { 'lsp', 'path', 'snippets', 'lazydev' }, + providers = { + lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, }, - sources = { - { - name = 'lazydev', - -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it - group_index = 0, - }, - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'path' }, - { name = 'nvim_lsp_signature_help' }, - }, - } - end, + }, + + snippets = { preset = 'luasnip' }, + + -- Blink.cmp includes an optional, recommended rust fuzzy matcher, + -- which automatically downloads a prebuilt binary when enabled. + -- + -- By default, we use the Lua implementation instead, but you may enable + -- the rust implementation via `'prefer_rust_with_warning'` + -- + -- See :h blink-cmp-config-fuzzy for more information + fuzzy = { implementation = 'lua' }, + + -- Shows a signature help window while you type arguments for a function + signature = { enabled = true }, + }, }, { -- You can easily change to a different colorscheme. diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 87a7e5ff..386d392e 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -4,13 +4,5 @@ return { 'windwp/nvim-autopairs', event = 'InsertEnter', - -- Optional dependency - dependencies = { 'hrsh7th/nvim-cmp' }, - config = function() - require('nvim-autopairs').setup {} - -- If you want to automatically add `(` after selecting a function or method - local cmp_autopairs = require 'nvim-autopairs.completion.cmp' - local cmp = require 'cmp' - cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) - end, + opts = {}, } From 76cb865e4f3bd985fef9f209023d762eaa0f81e6 Mon Sep 17 00:00:00 2001 From: guru245 Date: Sat, 10 May 2025 08:41:44 +0900 Subject: [PATCH 071/140] Change to Mason's new address (#1516) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 776c6873..0d0e8a81 100644 --- a/init.lua +++ b/init.lua @@ -474,8 +474,8 @@ require('lazy').setup({ -- Automatically install LSPs and related tools to stdpath for Neovim -- Mason must be loaded before its dependents so we need to set it up here. -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` - { 'williamboman/mason.nvim', opts = {} }, - 'williamboman/mason-lspconfig.nvim', + { 'mason-org/mason.nvim', opts = {} }, + 'mason-org/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. From 2b2f0f8364bff6352790c4173c9da514dc009f36 Mon Sep 17 00:00:00 2001 From: guru245 Date: Sun, 11 May 2025 09:11:50 +0900 Subject: [PATCH 072/140] feat: switch vim-sleuth for guess-indent.nvim (#1512) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0d0e8a81..6be82d59 100644 --- a/init.lua +++ b/init.lua @@ -239,7 +239,7 @@ vim.opt.rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following From c92ea7ca97d88a5c6628daf7c7a75871c37a6c79 Mon Sep 17 00:00:00 2001 From: Ori Perry <48057913+oriori1703@users.noreply.github.com> Date: Sun, 11 May 2025 03:16:03 +0300 Subject: [PATCH 073/140] Replace vim.opt with vim.o (#1495) * Replace vim.opt with vim.o Because it offers a nicer interface and info on hover. For now leave vim.opt when using the table interface (until vim.o with tables is implemented) * Add type hint for vim.opt.rtp * Add a comment about using vim.opt instead of vim.o --- init.lua | 54 +++++++++++++++++++--------------- lua/kickstart/plugins/lint.lua | 2 +- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/init.lua b/init.lua index 6be82d59..eb715025 100644 --- a/init.lua +++ b/init.lua @@ -94,72 +94,77 @@ vim.g.maplocalleader = ' ' vim.g.have_nerd_font = false -- [[ Setting options ]] --- See `:help vim.opt` +-- See `:help vim.o` -- NOTE: You can change these options as you wish! -- For more options, you can see `:help option-list` -- Make line numbers default -vim.opt.number = true +vim.o.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +-- vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! -vim.opt.mouse = 'a' +vim.o.mouse = 'a' -- Don't show the mode, since it's already in the status line -vim.opt.showmode = false +vim.o.showmode = false -- Sync clipboard between OS and Neovim. -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` vim.schedule(function() - vim.opt.clipboard = 'unnamedplus' + vim.o.clipboard = 'unnamedplus' end) -- Enable break indent -vim.opt.breakindent = true +vim.o.breakindent = true -- Save undo history -vim.opt.undofile = true +vim.o.undofile = true -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.opt.ignorecase = true -vim.opt.smartcase = true +vim.o.ignorecase = true +vim.o.smartcase = true -- Keep signcolumn on by default -vim.opt.signcolumn = 'yes' +vim.o.signcolumn = 'yes' -- Decrease update time -vim.opt.updatetime = 250 +vim.o.updatetime = 250 -- Decrease mapped sequence wait time -vim.opt.timeoutlen = 300 +vim.o.timeoutlen = 300 -- Configure how new splits should be opened -vim.opt.splitright = true -vim.opt.splitbelow = true +vim.o.splitright = true +vim.o.splitbelow = true -- Sets how neovim will display certain whitespace characters in the editor. -- See `:help 'list'` -- and `:help 'listchars'` -vim.opt.list = true +-- +-- Notice listchars is set using `vim.opt` instead of `vim.o`. +-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables. +-- See `:help lua-options` +-- and `:help lua-options-guide` +vim.o.list = true vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } -- Preview substitutions live, as you type! -vim.opt.inccommand = 'split' +vim.o.inccommand = 'split' -- Show which line your cursor is on -vim.opt.cursorline = true +vim.o.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 +vim.o.scrolloff = 10 -- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), -- instead raise a dialog asking if you wish to save the current file(s) -- See `:help 'confirm'` -vim.opt.confirm = true +vim.o.confirm = true -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -223,8 +228,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end -end ---@diagnostic disable-next-line: undefined-field -vim.opt.rtp:prepend(lazypath) +end + +---@type vim.Option +local rtp = vim.opt.rtp +rtp:prepend(lazypath) -- [[ Configure and install plugins ]] -- @@ -295,7 +303,7 @@ require('lazy').setup({ event = 'VimEnter', -- Sets the loading event to 'VimEnter' opts = { -- delay between pressing a key and opening which-key (milliseconds) - -- this setting is independent of vim.opt.timeoutlen + -- this setting is independent of vim.o.timeoutlen delay = 0, icons = { -- set icon mappings to true if you have a Nerd Font diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 907c6bf3..dec42f09 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -50,7 +50,7 @@ return { -- Only run the linter in buffers that you can modify in order to -- avoid superfluous noise, notably within the handy LSP pop-ups that -- describe the hovered symbol using Markdown. - if vim.opt_local.modifiable:get() then + if vim.bo.modifiable then lint.try_lint() end end, From fb73617653d2352e0c3f931a534c5f538a7eea2b Mon Sep 17 00:00:00 2001 From: pynappo Date: Sat, 10 May 2025 17:18:04 -0700 Subject: [PATCH 074/140] don't lazy-load neo-tree so netrw hijacking on startup works (#1489) --- lua/kickstart/plugins/neo-tree.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index bd442269..c7067891 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -9,7 +9,7 @@ return { 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended 'MunifTanjim/nui.nvim', }, - cmd = 'Neotree', + lazy = false, keys = { { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, }, From f5a9f9cdc607068bb23647ac7e6ff650dc02e2c9 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 11 May 2025 02:23:54 +0200 Subject: [PATCH 075/140] README: mention fd-find in requirements (#1477) Fixes #1476 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ace8b9b..41139505 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ If you are experiencing issues, please make sure you have the latest versions. External Requirements: - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) -- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) +- [ripgrep](https://github.com/BurntSushi/ripgrep#installation), + [fd-find](https://github.com/sharkdp/fd#installation) - Clipboard tool (xclip/xsel/win32yank or other depending on the platform) - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true From 6ba2408cdf5eb7a0e4b62c7d6fab63b64dd720f6 Mon Sep 17 00:00:00 2001 From: Omri Sarig Date: Sun, 11 May 2025 02:29:04 +0200 Subject: [PATCH 076/140] fix: rename vim.highlight.on_yank to vim.hl.on_yank (#1482) The functions of vim.highlight were renamed to vim.hl on commit 18b43c331d8a0ed87d7cbefe2a18543b8e4ad360 of neovim, which was applied with the release of nvim version 0.11. Now, the use of vim.highlight is deprecated, and instead, one should use vim.hl functions. In practice, vim.highlight is still working, however, asking for help for vim.highlight.on_yank fails (E149), while asking for help for vim.hl.on_yank works as expected. So, by updating the used function, a new user will have easier time looking getting the relevant help. Co-authored-by: Omri Sarig --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index eb715025..b98ffc61 100644 --- a/init.lua +++ b/init.lua @@ -210,12 +210,12 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- Highlight when yanking (copying) text -- Try it with `yap` in normal mode --- See `:help vim.highlight.on_yank()` +-- See `:help vim.hl.on_yank()` vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), callback = function() - vim.highlight.on_yank() + vim.hl.on_yank() end, }) From 3338d3920620861f8313a2745fd5d2be39f39534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Calla=20Alarc=C3=B3n?= Date: Thu, 22 May 2025 23:10:04 +0200 Subject: [PATCH 077/140] Update remaining Mason's old address (#1530) --- lua/kickstart/plugins/debug.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 753cb0ce..8e332bf2 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -18,7 +18,7 @@ return { 'nvim-neotest/nvim-nio', -- Installs the debug adapters for you - 'williamboman/mason.nvim', + 'mason-org/mason.nvim', 'jay-babu/mason-nvim-dap.nvim', -- Add your own debuggers here From 2d541c41402abd53aa601e9a10e1dafea42b975c Mon Sep 17 00:00:00 2001 From: Advin Suryavanshi <78780005+advinsuryavanshi@users.noreply.github.com> Date: Tue, 27 Jan 2026 19:47:34 +0530 Subject: [PATCH 078/140] fix: update main module reference for nvim-treesitter (#1832) configs -> config in init.lua --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b98ffc61..2fecf170 100644 --- a/init.lua +++ b/init.lua @@ -941,7 +941,7 @@ require('lazy').setup({ { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', - main = 'nvim-treesitter.configs', -- Sets main module to use for opts + main = 'nvim-treesitter.config', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, From 5740ddcf9c89c616b114e0b6c39ac66f857d609b Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 09:19:08 -0500 Subject: [PATCH 079/140] note: add info about why we ignore lazy-lock --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 005b535b..e99c112a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ test.sh nvim spell/ + +# You can uncomment this yourself if you want to lock the lazy-lock.json, +# but for kickstart, it makes sense to leave it ignored. lazy-lock.json From 3ddda4a8b8fd25f3a1d982ec0821043d1d9c607b Mon Sep 17 00:00:00 2001 From: Yassine Zouggari Date: Tue, 27 Jan 2026 14:19:51 +0000 Subject: [PATCH 080/140] update: remove client_supports_method (#1810) Neovim 0.11 is now stable --- init.lua | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index 2fecf170..903e6492 100644 --- a/init.lua +++ b/init.lua @@ -572,26 +572,13 @@ require('lazy').setup({ -- the definition of its *type*, not where it was *defined*. map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') - -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) - ---@param client vim.lsp.Client - ---@param method vim.lsp.protocol.Method - ---@param bufnr? integer some lsp support methods only in specific files - ---@return boolean - local function client_supports_method(client, method, bufnr) - if vim.fn.has 'nvim-0.11' == 1 then - return client:supports_method(method, bufnr) - else - return client.supports_method(method, { bufnr = bufnr }) - end - end - -- The following two autocommands are used to highlight references of the -- word under your cursor when your cursor rests there for a little while. -- See `:help CursorHold` for information about when this is executed -- -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -618,7 +605,7 @@ require('lazy').setup({ -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code - if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') From 7ea937dbc5933c7769b163e079b244f3a7a45063 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 09:29:54 -0500 Subject: [PATCH 081/140] fix: as far as i can tell i updated to the right tree sitter stuff --- init.lua | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/init.lua b/init.lua index 903e6492..861a3135 100644 --- a/init.lua +++ b/init.lua @@ -927,28 +927,16 @@ require('lazy').setup({ }, { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - main = 'nvim-treesitter.config', -- Sets main module to use for opts - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { - enable = true, - -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. - -- If you are experiencing weird indenting issues, add the language to - -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { 'ruby' }, - }, - indent = { enable = true, disable = { 'ruby' } }, - }, - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects + config = function() + local filetypes = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } + require('nvim-treesitter').install(filetypes) + vim.api.nvim_create_autocmd('FileType', { + pattern = filetypes, + callback = function() + vim.treesitter.start() + end, + }) + end, }, -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the From 0c17d320bb70b8e0a59608747508f102b1e41173 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 09:52:00 -0500 Subject: [PATCH 082/140] maybe: seeing if we can get away without lazydev and just doing simpler setup --- init.lua | 94 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 45 deletions(-) diff --git a/init.lua b/init.lua index 861a3135..ec84bea0 100644 --- a/init.lua +++ b/init.lua @@ -463,18 +463,6 @@ require('lazy').setup({ }, -- LSP Plugins - { - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, - }, - }, - }, { -- Main LSP Configuration 'neovim/nvim-lspconfig', @@ -669,22 +657,6 @@ require('lazy').setup({ -- -- But for many setups, the LSP (`ts_ls`) will work just fine -- ts_ls = {}, - -- - - lua_ls = { - -- cmd = { ... }, - -- filetypes = { ... }, - -- capabilities = {}, - settings = { - Lua = { - completion = { - callSnippet = 'Replace', - }, - -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, - }, - }, - }, } -- Ensure the servers and tools above are installed @@ -704,22 +676,58 @@ require('lazy').setup({ vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code }) + require('mason-tool-installer').setup { ensure_installed = ensure_installed } require('mason-lspconfig').setup { - ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) - automatic_installation = false, - handlers = { - function(server_name) - local server = servers[server_name] or {} - -- This handles overriding only values explicitly passed - -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for ts_ls) - server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) - require('lspconfig')[server_name].setup(server) - end, - }, + ensure_installed = { 'lua_ls' }, } + + for name, server in pairs(servers) do + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + vim.lsp.config(name, server) + vim.lsp.enable(name) + end + + vim.lsp.config('lua_ls', { + on_init = function(client) + if client.workspace_folders then + local path = client.workspace_folders[1].name + if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then + return + end + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + version = 'LuaJIT', + path = { + 'lua/?.lua', + 'lua/?/init.lua', + }, + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + -- NOTE: this is a lot slower and will cause issues when working on your own configuration. + -- See https://github.com/neovim/nvim-lspconfig/issues/3189 + library = vim.api.nvim_get_runtime_file('', true), + -- + -- Alternatively: + -- library = { + -- vim.env.VIMRUNTIME, + -- -- Depending on the usage, you might want to add additional paths + -- -- here. + -- -- '${3rd}/luv/library', + -- -- '${3rd}/busted/library', + -- }, + }, + }) + end, + settings = { + Lua = {}, + }, + }) end, }, @@ -795,7 +803,6 @@ require('lazy').setup({ }, opts = {}, }, - 'folke/lazydev.nvim', }, --- @module 'blink.cmp' --- @type blink.cmp.Config @@ -841,10 +848,7 @@ require('lazy').setup({ }, sources = { - default = { 'lsp', 'path', 'snippets', 'lazydev' }, - providers = { - lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, - }, + default = { 'lsp', 'path', 'snippets' }, }, snippets = { preset = 'luasnip' }, From ad246eb5dd5fdd3e4ad42ae974b919ff887f2f0a Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 09:55:59 -0500 Subject: [PATCH 083/140] fix: remove mason-lspconfig, we do not need it anymore --- init.lua | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/init.lua b/init.lua index ec84bea0..78f131da 100644 --- a/init.lua +++ b/init.lua @@ -666,23 +666,14 @@ require('lazy').setup({ -- :Mason -- -- You can press `g?` for help in this menu. - -- - -- `mason` had to be setup earlier: to configure its options see the - -- `dependencies` table for `nvim-lspconfig` above. - -- - -- You can add other tools here that you want Mason to install - -- for you, so that they are available from within Neovim. local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + -- You can add other tools here that you want Mason to install }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } - require('mason-lspconfig').setup { - ensure_installed = { 'lua_ls' }, - } - for name, server in pairs(servers) do server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) vim.lsp.config(name, server) @@ -706,21 +697,11 @@ require('lazy').setup({ 'lua/?/init.lua', }, }, - -- Make the server aware of Neovim runtime files workspace = { checkThirdParty = false, -- NOTE: this is a lot slower and will cause issues when working on your own configuration. - -- See https://github.com/neovim/nvim-lspconfig/issues/3189 + -- See https://github.com/neovim/nvim-lspconfig/issues/3189 library = vim.api.nvim_get_runtime_file('', true), - -- - -- Alternatively: - -- library = { - -- vim.env.VIMRUNTIME, - -- -- Depending on the usage, you might want to add additional paths - -- -- here. - -- -- '${3rd}/luv/library', - -- -- '${3rd}/busted/library', - -- }, }, }) end, @@ -728,6 +709,7 @@ require('lazy').setup({ Lua = {}, }, }) + vim.lsp.enable 'lua_ls' end, }, From c8e189ff7876d1af2d79afa343c1c6228ddd9f8b Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Tue, 27 Jan 2026 16:58:30 +0200 Subject: [PATCH 084/140] fix: adjust after 'mini.nvim' transfer to 'nvim-mini' org (#1713) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 78f131da..a5e3e685 100644 --- a/init.lua +++ b/init.lua @@ -875,7 +875,7 @@ require('lazy').setup({ { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, { -- Collection of various small independent plugins/modules - 'echasnovski/mini.nvim', + 'nvim-mini/mini.nvim', config = function() -- Better Around/Inside textobjects -- @@ -908,7 +908,7 @@ require('lazy').setup({ end -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim + -- Check out: https://github.com/nvim-mini/mini.nvim end, }, { -- Highlight, edit, and navigate code From b2af42acb33dc411498e4c2e1717a33348b6954c Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 10:01:35 -0500 Subject: [PATCH 085/140] fix: call setup on guess indent --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index a5e3e685..26e8ae86 100644 --- a/init.lua +++ b/init.lua @@ -246,8 +246,8 @@ rtp:prepend(lazypath) -- -- NOTE: Here is where you install your plugins. require('lazy').setup({ - -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically + -- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}` + { 'NMAC427/guess-indent.nvim', opts = {} }, -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following From 35822809e6c059cd7c0f7a46266ac4fba2890a61 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 10:07:04 -0500 Subject: [PATCH 086/140] fix: remove deprecated methods --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 26e8ae86..6031e079 100644 --- a/init.lua +++ b/init.lua @@ -566,7 +566,7 @@ require('lazy').setup({ -- -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then + if client and client:supports_method('textDocument/documentHighlight', event.buf) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -593,7 +593,7 @@ require('lazy').setup({ -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code - if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then + if client and client:supports_method('textDocument/inlayHint', event.buf) then map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') From 8f479db12312e44e697dd3a222f9552505af189a Mon Sep 17 00:00:00 2001 From: rheia475 Date: Tue, 27 Jan 2026 16:08:09 +0100 Subject: [PATCH 087/140] feat: add Telescope binding for searching through commands (#1675) --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 6031e079..c96677a7 100644 --- a/init.lua +++ b/init.lua @@ -435,6 +435,7 @@ require('lazy').setup({ vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) -- Slightly advanced example of overriding default behavior and theme From b15cca8d3176e90a0fa59ce04e5baf966f0da395 Mon Sep 17 00:00:00 2001 From: Derrek <80121818+derrekcoleman@users.noreply.github.com> Date: Tue, 27 Jan 2026 08:09:58 -0700 Subject: [PATCH 088/140] chore: fix help tag (#1671) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index c96677a7..38c62808 100644 --- a/init.lua +++ b/init.lua @@ -148,7 +148,7 @@ vim.o.splitbelow = true -- Notice listchars is set using `vim.opt` instead of `vim.o`. -- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables. -- See `:help lua-options` --- and `:help lua-options-guide` +-- and `:help lua-guide-options` vim.o.list = true vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } From 88c65592ae8130224e9b132a75f95c685d62d5bd Mon Sep 17 00:00:00 2001 From: Cameron Cummings <33526620+cameroncc@users.noreply.github.com> Date: Tue, 27 Jan 2026 09:10:49 -0600 Subject: [PATCH 089/140] chore: Add .DS_Store to .gitignore (#1637) --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index e99c112a..d12a5c88 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ spell/ # You can uncomment this yourself if you want to lock the lazy-lock.json, # but for kickstart, it makes sense to leave it ignored. lazy-lock.json + +.DS_Store From e87b7281ed19a49d528dec16dc0967616c1dc045 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 10:33:53 -0500 Subject: [PATCH 090/140] feat: move Telescope config to be contained by plugin (#1843) * move telescope related lsp functions inside the telscope plugin declaration block * explicitly enable telescope plugin, add some comments explainging why * update comments with suggestions from @oriori1703 Co-authored-by: Ori Perry <48057913+oriori1703@users.noreply.github.com> * fix formatting in accordance to stylua so that pipeline passes --------- Co-authored-by: Philipp Szechenyi Co-authored-by: Philipp Szechenyi <45265588+szechp@users.noreply.github.com> Co-authored-by: Ori Perry <48057913+oriori1703@users.noreply.github.com> Co-authored-by: philipp --- init.lua | 73 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 25 deletions(-) diff --git a/init.lua b/init.lua index 38c62808..204262aa 100644 --- a/init.lua +++ b/init.lua @@ -360,6 +360,16 @@ require('lazy').setup({ { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', + -- By default, Telescope is included and acts as your picker for everything. + + -- If you would like to switch to a different picker (like snacks, or fzf-lua) + -- you can disable the Telescope plugin by setting enabled to false and enable + -- your replacement picker by requiring it explicitly (e.g. 'custom.plugins.snacks') + + -- Note: If you customize your config for yourself, + -- it’s best to remove the Telescope plugin config entirely + -- instead of just disabling it here, to keep your config clean. + enabled = true, event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim', @@ -438,6 +448,44 @@ require('lazy').setup({ vim.keymap.set('n', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + -- This runs on LSP attach per buffer (see main LSP attach function in 'neovim/nvim-lspconfig' config for more info, + -- it is better explained there). This is a little bit redundant, but we can switch off telescope for an optional + -- picker like snacks more easily when the keymaps are defined in the plugin itself. + -- It sets up buffer-local keymaps, autocommands, and other LSP-related settings + -- whenever an LSP client attaches to a buffer. + + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), + callback = function(event) + local buf = event.buf + + -- Find references for the word under your cursor. + vim.keymap.set('n', 'grr', builtin.lsp_references, { buffer = buf, desc = '[G]oto [R]eferences' }) + + -- Jump to the implementation of the word under your cursor. + -- Useful when your language has ways of declaring types without an actual implementation. + vim.keymap.set('n', 'gri', builtin.lsp_implementations, { buffer = buf, desc = '[G]oto [I]mplementation' }) + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press . + vim.keymap.set('n', 'grd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' }) + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + vim.keymap.set('n', 'gO', builtin.lsp_document_symbols, { buffer = buf, desc = 'Open Document Symbols' }) + + -- Fuzzy find all the symbols in your current workspace. + -- Similar to document symbols, except searches over your entire project. + vim.keymap.set('n', 'gW', builtin.lsp_dynamic_workspace_symbols, { buffer = buf, desc = 'Open Workspace Symbols' }) + + -- Jump to the type of the word under your cursor. + -- Useful when you're not sure what type a variable is and you want to see + -- the definition of its *type*, not where it was *defined*. + vim.keymap.set('n', 'grt', builtin.lsp_type_definitions, { buffer = buf, desc = '[G]oto [T]ype Definition' }) + end, + }) + -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. @@ -532,35 +580,10 @@ require('lazy').setup({ -- or a suggestion from your LSP for this to activate. map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) - -- Find references for the word under your cursor. - map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - -- Jump to the definition of the word under your cursor. - -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . - map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols') - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols') - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') - -- The following two autocommands are used to highlight references of the -- word under your cursor when your cursor rests there for a little while. -- See `:help CursorHold` for information about when this is executed From 318bd3e65c1bd1b4f55e179b87c073191746b272 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 10:42:05 -0500 Subject: [PATCH 091/140] fix: update neovim min required version --- lua/kickstart/health.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index b59d0864..ca684516 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -12,7 +12,7 @@ local check_version = function() return end - if vim.version.ge(vim.version(), '0.10-dev') then + if vim.version.ge(vim.version(), '0.11') then vim.health.ok(string.format("Neovim version is: '%s'", verstr)) else vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) From 21d5aabc22ac44fc9404953a0b77944879465dd0 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 10:49:00 -0500 Subject: [PATCH 092/140] fix: simplify diagnostic config --- init.lua | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/init.lua b/init.lua index 204262aa..dfde4e9b 100644 --- a/init.lua +++ b/init.lua @@ -628,30 +628,17 @@ require('lazy').setup({ -- Diagnostic Config -- See :help vim.diagnostic.Opts vim.diagnostic.config { + update_in_insert = false, severity_sort = true, float = { border = 'rounded', source = 'if_many' }, underline = { severity = vim.diagnostic.severity.ERROR }, - signs = vim.g.have_nerd_font and { - text = { - [vim.diagnostic.severity.ERROR] = '󰅚 ', - [vim.diagnostic.severity.WARN] = '󰀪 ', - [vim.diagnostic.severity.INFO] = '󰋽 ', - [vim.diagnostic.severity.HINT] = '󰌶 ', - }, - } or {}, - virtual_text = { - source = 'if_many', - spacing = 2, - format = function(diagnostic) - local diagnostic_message = { - [vim.diagnostic.severity.ERROR] = diagnostic.message, - [vim.diagnostic.severity.WARN] = diagnostic.message, - [vim.diagnostic.severity.INFO] = diagnostic.message, - [vim.diagnostic.severity.HINT] = diagnostic.message, - } - return diagnostic_message[diagnostic.severity] - end, - }, + + -- Can switch between these as you prefer + virtual_text = true, -- Text shows up at the end of the line + virtual_lines = false, -- Teest shows up underneath the line, with virtual lines + + -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` + jump = { float = true }, } -- LSP servers and clients are able to communicate to each other what features they support. From 560d9dc894b78152920f576fb1bdee1e20d83ee7 Mon Sep 17 00:00:00 2001 From: Mithrandir2k18 <41417290+Mithrandir2k18@users.noreply.github.com> Date: Tue, 27 Jan 2026 16:49:58 +0100 Subject: [PATCH 093/140] docs: Document methods to get the latest neovim (#1626) --- README.md | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 41139505..2b9e52da 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,14 @@ A starting point for Neovim that is: Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. -If you are experiencing issues, please make sure you have the latest versions. +If you are experiencing issues, please make sure you have at least the latest +stable version. Most likely, you want to install neovim via a [package +manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package). +To check your neovim version, run `nvim --version` and make sure it is not +below the latest +['stable'](https://github.com/neovim/neovim/releases/tag/stable) version. If +your chosen install method only gives you an outdated version of neovim, find +alternative [installation methods below](#alternative-neovim-installation-methods). ### Install External Dependencies @@ -154,7 +161,7 @@ examples of adding popularly requested plugins. Below you can find OS specific install instructions for Neovim and dependencies. -After installing all the dependencies continue with the [Install Kickstart](#Install-Kickstart) step. +After installing all the dependencies continue with the [Install Kickstart](#install-kickstart) step. #### Windows Installation @@ -239,3 +246,77 @@ sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim ```
+### Alternative neovim installation methods + +For some systems it is not unexpected that the [package manager installation +method](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package) +recommended by neovim is significantly behind. If that is the case for you, +pick one of the following methods that are known to deliver fresh neovim versions very quickly. +They have been picked for their popularity and because they make installing and updating +neovim to the latest versions easy. You can also find more detail about the +available methods being discussed +[here](https://github.com/nvim-lua/kickstart.nvim/issues/1583). + + +
Bob + +[Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for +all plattforms. Simply install +[rustup](https://rust-lang.github.io/rustup/installation/other.html), +and run the following commands: + +```bash +rustup default stable +rustup update stable +cargo install bob-nvim +bob use stable +``` + +
+ +
Homebrew + +[Homebrew](https://brew.sh) is a package manager popular on Mac and Linux. +Simply install using [`brew install`](https://formulae.brew.sh/formula/neovim). + +
+ +
Flatpak + +Flatpak is a package manager for applications that allows developers to package their applications +just once to make it available on all Linux systems. Simply [install flatpak](https://flatpak.org/setup/) +and setup [flathub](https://flathub.org/setup) to [install neovim](https://flathub.org/apps/io.neovim.nvim). + +
+ +
asdf and mise-en-place + +[asdf](https://asdf-vm.com/) and [mise](https://mise.jdx.dev/) are tool version managers, +mostly aimed towards project-specific tool versioning. However both support managing tools +globally in the user-space as well: + +
mise + +[Install mise](https://mise.jdx.dev/getting-started.html), then run: + +```bash +mise plugins install neovim +mise use neovim@stable +``` + +
+ +
asdf + +[Install asdf](https://asdf-vm.com/guide/getting-started.html), then run: + +```bash +asdf plugin add neovim +asdf install neovim stable +asdf set neovim stable --home +asdf reshim neovim +``` + +
+ +
From 8c6b78c770e34f8b9cb028633403b85010f28d7e Mon Sep 17 00:00:00 2001 From: Francesc Elies Date: Tue, 27 Jan 2026 16:55:15 +0100 Subject: [PATCH 094/140] feat(grep-string): works with visual selection too (#1605) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index dfde4e9b..f32ed49e 100644 --- a/init.lua +++ b/init.lua @@ -344,7 +344,7 @@ require('lazy').setup({ -- Document existing key chains spec = { - { 's', group = '[S]earch' }, + { 's', group = '[S]earch', mode = { 'n', 'v' } }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, @@ -440,7 +440,7 @@ require('lazy').setup({ vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) + vim.keymap.set({ 'n', 'v' }, 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) From 7e54a4c5c80ccefa993777accbce97a20f5348cc Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 12:00:56 -0500 Subject: [PATCH 095/140] fix: trimming down config and updating stylua --- .stylua.toml | 1 + init.lua | 108 +++++++---------------------- lua/kickstart/plugins/debug.lua | 28 ++------ lua/kickstart/plugins/gitsigns.lua | 12 +--- lua/kickstart/plugins/lint.lua | 4 +- 5 files changed, 36 insertions(+), 117 deletions(-) diff --git a/.stylua.toml b/.stylua.toml index 139e9397..edfa5067 100644 --- a/.stylua.toml +++ b/.stylua.toml @@ -4,3 +4,4 @@ indent_type = "Spaces" indent_width = 2 quote_style = "AutoPreferSingle" call_parentheses = "None" +collapse_simple_statement = "Always" diff --git a/init.lua b/init.lua index f32ed49e..6b7c82af 100644 --- a/init.lua +++ b/init.lua @@ -114,9 +114,7 @@ vim.o.showmode = false -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.schedule(function() - vim.o.clipboard = 'unnamedplus' -end) +vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) -- Enable break indent vim.o.breakindent = true @@ -214,9 +212,7 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() - vim.hl.on_yank() - end, + callback = function() vim.hl.on_yank() end, }) -- [[ Install `lazy.nvim` plugin manager ]] @@ -225,9 +221,7 @@ local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } - if vim.v.shell_error ~= 0 then - error('Error cloning lazy.nvim:\n' .. out) - end + if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end end ---@type vim.Option @@ -249,13 +243,6 @@ require('lazy').setup({ -- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}` { 'NMAC427/guess-indent.nvim', opts = {} }, - -- NOTE: Plugins can also be added by using a table, - -- with the first argument being the link and the following - -- keys can be used to configure plugin behavior/loading/etc. - -- - -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded. - -- - -- Alternatively, use `config = function() ... end` for full control over the configuration. -- If you prefer to call `setup` explicitly, use: -- { @@ -300,47 +287,11 @@ require('lazy').setup({ { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', - event = 'VimEnter', -- Sets the loading event to 'VimEnter' + event = 'VimEnter', opts = { -- delay between pressing a key and opening which-key (milliseconds) - -- this setting is independent of vim.o.timeoutlen delay = 0, - icons = { - -- set icon mappings to true if you have a Nerd Font - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default which-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = ' ', - Down = ' ', - Left = ' ', - Right = ' ', - C = ' ', - M = ' ', - D = ' ', - S = ' ', - CR = ' ', - Esc = ' ', - ScrollWheelDown = ' ', - ScrollWheelUp = ' ', - NL = ' ', - BS = ' ', - Space = ' ', - Tab = ' ', - F1 = '', - F2 = '', - F3 = '', - F4 = '', - F5 = '', - F6 = '', - F7 = '', - F8 = '', - F9 = '', - F10 = '', - F11 = '', - F12 = '', - }, - }, + icons = { mappings = vim.g.have_nerd_font }, -- Document existing key chains spec = { @@ -382,9 +333,7 @@ require('lazy').setup({ -- `cond` is a condition used to determine whether this plugin should be -- installed and loaded. - cond = function() - return vim.fn.executable 'make' == 1 - end, + cond = function() return vim.fn.executable 'make' == 1 end, }, { 'nvim-telescope/telescope-ui-select.nvim' }, @@ -497,17 +446,20 @@ require('lazy').setup({ -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys - vim.keymap.set('n', 's/', function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end, { desc = '[S]earch [/] in Open Files' }) + vim.keymap.set( + 'n', + 's/', + function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, + { desc = '[S]earch [/] in Open Files' } + ) -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) + vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) end, }, @@ -618,9 +570,7 @@ require('lazy').setup({ -- -- This may be unwanted, since they displace some of your code if client and client:supports_method('textDocument/inlayHint', event.buf) then - map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) - end, '[T]oggle Inlay [H]ints') + map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') end end, }) @@ -695,9 +645,7 @@ require('lazy').setup({ on_init = function(client) if client.workspace_folders then local path = client.workspace_folders[1].name - if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then - return - end + if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end end client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { @@ -731,9 +679,7 @@ require('lazy').setup({ keys = { { 'f', - function() - require('conform').format { async = true, lsp_format = 'fallback' } - end, + function() require('conform').format { async = true, lsp_format = 'fallback' } end, mode = '', desc = '[F]ormat buffer', }, @@ -778,9 +724,7 @@ require('lazy').setup({ -- Build Step is needed for regex support in snippets. -- This step is not supported in many windows environments. -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then - return - end + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then return end return 'make install_jsregexp' end)(), dependencies = { @@ -914,9 +858,7 @@ require('lazy').setup({ -- default behavior. For example, here we set the section for -- cursor location to LINE:COLUMN ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end + statusline.section_location = function() return '%2l:%-2v' end -- ... and there is more! -- Check out: https://github.com/nvim-mini/mini.nvim @@ -929,9 +871,7 @@ require('lazy').setup({ require('nvim-treesitter').install(filetypes) vim.api.nvim_create_autocmd('FileType', { pattern = filetypes, - callback = function() - vim.treesitter.start() - end, + callback = function() vim.treesitter.start() end, }) end, }, diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 8e332bf2..1e3570f9 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -28,52 +28,38 @@ return { -- Basic debugging keymaps, feel free to change to your liking! { '', - function() - require('dap').continue() - end, + function() require('dap').continue() end, desc = 'Debug: Start/Continue', }, { '', - function() - require('dap').step_into() - end, + function() require('dap').step_into() end, desc = 'Debug: Step Into', }, { '', - function() - require('dap').step_over() - end, + function() require('dap').step_over() end, desc = 'Debug: Step Over', }, { '', - function() - require('dap').step_out() - end, + function() require('dap').step_out() end, desc = 'Debug: Step Out', }, { 'b', - function() - require('dap').toggle_breakpoint() - end, + function() require('dap').toggle_breakpoint() end, desc = 'Debug: Toggle Breakpoint', }, { 'B', - function() - require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, + function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, desc = 'Debug: Set Breakpoint', }, -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. { '', - function() - require('dapui').toggle() - end, + function() require('dapui').toggle() end, desc = 'Debug: See last session result.', }, }, diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index cbbd22d2..777e470a 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -34,12 +34,8 @@ return { -- Actions -- visual mode - map('v', 'hs', function() - gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'git [s]tage hunk' }) - map('v', 'hr', function() - gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'git [r]eset hunk' }) + map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) + map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) -- normal mode map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) @@ -49,9 +45,7 @@ return { map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) - map('n', 'hD', function() - gitsigns.diffthis '@' - end, { desc = 'git [D]iff against last commit' }) + map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) -- Toggles map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index dec42f09..f8a73485 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -50,9 +50,7 @@ return { -- Only run the linter in buffers that you can modify in order to -- avoid superfluous noise, notably within the handy LSP pop-ups that -- describe the hovered symbol using Markdown. - if vim.bo.modifiable then - lint.try_lint() - end + if vim.bo.modifiable then lint.try_lint() end end, }) end, From e79572c9e6978787af2bca164a85ab6821caeb7b Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 27 Jan 2026 12:09:56 -0500 Subject: [PATCH 096/140] fix: continue cleaning up docs and config --- init.lua | 63 +++++++++++++++++++++----------------------------------- 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/init.lua b/init.lua index 6b7c82af..d5ae6dc9 100644 --- a/init.lua +++ b/init.lua @@ -171,7 +171,22 @@ vim.o.confirm = true -- See `:help hlsearch` vim.keymap.set('n', '', 'nohlsearch') --- Diagnostic keymaps +-- Diagnostic Config & Keymaps +-- See :help vim.diagnostic.Opts +vim.diagnostic.config { + update_in_insert = false, + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = vim.diagnostic.severity.ERROR }, + + -- Can switch between these as you prefer + virtual_text = true, -- Text shows up at the end of the line + virtual_lines = false, -- Teest shows up underneath the line, with virtual lines + + -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` + jump = { float = true }, +} + vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier @@ -373,9 +388,7 @@ require('lazy').setup({ -- }, -- pickers = {} extensions = { - ['ui-select'] = { - require('telescope.themes').get_dropdown(), - }, + ['ui-select'] = { require('telescope.themes').get_dropdown() }, }, } @@ -398,11 +411,7 @@ require('lazy').setup({ vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) -- This runs on LSP attach per buffer (see main LSP attach function in 'neovim/nvim-lspconfig' config for more info, - -- it is better explained there). This is a little bit redundant, but we can switch off telescope for an optional - -- picker like snacks more easily when the keymaps are defined in the plugin itself. - -- It sets up buffer-local keymaps, autocommands, and other LSP-related settings - -- whenever an LSP client attaches to a buffer. - + -- it is better explained there). This allows easily switching between pickers if you prefer using something else! vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), callback = function(event) @@ -435,7 +444,7 @@ require('lazy').setup({ end, }) - -- Slightly advanced example of overriding default behavior and theme + -- Override default behavior and theme when searching vim.keymap.set('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { @@ -472,7 +481,6 @@ require('lazy').setup({ -- Mason must be loaded before its dependents so we need to set it up here. -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` { 'mason-org/mason.nvim', opts = {} }, - 'mason-org/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. @@ -575,22 +583,6 @@ require('lazy').setup({ end, }) - -- Diagnostic Config - -- See :help vim.diagnostic.Opts - vim.diagnostic.config { - update_in_insert = false, - severity_sort = true, - float = { border = 'rounded', source = 'if_many' }, - underline = { severity = vim.diagnostic.severity.ERROR }, - - -- Can switch between these as you prefer - virtual_text = true, -- Text shows up at the end of the line - virtual_lines = false, -- Teest shows up underneath the line, with virtual lines - - -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` - jump = { float = true }, - } - -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. @@ -599,19 +591,12 @@ require('lazy').setup({ -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. - -- - -- Add any additional override configuration in the following tables. Available keys are: - -- - cmd (table): Override the default command used to start the server - -- - filetypes (table): Override the default list of associated filetypes for the server - -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. - -- - settings (table): Override the default settings passed when initializing the server. - -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + -- See `:help lsp-config` for information about keys and how to configure local servers = { -- clangd = {}, -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, - -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: -- https://github.com/pmizio/typescript-tools.nvim @@ -629,6 +614,7 @@ require('lazy').setup({ -- You can press `g?` for help in this menu. local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { + 'lua_ls', -- Lua Language server 'stylua', -- Used to format Lua code -- You can add other tools here that you want Mason to install }) @@ -641,6 +627,7 @@ require('lazy').setup({ vim.lsp.enable(name) end + -- Special Lua Config, as recommended by neovim help docs vim.lsp.config('lua_ls', { on_init = function(client) if client.workspace_folders then @@ -651,10 +638,7 @@ require('lazy').setup({ client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { runtime = { version = 'LuaJIT', - path = { - 'lua/?.lua', - 'lua/?/init.lua', - }, + path = { 'lua/?.lua', 'lua/?/init.lua' }, }, workspace = { checkThirdParty = false, @@ -864,6 +848,7 @@ require('lazy').setup({ -- Check out: https://github.com/nvim-mini/mini.nvim end, }, + { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', config = function() From df9436c0e57425a43b527c3ee1d63c98af3b6768 Mon Sep 17 00:00:00 2001 From: giogt Date: Sun, 22 Feb 2026 23:28:15 +0000 Subject: [PATCH 097/140] Clarify comment in .gitignore for lazy-lock.json The current comment in .gitignore for lazy-lock.json suggests to uncomment it yourself, but you actually need to comment it instead. This change modifies the comment to clarify the recommended approach for kickstart users. --- .gitignore | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d12a5c88..3bec00f5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,9 @@ nvim spell/ -# You can uncomment this yourself if you want to lock the lazy-lock.json, -# but for kickstart, it makes sense to leave it ignored. +# You likely want to comment this, since it's recommended to track lazy-lock.json in version +# control, see https://lazy.folke.io/usage/lockfile +# For kickstart, it makes sense to leave it ignored. lazy-lock.json .DS_Store From 1ba17893188d9bdbe483e35b77ce3678b6cd30c3 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Fri, 27 Feb 2026 19:41:45 +0200 Subject: [PATCH 098/140] Re-add mason-lspconfig --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index d5ae6dc9..42467039 100644 --- a/init.lua +++ b/init.lua @@ -481,6 +481,8 @@ require('lazy').setup({ -- Mason must be loaded before its dependents so we need to set it up here. -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` { 'mason-org/mason.nvim', opts = {} }, + -- Maps LSP server names between nvim-lspconfig and Mason package names. + 'mason-org/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. From b9f3965282ae2a3c746ee24efb6dcd6962e8e742 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Fri, 27 Feb 2026 20:12:40 +0200 Subject: [PATCH 099/140] Clean up the lua_ls config --- init.lua | 61 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/init.lua b/init.lua index 42467039..aacc847a 100644 --- a/init.lua +++ b/init.lua @@ -594,6 +594,7 @@ require('lazy').setup({ -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- See `:help lsp-config` for information about keys and how to configure + ---@type table local servers = { -- clangd = {}, -- gopls = {}, @@ -605,6 +606,37 @@ require('lazy').setup({ -- -- But for many setups, the LSP (`ts_ls`) will work just fine -- ts_ls = {}, + + stylua = {}, -- Used to format Lua code + + -- Special Lua Config, as recommended by neovim help docs + lua_ls = { + on_init = function(client) + if client.workspace_folders then + local path = client.workspace_folders[1].name + if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + version = 'LuaJIT', + path = { 'lua/?.lua', 'lua/?/init.lua' }, + }, + workspace = { + checkThirdParty = false, + -- NOTE: this is a lot slower and will cause issues when working on your own configuration. + -- See https://github.com/neovim/nvim-lspconfig/issues/3189 + library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), { + '${3rd}/luv/library', + '${3rd}/busted/library', + }), + }, + }) + end, + settings = { + Lua = {}, + }, + }, } -- Ensure the servers and tools above are installed @@ -616,8 +648,6 @@ require('lazy').setup({ -- You can press `g?` for help in this menu. local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { - 'lua_ls', -- Lua Language server - 'stylua', -- Used to format Lua code -- You can add other tools here that you want Mason to install }) @@ -628,33 +658,6 @@ require('lazy').setup({ vim.lsp.config(name, server) vim.lsp.enable(name) end - - -- Special Lua Config, as recommended by neovim help docs - vim.lsp.config('lua_ls', { - on_init = function(client) - if client.workspace_folders then - local path = client.workspace_folders[1].name - if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end - end - - client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { - runtime = { - version = 'LuaJIT', - path = { 'lua/?.lua', 'lua/?/init.lua' }, - }, - workspace = { - checkThirdParty = false, - -- NOTE: this is a lot slower and will cause issues when working on your own configuration. - -- See https://github.com/neovim/nvim-lspconfig/issues/3189 - library = vim.api.nvim_get_runtime_file('', true), - }, - }) - end, - settings = { - Lua = {}, - }, - }) - vim.lsp.enable 'lua_ls' end, }, From 177ff6148391742ccb7aaa93c05b95cd6fc853e2 Mon Sep 17 00:00:00 2001 From: orip Date: Sat, 26 Apr 2025 14:35:04 +0300 Subject: [PATCH 100/140] Add type hints to plugin options where possible This could help beginners to get autocompletion, catch mistakes earlier, and allow them to skip the docs for simple configs. This is not perfect because a lot of the plugins type all of their keys as required, even though they have defaults, but this is good enough. --- init.lua | 42 ++++++++++++++++++++------- lua/custom/plugins/init.lua | 3 ++ lua/kickstart/plugins/autopairs.lua | 2 ++ lua/kickstart/plugins/debug.lua | 4 +++ lua/kickstart/plugins/gitsigns.lua | 5 ++++ lua/kickstart/plugins/indent_line.lua | 4 +++ lua/kickstart/plugins/lint.lua | 2 ++ lua/kickstart/plugins/neo-tree.lua | 4 +++ 8 files changed, 56 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index aacc847a..0d01c598 100644 --- a/init.lua +++ b/init.lua @@ -275,13 +275,16 @@ require('lazy').setup({ -- See `:help gitsigns` to understand what the configuration keys do { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', + ---@module 'gitsigns' + ---@type Gitsigns.Config + ---@diagnostic disable-next-line: missing-fields opts = { signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, + add = { text = '+' }, ---@diagnostic disable-line: missing-fields + change = { text = '~' }, ---@diagnostic disable-line: missing-fields + delete = { text = '_' }, ---@diagnostic disable-line: missing-fields + topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields + changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields }, }, }, @@ -303,6 +306,9 @@ require('lazy').setup({ { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', + ---@module 'which-key' + ---@type wk.Opts + ---@diagnostic disable-next-line: missing-fields opts = { -- delay between pressing a key and opening which-key (milliseconds) delay = 0, @@ -480,7 +486,13 @@ require('lazy').setup({ -- Automatically install LSPs and related tools to stdpath for Neovim -- Mason must be loaded before its dependents so we need to set it up here. -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` - { 'mason-org/mason.nvim', opts = {} }, + { + 'mason-org/mason.nvim', + ---@module 'mason.settings' + ---@type MasonSettings + ---@diagnostic disable-next-line: missing-fields + opts = {}, + }, -- Maps LSP server names between nvim-lspconfig and Mason package names. 'mason-org/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', @@ -673,6 +685,8 @@ require('lazy').setup({ desc = '[F]ormat buffer', }, }, + ---@module 'conform' + ---@type conform.setupOpts opts = { notify_on_error = false, format_on_save = function(bufnr) @@ -730,8 +744,8 @@ require('lazy').setup({ opts = {}, }, }, - --- @module 'blink.cmp' - --- @type blink.cmp.Config + ---@module 'blink.cmp' + ---@type blink.cmp.Config opts = { keymap = { -- 'default' (recommended) for mappings similar to built-in completions @@ -816,7 +830,15 @@ require('lazy').setup({ }, -- Highlight todo, notes, etc in comments - { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, + { + 'folke/todo-comments.nvim', + event = 'VimEnter', + dependencies = { 'nvim-lua/plenary.nvim' }, + ---@module 'todo-comments' + ---@type TodoOptions + ---@diagnostic disable-next-line: missing-fields + opts = { signs = false }, + }, { -- Collection of various small independent plugins/modules 'nvim-mini/mini.nvim', @@ -892,7 +914,7 @@ require('lazy').setup({ -- Or use telescope! -- In normal mode type `sh` then write `lazy.nvim-plugin` -- you can continue same window with `sr` which resumes last telescope search -}, { +}, { ---@diagnostic disable-line: missing-fields ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..b3ddcfdd 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,7 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information + +---@module 'lazy' +---@type LazySpec return {} diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 386d392e..351dad86 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -1,6 +1,8 @@ -- autopairs -- https://github.com/windwp/nvim-autopairs +---@module 'lazy' +---@type LazySpec return { 'windwp/nvim-autopairs', event = 'InsertEnter', diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 1e3570f9..bb3f8790 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -6,6 +6,8 @@ -- be extended to other languages as well. That's why it's called -- kickstart.nvim and not kitchen-sink.nvim ;) +---@module 'lazy' +---@type LazySpec return { -- NOTE: Yes, you can install new plugins here! 'mfussenegger/nvim-dap', @@ -86,11 +88,13 @@ return { -- Dap UI setup -- For more information, see |:help nvim-dap-ui| + ---@diagnostic disable-next-line: missing-fields dapui.setup { -- Set icons to characters that are more likely to work in every terminal. -- Feel free to remove or use ones that you like more! :) -- Don't feel like these are good choices. icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, + ---@diagnostic disable-next-line: missing-fields controls = { icons = { pause = '⏸', diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 777e470a..f0137084 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -2,9 +2,14 @@ -- NOTE: gitsigns is already included in init.lua but contains only the base -- config. This will add also the recommended keymaps. +---@module 'lazy' +---@type LazySpec return { { 'lewis6991/gitsigns.nvim', + ---@module 'gitsigns' + ---@type Gitsigns.Config + ---@diagnostic disable-next-line: missing-fields opts = { on_attach = function(bufnr) local gitsigns = require 'gitsigns' diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua index ed7f2693..6a95da80 100644 --- a/lua/kickstart/plugins/indent_line.lua +++ b/lua/kickstart/plugins/indent_line.lua @@ -1,9 +1,13 @@ +---@module 'lazy' +---@type LazySpec return { { -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help ibl` main = 'ibl', + ---@module 'ibl' + ---@type ibl.config opts = {}, }, } diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index f8a73485..7054023c 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -1,3 +1,5 @@ +---@module 'lazy' +---@type LazySpec return { { -- Linting diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c7067891..af8d4495 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -1,6 +1,8 @@ -- Neo-tree is a Neovim plugin to browse the file system -- https://github.com/nvim-neo-tree/neo-tree.nvim +---@module 'lazy' +---@type LazySpec return { 'nvim-neo-tree/neo-tree.nvim', version = '*', @@ -13,6 +15,8 @@ return { keys = { { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, }, + ---@module 'neo-tree' + ---@type neotree.Config opts = { filesystem = { window = { From 09ab9ae2656d03d10bbd44fb7dceb7547e6ac576 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Fri, 27 Feb 2026 20:55:53 +0200 Subject: [PATCH 101/140] Fix typo --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0d01c598..956c27b2 100644 --- a/init.lua +++ b/init.lua @@ -181,7 +181,7 @@ vim.diagnostic.config { -- Can switch between these as you prefer virtual_text = true, -- Text shows up at the end of the line - virtual_lines = false, -- Teest shows up underneath the line, with virtual lines + virtual_lines = false, -- Text shows up underneath the line, with virtual lines -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` jump = { float = true }, From 80b1ee1789d19b3c949ab50ba959f412cfc5e54b Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Fri, 27 Feb 2026 21:04:07 +0200 Subject: [PATCH 102/140] Add 'gr' group to which-keys Adds 'gr' to which-keys documentation, so users can see that LSP actions are grouped after 'gr' key binds. Co-authored-by: thiago-negri --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 956c27b2..05243283 100644 --- a/init.lua +++ b/init.lua @@ -319,6 +319,7 @@ require('lazy').setup({ { 's', group = '[S]earch', mode = { 'n', 'v' } }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'gr', group = 'LSP Actions', mode = { 'n' } }, }, }, }, From 966d5e94b15404a93bffc5f5bc8fbf68e08ccbc1 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Thu, 2 Oct 2025 11:35:41 +0300 Subject: [PATCH 103/140] Add installtion instructions for `tree-sitter-cli` to the README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2b9e52da..7440ef54 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ External Requirements: - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation), [fd-find](https://github.com/sharkdp/fd#installation) +- [tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/crates/cli/README.md#installation) - Clipboard tool (xclip/xsel/win32yank or other depending on the platform) - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true @@ -192,7 +193,7 @@ winget install --accept-source-agreements chocolatey.chocolatey 2. install all requirements using choco, exit the previous cmd and open a new one so that choco path is set, and run in cmd as **admin**: ``` -choco install -y neovim git ripgrep wget fd unzip gzip mingw make +choco install -y neovim git ripgrep wget fd unzip gzip mingw make tree-sitter ```
WSL (Windows Subsystem for Linux) @@ -202,7 +203,7 @@ wsl --install wsl sudo add-apt-repository ppa:neovim-ppa/unstable -y sudo apt update -sudo apt install make gcc ripgrep unzip git xclip neovim +sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim ```
@@ -212,14 +213,14 @@ sudo apt install make gcc ripgrep unzip git xclip neovim ``` sudo add-apt-repository ppa:neovim-ppa/unstable -y sudo apt update -sudo apt install make gcc ripgrep unzip git xclip neovim +sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim ```
Debian Install Steps ``` sudo apt update -sudo apt install make gcc ripgrep unzip git xclip curl +sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip curl # Now we install nvim curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz @@ -235,14 +236,14 @@ sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
Fedora Install Steps ``` -sudo dnf install -y gcc make git ripgrep fd-find unzip neovim +sudo dnf install -y gcc make git ripgrep fd-find tree-sitter-cli unzip neovim ```
Arch Install Steps ``` -sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim +sudo pacman -S --noconfirm --needed gcc make git ripgrep fd tree-sitter-cli unzip neovim ```
From a6dcf6874b54b294d0c2c4009161bdebd55183ef Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Fri, 27 Feb 2026 21:36:39 +0200 Subject: [PATCH 104/140] Attach treesitter using language name instead of filetype --- init.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 05243283..c95e83cb 100644 --- a/init.lua +++ b/init.lua @@ -879,12 +879,21 @@ require('lazy').setup({ { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', + lazy = false, + build = ':TSUpdate', + branch = 'main', config = function() - local filetypes = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } - require('nvim-treesitter').install(filetypes) + local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } + require('nvim-treesitter').install(parsers) vim.api.nvim_create_autocmd('FileType', { - pattern = filetypes, - callback = function() vim.treesitter.start() end, + callback = function(args) + local buf, filetype = args.buf, args.match + + local language = vim.treesitter.language.get_lang(filetype) + if not vim.tbl_contains(parsers, language) then return end + + vim.treesitter.start() + end, }) end, }, From 40214960508cb232adbe5cee99241b3bf1395f03 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Fri, 27 Feb 2026 22:56:57 +0200 Subject: [PATCH 105/140] Add treesitter indentation --- init.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index c95e83cb..a35d52fc 100644 --- a/init.lua +++ b/init.lua @@ -882,6 +882,7 @@ require('lazy').setup({ lazy = false, build = ':TSUpdate', branch = 'main', + -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro` config = function() local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } require('nvim-treesitter').install(parsers) @@ -890,9 +891,20 @@ require('lazy').setup({ local buf, filetype = args.buf, args.match local language = vim.treesitter.language.get_lang(filetype) - if not vim.tbl_contains(parsers, language) then return end + if not language then return end - vim.treesitter.start() + -- check if parser exists and load it + if not vim.treesitter.language.add(language) then return end + -- enables syntax highlighting and other treesitter features + vim.treesitter.start(buf, language) + + -- enables treesitter based folds + -- for more info on folds see `:help folds` + -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + -- vim.wo.foldmethod = 'expr' + + -- enables treesitter based indentation + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end, }) end, From 1f4c21f4637eb7af77c34ac87c739e378043a336 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Fri, 27 Feb 2026 23:27:25 +0200 Subject: [PATCH 106/140] Don't extend lsp capabilities because blink does it internally --- init.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/init.lua b/init.lua index a35d52fc..227f6e13 100644 --- a/init.lua +++ b/init.lua @@ -598,12 +598,6 @@ require('lazy').setup({ end, }) - -- LSP servers and clients are able to communicate to each other what features they support. - -- By default, Neovim doesn't support everything that is in the LSP specification. - -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. - -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers. - local capabilities = require('blink.cmp').get_lsp_capabilities() - -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- See `:help lsp-config` for information about keys and how to configure @@ -667,7 +661,6 @@ require('lazy').setup({ require('mason-tool-installer').setup { ensure_installed = ensure_installed } for name, server in pairs(servers) do - server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) vim.lsp.config(name, server) vim.lsp.enable(name) end From 9a3a2f967859d92c57726d1ccb6c96c408ea335c Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Sat, 28 Feb 2026 11:29:58 +0200 Subject: [PATCH 107/140] Update the github actions --- .github/workflows/stylua.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml index 75db6c33..eb60303f 100644 --- a/.github/workflows/stylua.yml +++ b/.github/workflows/stylua.yml @@ -9,13 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.sha }} - name: Stylua Check - uses: JohnnyMorganz/stylua-action@v3 + uses: JohnnyMorganz/stylua-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} version: latest args: --check . - From 86f1ba26f275d7e5cfb0a6d4652f9ecc02a1492d Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Sat, 28 Feb 2026 11:31:21 +0200 Subject: [PATCH 108/140] Improve undofile comment --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 227f6e13..3adacdee 100644 --- a/init.lua +++ b/init.lua @@ -119,7 +119,7 @@ vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) -- Enable break indent vim.o.breakindent = true --- Save undo history +-- Enable undo/redo changes even after closing and reopening a file vim.o.undofile = true -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term From 7cc245ecafec6e6057f2dd803ce4eef4bca54d55 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Sat, 28 Feb 2026 11:32:40 +0200 Subject: [PATCH 109/140] Format the dap keybinds --- lua/kickstart/plugins/debug.lua | 42 ++++++--------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index bb3f8790..7e58905e 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -28,42 +28,14 @@ return { }, keys = { -- Basic debugging keymaps, feel free to change to your liking! - { - '', - function() require('dap').continue() end, - desc = 'Debug: Start/Continue', - }, - { - '', - function() require('dap').step_into() end, - desc = 'Debug: Step Into', - }, - { - '', - function() require('dap').step_over() end, - desc = 'Debug: Step Over', - }, - { - '', - function() require('dap').step_out() end, - desc = 'Debug: Step Out', - }, - { - 'b', - function() require('dap').toggle_breakpoint() end, - desc = 'Debug: Toggle Breakpoint', - }, - { - 'B', - function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, - desc = 'Debug: Set Breakpoint', - }, + { '', function() require('dap').continue() end, desc = 'Debug: Start/Continue' }, + { '', function() require('dap').step_into() end, desc = 'Debug: Step Into' }, + { '', function() require('dap').step_over() end, desc = 'Debug: Step Over' }, + { '', function() require('dap').step_out() end, desc = 'Debug: Step Out' }, + { 'b', function() require('dap').toggle_breakpoint() end, desc = 'Debug: Toggle Breakpoint' }, + { 'B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, desc = 'Debug: Set Breakpoint' }, -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { - '', - function() require('dapui').toggle() end, - desc = 'Debug: See last session result.', - }, + { '', function() require('dapui').toggle() end, desc = 'Debug: See last session result.' }, }, config = function() local dap = require 'dap' From dabce46993048a4d1a9c0b6f5bd002848cfe9802 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Sat, 28 Feb 2026 13:48:43 +0200 Subject: [PATCH 110/140] Add underline for warnings --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 3adacdee..3593ca2e 100644 --- a/init.lua +++ b/init.lua @@ -177,7 +177,7 @@ vim.diagnostic.config { update_in_insert = false, severity_sort = true, float = { border = 'rounded', source = 'if_many' }, - underline = { severity = vim.diagnostic.severity.ERROR }, + underline = { severity = { min = vim.diagnostic.severity.WARN } }, -- Can switch between these as you prefer virtual_text = true, -- Text shows up at the end of the line From 886f2bc07606ecb1f8fdc46f1c628d004651449b Mon Sep 17 00:00:00 2001 From: Nathan Zeng Date: Fri, 6 Mar 2026 19:18:40 -0800 Subject: [PATCH 111/140] Clarify gitsigns keymap for which-key --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 3593ca2e..068da471 100644 --- a/init.lua +++ b/init.lua @@ -318,7 +318,7 @@ require('lazy').setup({ spec = { { 's', group = '[S]earch', mode = { 'n', 'v' } }, { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first { 'gr', group = 'LSP Actions', mode = { 'n' } }, }, }, @@ -917,7 +917,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. From d97de4f0aeb763d47f0d5303d8ea70853c70931a Mon Sep 17 00:00:00 2001 From: Nathan Zeng Date: Sat, 7 Mar 2026 20:52:02 -0800 Subject: [PATCH 112/140] Remove blink from nvim-lspconfig dependencies --- init.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/init.lua b/init.lua index 3593ca2e..49651465 100644 --- a/init.lua +++ b/init.lua @@ -500,9 +500,6 @@ require('lazy').setup({ -- Useful status updates for LSP. { 'j-hui/fidget.nvim', opts = {} }, - - -- Allows extra capabilities provided by blink.cmp - 'saghen/blink.cmp', }, config = function() -- Brief aside: **What is LSP?** From f7b74c7b837255d298799ad3d7f38f9953d9ac88 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Tue, 10 Mar 2026 15:16:43 +0200 Subject: [PATCH 113/140] Fix typo in the README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7440ef54..093e42a6 100644 --- a/README.md +++ b/README.md @@ -262,7 +262,7 @@ available methods being discussed
Bob [Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for -all plattforms. Simply install +all platforms. Simply install [rustup](https://rust-lang.github.io/rustup/installation/other.html), and run the following commands: From 431cf2e881eaeb10f8cc39d3e3a8f71554a509bd Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Tue, 10 Mar 2026 19:00:43 +0200 Subject: [PATCH 114/140] Fix formating of plugins --- lua/kickstart/plugins/gitsigns.lua | 92 +++++++++++---------- lua/kickstart/plugins/indent_line.lua | 18 ++--- lua/kickstart/plugins/lint.lua | 110 +++++++++++++------------- 3 files changed, 109 insertions(+), 111 deletions(-) diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index f0137084..5f5652f9 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -5,56 +5,54 @@ ---@module 'lazy' ---@type LazySpec return { - { - 'lewis6991/gitsigns.nvim', - ---@module 'gitsigns' - ---@type Gitsigns.Config - ---@diagnostic disable-next-line: missing-fields - opts = { - on_attach = function(bufnr) - local gitsigns = require 'gitsigns' + 'lewis6991/gitsigns.nvim', + ---@module 'gitsigns' + ---@type Gitsigns.Config + ---@diagnostic disable-next-line: missing-fields + opts = { + on_attach = function(bufnr) + local gitsigns = require 'gitsigns' - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then + vim.cmd.normal { ']c', bang = true } + else + gitsigns.nav_hunk 'next' end + end, { desc = 'Jump to next git [c]hange' }) - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal { ']c', bang = true } - else - gitsigns.nav_hunk 'next' - end - end, { desc = 'Jump to next git [c]hange' }) + map('n', '[c', function() + if vim.wo.diff then + vim.cmd.normal { '[c', bang = true } + else + gitsigns.nav_hunk 'prev' + end + end, { desc = 'Jump to previous git [c]hange' }) - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal { '[c', bang = true } - else - gitsigns.nav_hunk 'prev' - end - end, { desc = 'Jump to previous git [c]hange' }) - - -- Actions - -- visual mode - map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) - map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) - -- normal mode - map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) - map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) - map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) - map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) - map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) - map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) - map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) - map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) - map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) - -- Toggles - map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) - end, - }, + -- Actions + -- visual mode + map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) + map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) + -- normal mode + map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) + map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) + map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) + map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) + map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) + map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) + map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) + map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) + map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) + -- Toggles + map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) + map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) + end, }, } diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua index 6a95da80..946ac793 100644 --- a/lua/kickstart/plugins/indent_line.lua +++ b/lua/kickstart/plugins/indent_line.lua @@ -1,13 +1,13 @@ +-- Add indentation guides even on blank lines + ---@module 'lazy' ---@type LazySpec return { - { -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` - main = 'ibl', - ---@module 'ibl' - ---@type ibl.config - opts = {}, - }, + 'lukas-reineke/indent-blankline.nvim', + -- Enable `lukas-reineke/indent-blankline.nvim` + -- See `:help ibl` + main = 'ibl', + ---@module 'ibl' + ---@type ibl.config + opts = {}, } diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 7054023c..3dc5cb0f 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -1,60 +1,60 @@ +-- Linting + ---@module 'lazy' ---@type LazySpec -return { +return +{ + 'mfussenegger/nvim-lint', + event = { 'BufReadPre', 'BufNewFile' }, + config = function() + local lint = require 'lint' + lint.linters_by_ft = { + markdown = { 'markdownlint' }, + } - { -- Linting - 'mfussenegger/nvim-lint', - event = { 'BufReadPre', 'BufNewFile' }, - config = function() - local lint = require 'lint' - lint.linters_by_ft = { - markdown = { 'markdownlint' }, - } + -- To allow other plugins to add linters to require('lint').linters_by_ft, + -- instead set linters_by_ft like this: + -- lint.linters_by_ft = lint.linters_by_ft or {} + -- lint.linters_by_ft['markdown'] = { 'markdownlint' } + -- + -- However, note that this will enable a set of default linters, + -- which will cause errors unless these tools are available: + -- { + -- clojure = { "clj-kondo" }, + -- dockerfile = { "hadolint" }, + -- inko = { "inko" }, + -- janet = { "janet" }, + -- json = { "jsonlint" }, + -- markdown = { "vale" }, + -- rst = { "vale" }, + -- ruby = { "ruby" }, + -- terraform = { "tflint" }, + -- text = { "vale" } + -- } + -- + -- You can disable the default linters by setting their filetypes to nil: + -- lint.linters_by_ft['clojure'] = nil + -- lint.linters_by_ft['dockerfile'] = nil + -- lint.linters_by_ft['inko'] = nil + -- lint.linters_by_ft['janet'] = nil + -- lint.linters_by_ft['json'] = nil + -- lint.linters_by_ft['markdown'] = nil + -- lint.linters_by_ft['rst'] = nil + -- lint.linters_by_ft['ruby'] = nil + -- lint.linters_by_ft['terraform'] = nil + -- lint.linters_by_ft['text'] = nil - -- To allow other plugins to add linters to require('lint').linters_by_ft, - -- instead set linters_by_ft like this: - -- lint.linters_by_ft = lint.linters_by_ft or {} - -- lint.linters_by_ft['markdown'] = { 'markdownlint' } - -- - -- However, note that this will enable a set of default linters, - -- which will cause errors unless these tools are available: - -- { - -- clojure = { "clj-kondo" }, - -- dockerfile = { "hadolint" }, - -- inko = { "inko" }, - -- janet = { "janet" }, - -- json = { "jsonlint" }, - -- markdown = { "vale" }, - -- rst = { "vale" }, - -- ruby = { "ruby" }, - -- terraform = { "tflint" }, - -- text = { "vale" } - -- } - -- - -- You can disable the default linters by setting their filetypes to nil: - -- lint.linters_by_ft['clojure'] = nil - -- lint.linters_by_ft['dockerfile'] = nil - -- lint.linters_by_ft['inko'] = nil - -- lint.linters_by_ft['janet'] = nil - -- lint.linters_by_ft['json'] = nil - -- lint.linters_by_ft['markdown'] = nil - -- lint.linters_by_ft['rst'] = nil - -- lint.linters_by_ft['ruby'] = nil - -- lint.linters_by_ft['terraform'] = nil - -- lint.linters_by_ft['text'] = nil - - -- Create autocommand which carries out the actual linting - -- on the specified events. - local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) - vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { - group = lint_augroup, - callback = function() - -- Only run the linter in buffers that you can modify in order to - -- avoid superfluous noise, notably within the handy LSP pop-ups that - -- describe the hovered symbol using Markdown. - if vim.bo.modifiable then lint.try_lint() end - end, - }) - end, - }, + -- Create autocommand which carries out the actual linting + -- on the specified events. + local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) + vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { + group = lint_augroup, + callback = function() + -- Only run the linter in buffers that you can modify in order to + -- avoid superfluous noise, notably within the handy LSP pop-ups that + -- describe the hovered symbol using Markdown. + if vim.bo.modifiable then lint.try_lint() end + end, + }) + end, } From 164cedf2124b63aca67573c3c1d1365d27aab750 Mon Sep 17 00:00:00 2001 From: Richard Macklin <1863540+rmacklin@users.noreply.github.com> Date: Tue, 10 Mar 2026 11:33:34 -0700 Subject: [PATCH 115/140] Revise comment for lazy-lock.json in .gitignore This is a follow-up to df9436c0e57425a43b527c3ee1d63c98af3b6768 to hopefully make things even clearer. Co-authored-by: Ori Perry --- .gitignore | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3bec00f5..68486fc3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,10 @@ nvim spell/ -# You likely want to comment this, since it's recommended to track lazy-lock.json in version -# control, see https://lazy.folke.io/usage/lockfile -# For kickstart, it makes sense to leave it ignored. +# In your personal fork, you likely want to comment this, since it's recommended to track +# lazy-lock.json in version control - see https://lazy.folke.io/usage/lockfile +# For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded +# merge conflicts. lazy-lock.json .DS_Store From 58170c7ae38e5d8461c2e55ad07d95f0af161685 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Tue, 10 Mar 2026 22:12:41 +0200 Subject: [PATCH 116/140] Fix stylua --- lua/kickstart/plugins/lint.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 3dc5cb0f..326fc3f6 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -2,8 +2,7 @@ ---@module 'lazy' ---@type LazySpec -return -{ +return { 'mfussenegger/nvim-lint', event = { 'BufReadPre', 'BufNewFile' }, config = function() From 8ac4b12632bea46cfa319bd799a6bbddca15bf45 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Fri, 20 Mar 2026 21:59:19 +0200 Subject: [PATCH 117/140] Refactor treesitter attach code --- init.lua | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index ed50b69d..239dbad6 100644 --- a/init.lua +++ b/init.lua @@ -874,8 +874,28 @@ require('lazy').setup({ branch = 'main', -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro` config = function() + -- ensure basic parser are installed local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } require('nvim-treesitter').install(parsers) + + ---@param buf integer + ---@param language string + local function treesitter_try_attach(buf, language) + -- check if parser exists and load it + if not vim.treesitter.language.add(language) then return end + -- enables syntax highlighting and other treesitter features + vim.treesitter.start(buf, language) + + -- enables treesitter based folds + -- for more info on folds see `:help folds` + -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + -- vim.wo.foldmethod = 'expr' + + -- enables treesitter based indentation + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end + + local available_parsers = require('nvim-treesitter').get_available() vim.api.nvim_create_autocmd('FileType', { callback = function(args) local buf, filetype = args.buf, args.match @@ -883,18 +903,7 @@ require('lazy').setup({ local language = vim.treesitter.language.get_lang(filetype) if not language then return end - -- check if parser exists and load it - if not vim.treesitter.language.add(language) then return end - -- enables syntax highlighting and other treesitter features - vim.treesitter.start(buf, language) - - -- enables treesitter based folds - -- for more info on folds see `:help folds` - -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' - -- vim.wo.foldmethod = 'expr' - - -- enables treesitter based indentation - vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + treesitter_try_attach(buf, language) end, }) end, From e01e1eb8f8f6b37bad005d770046174a7918cc78 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Fri, 20 Mar 2026 22:02:36 +0200 Subject: [PATCH 118/140] Auto install treesitter parsers when opening a file closes #1951 --- init.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 239dbad6..cacc5b7b 100644 --- a/init.lua +++ b/init.lua @@ -903,7 +903,18 @@ require('lazy').setup({ local language = vim.treesitter.language.get_lang(filetype) if not language then return end - treesitter_try_attach(buf, language) + local installed_parsers = require('nvim-treesitter').get_installed 'parsers' + + if vim.tbl_contains(installed_parsers, language) then + -- enable the parser if it is installed + treesitter_try_attach(buf, language) + elseif vim.tbl_contains(available_parsers, language) then + -- if a parser is available in `nvim-treesitter` auto install it, and enable it after the installation is done + require('nvim-treesitter').install(language):await(function() treesitter_try_attach(buf, language) end) + else + -- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` + treesitter_try_attach(buf, language) + end end, }) end, From d3168308d47e60d772f592ccc132f27c72437cd3 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Tue, 31 Mar 2026 23:41:27 +0300 Subject: [PATCH 119/140] Update the recommanded gitsigns keybinds closes #1459 --- lua/kickstart/plugins/gitsigns.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 5f5652f9..1d8c50c3 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -44,15 +44,20 @@ return { map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) - map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) - map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) + map('n', 'hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' }) + map('n', 'hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' }) map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) + map('n', 'hQ', function() gitsigns.setqflist 'all' end) + map('n', 'hq', gitsigns.setqflist) -- Toggles map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) + map('n', 'tw', gitsigns.toggle_word_diff) + + -- Text object + map({ 'o', 'x' }, 'ih', gitsigns.select_hunk) end, }, } From 16dd8f50078701fce4e2387c437b80d219b554e0 Mon Sep 17 00:00:00 2001 From: Ori Perry Date: Tue, 31 Mar 2026 23:49:19 +0300 Subject: [PATCH 120/140] Add a comment to the line plugin about installing markdownlint --- lua/kickstart/plugins/lint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 326fc3f6..556f3178 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -8,7 +8,7 @@ return { config = function() local lint = require 'lint' lint.linters_by_ft = { - markdown = { 'markdownlint' }, + markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm } -- To allow other plugins to add linters to require('lint').linters_by_ft, From c7f05a0f47e669148b9b97d18afafead1c767a3b Mon Sep 17 00:00:00 2001 From: Sebastian Studniczek Date: Fri, 10 Apr 2026 20:05:50 +0200 Subject: [PATCH 121/140] Add indentation fallback --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index cacc5b7b..9f008fa5 100644 --- a/init.lua +++ b/init.lua @@ -891,8 +891,12 @@ require('lazy').setup({ -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- vim.wo.foldmethod = 'expr' + -- check if treesitter indentation is available for this language, and if so enable it + -- in case there is no indent query, the indentexpr will fallback to the vim's built in one + local has_indent_query = vim.treesitter.query.get(language, 'indent') ~= nil + -- enables treesitter based indentation - vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end end local available_parsers = require('nvim-treesitter').get_available() From f27810d1bd48d7b4cfb319a9ff290f5b09200a78 Mon Sep 17 00:00:00 2001 From: orip Date: Wed, 15 Apr 2026 03:44:13 +0300 Subject: [PATCH 122/140] Fix treesitter indents Thanks @jackHerby for the report fixes #1995 --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 9f008fa5..b56ce298 100644 --- a/init.lua +++ b/init.lua @@ -893,7 +893,7 @@ require('lazy').setup({ -- check if treesitter indentation is available for this language, and if so enable it -- in case there is no indent query, the indentexpr will fallback to the vim's built in one - local has_indent_query = vim.treesitter.query.get(language, 'indent') ~= nil + local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil -- enables treesitter based indentation if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end From 648471c9eb1f757729e800ff0a6509e01232a8e9 Mon Sep 17 00:00:00 2001 From: Stattek <107233826+Stattek@users.noreply.github.com> Date: Wed, 15 Apr 2026 03:49:09 -0500 Subject: [PATCH 123/140] Fix descriptions of gitsigns keymappings (#1997) * Fix descriptions of keymappings * Fix capitalization --- lua/kickstart/plugins/gitsigns.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 1d8c50c3..500ea6c4 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -50,11 +50,11 @@ return { map('n', 'hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' }) map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) - map('n', 'hQ', function() gitsigns.setqflist 'all' end) - map('n', 'hq', gitsigns.setqflist) + map('n', 'hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' }) + map('n', 'hq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' }) -- Toggles map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tw', gitsigns.toggle_word_diff) + map('n', 'tw', gitsigns.toggle_word_diff, { desc = '[T]oggle git intra-line [w]ord diff' }) -- Text object map({ 'o', 'x' }, 'ih', gitsigns.select_hunk) From 459b86865e9e81235c9db3be553d107adac5f72f Mon Sep 17 00:00:00 2001 From: orip Date: Sun, 12 Apr 2026 19:38:37 +0300 Subject: [PATCH 124/140] Use stylua as an lsp formatter instead of an external formatter --- init.lua | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index b56ce298..dea2fccf 100644 --- a/init.lua +++ b/init.lua @@ -616,6 +616,8 @@ require('lazy').setup({ -- Special Lua Config, as recommended by neovim help docs lua_ls = { on_init = function(client) + client.server_capabilities.documentFormattingProvider = false -- Disable formatting (formatting is done by stylua) + if client.workspace_folders then local path = client.workspace_folders[1].name if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end @@ -637,8 +639,11 @@ require('lazy').setup({ }, }) end, + ---@type lspconfig.settings.lua_ls settings = { - Lua = {}, + Lua = { + format = { enable = false }, -- Disable formatting (formatting is done by stylua) + }, }, }, } @@ -671,7 +676,7 @@ require('lazy').setup({ keys = { { 'f', - function() require('conform').format { async = true, lsp_format = 'fallback' } end, + function() require('conform').format { async = true } end, mode = '', desc = '[F]ormat buffer', }, @@ -688,14 +693,15 @@ require('lazy').setup({ if disable_filetypes[vim.bo[bufnr].filetype] then return nil else - return { - timeout_ms = 500, - lsp_format = 'fallback', - } + return { timeout_ms = 500 } end end, + default_format_opts = { + lsp_format = 'fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely. + }, + -- You can also specify external formatters in here. formatters_by_ft = { - lua = { 'stylua' }, + -- rust = { 'rustfmt' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- From ce353a9b0e3c47d27784509217200818f522329e Mon Sep 17 00:00:00 2001 From: orip Date: Sun, 12 Apr 2026 22:33:59 +0300 Subject: [PATCH 125/140] Change format_on_save to a whitelist instead of a blacklist --- init.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index dea2fccf..600258db 100644 --- a/init.lua +++ b/init.lua @@ -686,14 +686,15 @@ require('lazy').setup({ opts = { notify_on_error = false, format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - if disable_filetypes[vim.bo[bufnr].filetype] then - return nil - else + -- You can specify filetypes to autoformat on save here: + local enabled_filetypes = { + -- lua = true, + -- python = true, + } + if enabled_filetypes[vim.bo[bufnr].filetype] then return { timeout_ms = 500 } + else + return nil end end, default_format_opts = { From 9b4fbc5021551188965d7cba54874fd1496d6ed2 Mon Sep 17 00:00:00 2001 From: orip Date: Sat, 18 Apr 2026 13:19:06 +0300 Subject: [PATCH 126/140] Fix conflicts between built-in incremental selection and mini.ai keymaps closes #1996 closes #1992 --- init.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 600258db..13727202 100644 --- a/init.lua +++ b/init.lua @@ -845,9 +845,16 @@ require('lazy').setup({ -- -- Examples: -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [Q]uote + -- - yinq - [Y]ank [I]nside [I]next [Q]uote -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } + require('mini.ai').setup { + -- NOTE: Avoid conflicts with the built-in incremental selection mappings on Neovim>=0.12 (see `:help treesitter-incremental-selection`) + mappings = { + around_next = 'aa', + inside_next = 'ii', + }, + n_lines = 500, + } -- Add/delete/replace surroundings (brackets, quotes, etc.) -- From 4b065ad2f71935b8b053d26a65735f40bdc85969 Mon Sep 17 00:00:00 2001 From: orip Date: Wed, 22 Apr 2026 17:59:57 +0300 Subject: [PATCH 127/140] Fix mini.ai example --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 13727202..8d1f19a1 100644 --- a/init.lua +++ b/init.lua @@ -845,7 +845,7 @@ require('lazy').setup({ -- -- Examples: -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [I]next [Q]uote + -- - yiiq - [Y]ank [I]nside [I]+1 [Q]uote -- - ci' - [C]hange [I]nside [']quote require('mini.ai').setup { -- NOTE: Avoid conflicts with the built-in incremental selection mappings on Neovim>=0.12 (see `:help treesitter-incremental-selection`) From cd7adee3cebd9cc915bbe69db5472b7da479e001 Mon Sep 17 00:00:00 2001 From: orip Date: Mon, 20 Apr 2026 00:45:20 +0300 Subject: [PATCH 128/140] Refactor and update some of the comments --- init.lua | 69 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/init.lua b/init.lua index 8d1f19a1..80a1488d 100644 --- a/init.lua +++ b/init.lua @@ -94,7 +94,7 @@ vim.g.maplocalleader = ' ' vim.g.have_nerd_font = false -- [[ Setting options ]] --- See `:help vim.o` +-- See `:help vim.o` -- NOTE: You can change these options as you wish! -- For more options, you can see `:help option-list` @@ -172,7 +172,7 @@ vim.o.confirm = true vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic Config & Keymaps --- See :help vim.diagnostic.Opts +-- See `:help vim.diagnostic.Opts` vim.diagnostic.config { update_in_insert = false, severity_sort = true, @@ -272,8 +272,9 @@ require('lazy').setup({ -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. -- - -- See `:help gitsigns` to understand what the configuration keys do - { -- Adds git related signs to the gutter, as well as utilities for managing changes + -- See `:help gitsigns` to understand what each configuration keys does. + -- Adds git related signs to the gutter, as well as utilities for managing changes + { 'lewis6991/gitsigns.nvim', ---@module 'gitsigns' ---@type Gitsigns.Config @@ -302,15 +303,16 @@ require('lazy').setup({ -- -- Then, because we use the `opts` key (recommended), the configuration runs -- after the plugin has been loaded as `require(MODULE).setup(opts)`. - - { -- Useful plugin to show you pending keybinds. + -- + -- Useful plugin to show you pending keybinds. + { 'folke/which-key.nvim', event = 'VimEnter', ---@module 'which-key' ---@type wk.Opts ---@diagnostic disable-next-line: missing-fields opts = { - -- delay between pressing a key and opening which-key (milliseconds) + -- Delay between pressing a key and opening which-key (milliseconds) delay = 0, icons = { mappings = vim.g.have_nerd_font }, @@ -330,8 +332,9 @@ require('lazy').setup({ -- you do for a plugin at the top level, you can do for a dependency. -- -- Use the `dependencies` key to specify the dependencies of a particular plugin - - { -- Fuzzy Finder (files, lsp, etc) + -- + -- Fuzzy Finder (files, lsp, etc) + { 'nvim-telescope/telescope.nvim', -- By default, Telescope is included and acts as your picker for everything. @@ -346,7 +349,8 @@ require('lazy').setup({ event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim', - { -- If encountering errors, see telescope-fzf-native README for installation instructions + -- If encountering errors, see telescope-fzf-native README for installation instructions + { 'nvim-telescope/telescope-fzf-native.nvim', -- `build` is used to run some command when the plugin is installed/updated. @@ -417,8 +421,8 @@ require('lazy').setup({ vim.keymap.set('n', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - -- This runs on LSP attach per buffer (see main LSP attach function in 'neovim/nvim-lspconfig' config for more info, - -- it is better explained there). This allows easily switching between pickers if you prefer using something else! + -- Add Telescope-based LSP pickers when an LSP attaches to a buffer. + -- If you later switch picker plugins, this is where to update these mappings. vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), callback = function(event) @@ -669,7 +673,8 @@ require('lazy').setup({ end, }, - { -- Autoformat + -- Autoformat + { 'stevearc/conform.nvim', event = { 'BufWritePre' }, cmd = { 'ConformInfo' }, @@ -712,7 +717,8 @@ require('lazy').setup({ }, }, - { -- Autocompletion + -- Autocompletion + { 'saghen/blink.cmp', event = 'VimEnter', version = '1.*', @@ -766,7 +772,7 @@ require('lazy').setup({ -- : Hide menu -- : Toggle signature help -- - -- See :h blink-cmp-config-keymap for defining your own keymap + -- See `:help blink-cmp-config-keymap` for defining your own keymap preset = 'default', -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: @@ -797,7 +803,7 @@ require('lazy').setup({ -- By default, we use the Lua implementation instead, but you may enable -- the rust implementation via `'prefer_rust_with_warning'` -- - -- See :h blink-cmp-config-fuzzy for more information + -- See `:help blink-cmp-config-fuzzy` for more information fuzzy = { implementation = 'lua' }, -- Shows a signature help window while you type arguments for a function @@ -805,7 +811,8 @@ require('lazy').setup({ }, }, - { -- You can easily change to a different colorscheme. + { + -- You can easily change to a different colorscheme. -- Change the name of the colorscheme plugin below, and then -- change the command in the config to whatever the name of that colorscheme is. -- @@ -838,7 +845,8 @@ require('lazy').setup({ opts = { signs = false }, }, - { -- Collection of various small independent plugins/modules + -- Collection of various small independent plugins/modules + { 'nvim-mini/mini.nvim', config = function() -- Better Around/Inside textobjects @@ -867,7 +875,7 @@ require('lazy').setup({ -- You could remove this setup call if you don't like it, -- and try some other statusline plugin local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font + -- Set `use_icons` to true if you have a Nerd Font statusline.setup { use_icons = vim.g.have_nerd_font } -- You can configure sections in the statusline by overriding their @@ -881,35 +889,36 @@ require('lazy').setup({ end, }, - { -- Highlight, edit, and navigate code + -- Used to highlight, edit, and navigate code + { 'nvim-treesitter/nvim-treesitter', lazy = false, build = ':TSUpdate', branch = 'main', -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro` config = function() - -- ensure basic parser are installed + -- Ensure basic parsers are installed local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } require('nvim-treesitter').install(parsers) ---@param buf integer ---@param language string local function treesitter_try_attach(buf, language) - -- check if parser exists and load it + -- Check if a parser exists and load it if not vim.treesitter.language.add(language) then return end - -- enables syntax highlighting and other treesitter features + -- Enable syntax highlighting and other treesitter features vim.treesitter.start(buf, language) - -- enables treesitter based folds - -- for more info on folds see `:help folds` + -- Enable treesitter based folds + -- For more info on folds see `:help folds` -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- vim.wo.foldmethod = 'expr' - -- check if treesitter indentation is available for this language, and if so enable it + -- Check if treesitter indentation is available for this language, and if so enable it -- in case there is no indent query, the indentexpr will fallback to the vim's built in one local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil - -- enables treesitter based indentation + -- Enable treesitter based indentation if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end end @@ -924,13 +933,13 @@ require('lazy').setup({ local installed_parsers = require('nvim-treesitter').get_installed 'parsers' if vim.tbl_contains(installed_parsers, language) then - -- enable the parser if it is installed + -- Enable the parser if it is already installed treesitter_try_attach(buf, language) elseif vim.tbl_contains(available_parsers, language) then - -- if a parser is available in `nvim-treesitter` auto install it, and enable it after the installation is done + -- If a parser is available in `nvim-treesitter`, auto-install it and enable it after the installation is done require('nvim-treesitter').install(language):await(function() treesitter_try_attach(buf, language) end) else - -- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` + -- Try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` treesitter_try_attach(buf, language) end end, From c4605421e52ae77f04fcf2f56d3bbb7a174e7142 Mon Sep 17 00:00:00 2001 From: orip Date: Mon, 20 Apr 2026 01:26:12 +0300 Subject: [PATCH 129/140] Migrate to vim.pack --- .gitignore | 4 +- README.md | 14 +- init.lua | 1398 +++++++++++-------------- lua/custom/plugins/init.lua | 11 +- lua/kickstart/health.lua | 2 +- lua/kickstart/plugins/autopairs.lua | 9 +- lua/kickstart/plugins/debug.lua | 187 ++-- lua/kickstart/plugins/gitsigns.lua | 100 +- lua/kickstart/plugins/indent_line.lua | 15 +- lua/kickstart/plugins/lint.lua | 104 +- lua/kickstart/plugins/neo-tree.lua | 41 +- 11 files changed, 865 insertions(+), 1020 deletions(-) diff --git a/.gitignore b/.gitignore index 68486fc3..a52bd495 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,9 @@ nvim spell/ # In your personal fork, you likely want to comment this, since it's recommended to track -# lazy-lock.json in version control - see https://lazy.folke.io/usage/lockfile +# nvim-pack-lock.json in version control - see :help vim.pack-lockfile # For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded # merge conflicts. -lazy-lock.json +nvim-pack-lock.json .DS_Store diff --git a/README.md b/README.md index 093e42a6..b3ce45e2 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ fork to your machine using one of the commands below, depending on your OS. > Your fork's URL will be something like this: > `https://github.com//kickstart.nvim.git` -You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file -too - it's ignored in the kickstart repo to make maintenance easier, but it's -[recommended to track it in version control](https://lazy.folke.io/usage/lockfile). +You likely want to remove `nvim-pack-lock.json` from your fork's `.gitignore` +file too - it's ignored in the kickstart repo to make maintenance easier, but +it's recommended to track it in version control (see `:help vim.pack-lockfile`). #### Clone kickstart.nvim @@ -111,8 +111,9 @@ Start Neovim nvim ``` -That's it! Lazy will install all the plugins you have. Use `:Lazy` to view -the current plugin status. Hit `q` to close the window. +That's it! `vim.pack` will install all the plugins from your config. Use +`:lua vim.pack.update(nil, { offline = true })` to inspect plugin state and +`:lua vim.pack.update()` to fetch updates. #### Read The Friendly Documentation @@ -146,7 +147,8 @@ examples of adding popularly requested plugins. `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out. * What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information + * Remove your config directory and local data directory (for example, + `~/.config/nvim` and `~/.local/share/nvim`). * Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? * The main purpose of kickstart is to serve as a teaching tool and a reference configuration that someone can easily use to `git clone` as a basis for their own. diff --git a/init.lua b/init.lua index 80a1488d..f9ee55a0 100644 --- a/init.lua +++ b/init.lua @@ -230,770 +230,650 @@ vim.api.nvim_create_autocmd('TextYankPost', { callback = function() vim.hl.on_yank() end, }) --- [[ Install `lazy.nvim` plugin manager ]] --- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info -local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } - if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end -end - ----@type vim.Option -local rtp = vim.opt.rtp -rtp:prepend(lazypath) - --- [[ Configure and install plugins ]] +-- [[ Configure and install plugins with `vim.pack` ]] -- --- To check the current status of your plugins, run --- :Lazy +-- To inspect plugin state and pending updates, run +-- :lua vim.pack.update(nil, { offline = true }) -- --- You can press `?` in this menu for help. Use `:q` to close the window --- --- To update plugins you can run --- :Lazy update +-- To update plugins, run +-- :lua vim.pack.update() -- -- NOTE: Here is where you install your plugins. -require('lazy').setup({ - -- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}` - { 'NMAC427/guess-indent.nvim', opts = {} }, - - -- Alternatively, use `config = function() ... end` for full control over the configuration. - -- If you prefer to call `setup` explicitly, use: - -- { - -- 'lewis6991/gitsigns.nvim', - -- config = function() - -- require('gitsigns').setup({ - -- -- Your gitsigns configuration here - -- }) - -- end, - -- } - -- - -- Here is a more advanced example where we pass configuration - -- options to `gitsigns.nvim`. - -- - -- See `:help gitsigns` to understand what each configuration keys does. - -- Adds git related signs to the gutter, as well as utilities for managing changes - { - 'lewis6991/gitsigns.nvim', - ---@module 'gitsigns' - ---@type Gitsigns.Config - ---@diagnostic disable-next-line: missing-fields - opts = { - signs = { - add = { text = '+' }, ---@diagnostic disable-line: missing-fields - change = { text = '~' }, ---@diagnostic disable-line: missing-fields - delete = { text = '_' }, ---@diagnostic disable-line: missing-fields - topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields - changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields - }, - }, - }, - - -- NOTE: Plugins can also be configured to run Lua code when they are loaded. - -- - -- This is often very useful to both group configuration, as well as handle - -- lazy loading plugins that don't need to be loaded immediately at startup. - -- - -- For example, in the following configuration, we use: - -- event = 'VimEnter' - -- - -- which loads which-key before all the UI elements are loaded. Events can be - -- normal autocommands events (`:help autocmd-events`). - -- - -- Then, because we use the `opts` key (recommended), the configuration runs - -- after the plugin has been loaded as `require(MODULE).setup(opts)`. - -- - -- Useful plugin to show you pending keybinds. - { - 'folke/which-key.nvim', - event = 'VimEnter', - ---@module 'which-key' - ---@type wk.Opts - ---@diagnostic disable-next-line: missing-fields - opts = { - -- Delay between pressing a key and opening which-key (milliseconds) - delay = 0, - icons = { mappings = vim.g.have_nerd_font }, - - -- Document existing key chains - spec = { - { 's', group = '[S]earch', mode = { 'n', 'v' } }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first - { 'gr', group = 'LSP Actions', mode = { 'n' } }, - }, - }, - }, - - -- NOTE: Plugins can specify dependencies. - -- - -- The dependencies are proper plugin specifications as well - anything - -- you do for a plugin at the top level, you can do for a dependency. - -- - -- Use the `dependencies` key to specify the dependencies of a particular plugin - -- - -- Fuzzy Finder (files, lsp, etc) - { - 'nvim-telescope/telescope.nvim', - -- By default, Telescope is included and acts as your picker for everything. - - -- If you would like to switch to a different picker (like snacks, or fzf-lua) - -- you can disable the Telescope plugin by setting enabled to false and enable - -- your replacement picker by requiring it explicitly (e.g. 'custom.plugins.snacks') - - -- Note: If you customize your config for yourself, - -- it’s best to remove the Telescope plugin config entirely - -- instead of just disabling it here, to keep your config clean. - enabled = true, - event = 'VimEnter', - dependencies = { - 'nvim-lua/plenary.nvim', - -- If encountering errors, see telescope-fzf-native README for installation instructions - { - 'nvim-telescope/telescope-fzf-native.nvim', - - -- `build` is used to run some command when the plugin is installed/updated. - -- This is only run then, not every time Neovim starts up. - build = 'make', - - -- `cond` is a condition used to determine whether this plugin should be - -- installed and loaded. - cond = function() return vim.fn.executable 'make' == 1 end, - }, - { 'nvim-telescope/telescope-ui-select.nvim' }, - - -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, - }, - config = function() - -- Telescope is a fuzzy finder that comes with a lot of different things that - -- it can fuzzy find! It's more than just a "file finder", it can search - -- many different aspects of Neovim, your workspace, LSP, and more! - -- - -- The easiest way to use Telescope, is to start by doing something like: - -- :Telescope help_tags - -- - -- After running this command, a window will open up and you're able to - -- type in the prompt window. You'll see a list of `help_tags` options and - -- a corresponding preview of the help. - -- - -- Two important keymaps to use while in Telescope are: - -- - Insert mode: - -- - Normal mode: ? - -- - -- This opens a window that shows you all of the keymaps for the current - -- Telescope picker. This is really useful to discover what Telescope can - -- do as well as how to actually do it! - - -- [[ Configure Telescope ]] - -- See `:help telescope` and `:help telescope.setup()` - require('telescope').setup { - -- You can put your default mappings / updates / etc. in here - -- All the info you're looking for is in `:help telescope.setup()` - -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} - extensions = { - ['ui-select'] = { require('telescope.themes').get_dropdown() }, - }, - } - - -- Enable Telescope extensions if they are installed - pcall(require('telescope').load_extension, 'fzf') - pcall(require('telescope').load_extension, 'ui-select') - - -- See `:help telescope.builtin` - local builtin = require 'telescope.builtin' - vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) - vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) - vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set({ 'n', 'v' }, 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) - vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) - vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) - vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - vim.keymap.set('n', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) - vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - - -- Add Telescope-based LSP pickers when an LSP attaches to a buffer. - -- If you later switch picker plugins, this is where to update these mappings. - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), - callback = function(event) - local buf = event.buf - - -- Find references for the word under your cursor. - vim.keymap.set('n', 'grr', builtin.lsp_references, { buffer = buf, desc = '[G]oto [R]eferences' }) - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - vim.keymap.set('n', 'gri', builtin.lsp_implementations, { buffer = buf, desc = '[G]oto [I]mplementation' }) - - -- Jump to the definition of the word under your cursor. - -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . - vim.keymap.set('n', 'grd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' }) - - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - vim.keymap.set('n', 'gO', builtin.lsp_document_symbols, { buffer = buf, desc = 'Open Document Symbols' }) - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - vim.keymap.set('n', 'gW', builtin.lsp_dynamic_workspace_symbols, { buffer = buf, desc = 'Open Workspace Symbols' }) - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - vim.keymap.set('n', 'grt', builtin.lsp_type_definitions, { buffer = buf, desc = '[G]oto [T]ype Definition' }) - end, - }) - - -- Override default behavior and theme when searching - vim.keymap.set('n', '/', function() - -- You can pass additional configuration to Telescope to change the theme, layout, etc. - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) - end, { desc = '[/] Fuzzily search in current buffer' }) - - -- It's also possible to pass additional configuration options. - -- See `:help telescope.builtin.live_grep()` for information about particular keys - vim.keymap.set( - 'n', - 's/', - function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end, - { desc = '[S]earch [/] in Open Files' } - ) - - -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) - end, - }, - - -- LSP Plugins - { - -- Main LSP Configuration - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs and related tools to stdpath for Neovim - -- Mason must be loaded before its dependents so we need to set it up here. - -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` - { - 'mason-org/mason.nvim', - ---@module 'mason.settings' - ---@type MasonSettings - ---@diagnostic disable-next-line: missing-fields - opts = {}, - }, - -- Maps LSP server names between nvim-lspconfig and Mason package names. - 'mason-org/mason-lspconfig.nvim', - 'WhoIsSethDaniel/mason-tool-installer.nvim', - - -- Useful status updates for LSP. - { 'j-hui/fidget.nvim', opts = {} }, - }, - config = function() - -- Brief aside: **What is LSP?** - -- - -- LSP is an initialism you've probably heard, but might not understand what it is. - -- - -- LSP stands for Language Server Protocol. It's a protocol that helps editors - -- and language tooling communicate in a standardized fashion. - -- - -- In general, you have a "server" which is some tool built to understand a particular - -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers - -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone - -- processes that communicate with some "client" - in this case, Neovim! - -- - -- LSP provides Neovim with features like: - -- - Go to definition - -- - Find references - -- - Autocompletion - -- - Symbol Search - -- - and more! - -- - -- Thus, Language Servers are external tools that must be installed separately from - -- Neovim. This is where `mason` and related plugins come into play. - -- - -- If you're wondering about lsp vs treesitter, you can check out the wonderfully - -- and elegantly composed help section, `:help lsp-vs-treesitter` - - -- This function gets run when an LSP attaches to a particular buffer. - -- That is to say, every time a new file is opened that is associated with - -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this - -- function will be executed to configure the current buffer - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), - callback = function(event) - -- NOTE: Remember that Lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - local map = function(keys, func, desc, mode) - mode = mode or 'n' - vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) - end - - -- Rename the variable under your cursor. - -- Most Language Servers support renaming across files, etc. - map('grn', vim.lsp.buf.rename, '[R]e[n]ame') - - -- Execute a code action, usually your cursor needs to be on top of an error - -- or a suggestion from your LSP for this to activate. - map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) - - -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header. - map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - - -- The following two autocommands are used to highlight references of the - -- word under your cursor when your cursor rests there for a little while. - -- See `:help CursorHold` for information about when this is executed - -- - -- When you move your cursor, the highlights will be cleared (the second autocommand). - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client:supports_method('textDocument/documentHighlight', event.buf) then - local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) - vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.document_highlight, - }) - - vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.clear_references, - }) - - vim.api.nvim_create_autocmd('LspDetach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), - callback = function(event2) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } - end, - }) - end - - -- The following code creates a keymap to toggle inlay hints in your - -- code, if the language server you are using supports them - -- - -- This may be unwanted, since they displace some of your code - if client and client:supports_method('textDocument/inlayHint', event.buf) then - map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') - end - end, - }) - - -- Enable the following language servers - -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. - -- See `:help lsp-config` for information about keys and how to configure - ---@type table - local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- - -- Some languages (like typescript) have entire language plugins that can be useful: - -- https://github.com/pmizio/typescript-tools.nvim - -- - -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, - - stylua = {}, -- Used to format Lua code - - -- Special Lua Config, as recommended by neovim help docs - lua_ls = { - on_init = function(client) - client.server_capabilities.documentFormattingProvider = false -- Disable formatting (formatting is done by stylua) - - if client.workspace_folders then - local path = client.workspace_folders[1].name - if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end - end - - client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { - runtime = { - version = 'LuaJIT', - path = { 'lua/?.lua', 'lua/?/init.lua' }, - }, - workspace = { - checkThirdParty = false, - -- NOTE: this is a lot slower and will cause issues when working on your own configuration. - -- See https://github.com/neovim/nvim-lspconfig/issues/3189 - library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), { - '${3rd}/luv/library', - '${3rd}/busted/library', - }), - }, - }) - end, - ---@type lspconfig.settings.lua_ls - settings = { - Lua = { - format = { enable = false }, -- Disable formatting (formatting is done by stylua) - }, - }, - }, - } - - -- Ensure the servers and tools above are installed - -- - -- To check the current status of installed tools and/or manually install - -- other tools, you can run - -- :Mason - -- - -- You can press `g?` for help in this menu. - local ensure_installed = vim.tbl_keys(servers or {}) - vim.list_extend(ensure_installed, { - -- You can add other tools here that you want Mason to install - }) - - require('mason-tool-installer').setup { ensure_installed = ensure_installed } - - for name, server in pairs(servers) do - vim.lsp.config(name, server) - vim.lsp.enable(name) - end - end, - }, - - -- Autoformat - { - 'stevearc/conform.nvim', - event = { 'BufWritePre' }, - cmd = { 'ConformInfo' }, - keys = { - { - 'f', - function() require('conform').format { async = true } end, - mode = '', - desc = '[F]ormat buffer', - }, - }, - ---@module 'conform' - ---@type conform.setupOpts - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - -- You can specify filetypes to autoformat on save here: - local enabled_filetypes = { - -- lua = true, - -- python = true, - } - if enabled_filetypes[vim.bo[bufnr].filetype] then - return { timeout_ms = 500 } - else - return nil - end - end, - default_format_opts = { - lsp_format = 'fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely. - }, - -- You can also specify external formatters in here. - formatters_by_ft = { - -- rust = { 'rustfmt' }, - -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, - }, - }, - }, - - -- Autocompletion - { - 'saghen/blink.cmp', - event = 'VimEnter', - version = '1.*', - dependencies = { - -- Snippet Engine - { - 'L3MON4D3/LuaSnip', - version = '2.*', - build = (function() - -- Build Step is needed for regex support in snippets. - -- This step is not supported in many windows environments. - -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then return end - return 'make install_jsregexp' - end)(), - dependencies = { - -- `friendly-snippets` contains a variety of premade snippets. - -- See the README about individual language/framework/plugin snippets: - -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, - }, - opts = {}, - }, - }, - ---@module 'blink.cmp' - ---@type blink.cmp.Config - opts = { - keymap = { - -- 'default' (recommended) for mappings similar to built-in completions - -- to accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - -- 'super-tab' for tab to accept - -- 'enter' for enter to accept - -- 'none' for no mappings - -- - -- For an understanding of why the 'default' preset is recommended, - -- you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - -- - -- All presets have the following mappings: - -- /: move to right/left of your snippet expansion - -- : Open menu or open docs if already open - -- / or /: Select next/previous item - -- : Hide menu - -- : Toggle signature help - -- - -- See `:help blink-cmp-config-keymap` for defining your own keymap - preset = 'default', - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, - - appearance = { - -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono', - }, - - completion = { - -- By default, you may press `` to show the documentation. - -- Optionally, set `auto_show = true` to show the documentation after a delay. - documentation = { auto_show = false, auto_show_delay_ms = 500 }, - }, - - sources = { - default = { 'lsp', 'path', 'snippets' }, - }, - - snippets = { preset = 'luasnip' }, - - -- Blink.cmp includes an optional, recommended rust fuzzy matcher, - -- which automatically downloads a prebuilt binary when enabled. - -- - -- By default, we use the Lua implementation instead, but you may enable - -- the rust implementation via `'prefer_rust_with_warning'` - -- - -- See `:help blink-cmp-config-fuzzy` for more information - fuzzy = { implementation = 'lua' }, - - -- Shows a signature help window while you type arguments for a function - signature = { enabled = true }, - }, - }, - - { - -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- change the command in the config to whatever the name of that colorscheme is. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. - config = function() - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } - - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' - end, - }, - - -- Highlight todo, notes, etc in comments - { - 'folke/todo-comments.nvim', - event = 'VimEnter', - dependencies = { 'nvim-lua/plenary.nvim' }, - ---@module 'todo-comments' - ---@type TodoOptions - ---@diagnostic disable-next-line: missing-fields - opts = { signs = false }, - }, - - -- Collection of various small independent plugins/modules - { - 'nvim-mini/mini.nvim', - config = function() - -- Better Around/Inside textobjects - -- - -- Examples: - -- - va) - [V]isually select [A]round [)]paren - -- - yiiq - [Y]ank [I]nside [I]+1 [Q]uote - -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { - -- NOTE: Avoid conflicts with the built-in incremental selection mappings on Neovim>=0.12 (see `:help treesitter-incremental-selection`) - mappings = { - around_next = 'aa', - inside_next = 'ii', - }, - n_lines = 500, - } - - -- Add/delete/replace surroundings (brackets, quotes, etc.) - -- - -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren - -- - sd' - [S]urround [D]elete [']quotes - -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() - - -- Simple and easy statusline. - -- You could remove this setup call if you don't like it, - -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- Set `use_icons` to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() return '%2l:%-2v' end - - -- ... and there is more! - -- Check out: https://github.com/nvim-mini/mini.nvim - end, - }, - - -- Used to highlight, edit, and navigate code - { - 'nvim-treesitter/nvim-treesitter', - lazy = false, - build = ':TSUpdate', - branch = 'main', - -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro` - config = function() - -- Ensure basic parsers are installed - local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } - require('nvim-treesitter').install(parsers) - - ---@param buf integer - ---@param language string - local function treesitter_try_attach(buf, language) - -- Check if a parser exists and load it - if not vim.treesitter.language.add(language) then return end - -- Enable syntax highlighting and other treesitter features - vim.treesitter.start(buf, language) - - -- Enable treesitter based folds - -- For more info on folds see `:help folds` - -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' - -- vim.wo.foldmethod = 'expr' - - -- Check if treesitter indentation is available for this language, and if so enable it - -- in case there is no indent query, the indentexpr will fallback to the vim's built in one - local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil - - -- Enable treesitter based indentation - if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end - end - - local available_parsers = require('nvim-treesitter').get_available() - vim.api.nvim_create_autocmd('FileType', { - callback = function(args) - local buf, filetype = args.buf, args.match - - local language = vim.treesitter.language.get_lang(filetype) - if not language then return end - - local installed_parsers = require('nvim-treesitter').get_installed 'parsers' - - if vim.tbl_contains(installed_parsers, language) then - -- Enable the parser if it is already installed - treesitter_try_attach(buf, language) - elseif vim.tbl_contains(available_parsers, language) then - -- If a parser is available in `nvim-treesitter`, auto-install it and enable it after the installation is done - require('nvim-treesitter').install(language):await(function() treesitter_try_attach(buf, language) end) - else - -- Try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` - treesitter_try_attach(buf, language) - end - end, - }) - end, - }, - - -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the - -- init.lua. If you want these files, they are in the repository, so you can just download them and - -- place them in the correct locations. - - -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart - -- - -- Here are some example plugins that I've included in the Kickstart repository. - -- Uncomment any of the lines below to enable them (you will need to restart nvim). - -- - -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps - - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- This is the easiest way to modularize your config. - -- - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, - -- - -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` - -- Or use telescope! - -- In normal mode type `sh` then write `lazy.nvim-plugin` - -- you can continue same window with `sr` which resumes last telescope search -}, { ---@diagnostic disable-line: missing-fields - ui = { - -- If you are using a Nerd Font: set icons to an empty table which will use the - -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table - icons = vim.g.have_nerd_font and {} or { - cmd = '⌘', - config = '🛠', - event = '📅', - ft = '📂', - init = '⚙', - keys = '🗝', - plugin = '🔌', - runtime = '💻', - require = '🌙', - source = '📄', - start = '🚀', - task = '📌', - lazy = '💤 ', - }, - }, +local gh = function(repo) return 'https://github.com/' .. repo end + +local run_build = function(name, cmd, cwd) + local result = vim.system(cmd, { cwd = cwd }):wait() + if result.code ~= 0 then + local stderr = result.stderr or '' + local stdout = result.stdout or '' + local output = stderr ~= '' and stderr or stdout + if output == '' then output = 'No output from build command.' end + vim.notify(('Build failed for %s:\n%s'):format(name, output), vim.log.levels.ERROR) + end +end + +vim.api.nvim_create_autocmd('PackChanged', { + callback = function(ev) + local name = ev.data.spec.name + local kind = ev.data.kind + if kind ~= 'install' and kind ~= 'update' then return end + + if name == 'telescope-fzf-native.nvim' and vim.fn.executable 'make' == 1 then + run_build(name, { 'make' }, ev.data.path) + return + end + + if name == 'LuaSnip' then + if vim.fn.has 'win32' ~= 1 and vim.fn.executable 'make' == 1 then run_build(name, { 'make', 'install_jsregexp' }, ev.data.path) end + return + end + + if name == 'nvim-treesitter' then + if not ev.data.active then vim.cmd.packadd 'nvim-treesitter' end + vim.cmd 'TSUpdate' + return + end + end, }) +---@type (string|vim.pack.Spec)[] +local plugins = { + gh 'NMAC427/guess-indent.nvim', + gh 'lewis6991/gitsigns.nvim', + gh 'folke/which-key.nvim', + gh 'nvim-lua/plenary.nvim', + gh 'nvim-telescope/telescope.nvim', + gh 'nvim-telescope/telescope-ui-select.nvim', + gh 'neovim/nvim-lspconfig', + gh 'mason-org/mason.nvim', + gh 'mason-org/mason-lspconfig.nvim', + gh 'WhoIsSethDaniel/mason-tool-installer.nvim', + gh 'j-hui/fidget.nvim', + gh 'stevearc/conform.nvim', + { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' }, + { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' }, + gh 'folke/tokyonight.nvim', + gh 'folke/todo-comments.nvim', + gh 'nvim-mini/mini.nvim', + { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' }, +} + +if vim.fn.executable 'make' == 1 then table.insert(plugins, gh 'nvim-telescope/telescope-fzf-native.nvim') end + +-- Useful for getting pretty icons, but requires a Nerd Font. +if vim.g.have_nerd_font then table.insert(plugins, gh 'nvim-tree/nvim-web-devicons') end + +vim.pack.add(plugins) + +require('guess-indent').setup {} + +-- Here is a more advanced example that passes configuration options to `gitsigns.nvim` +-- +-- See `:help gitsigns` to understand what each configuration key does. +-- Adds git related signs to the gutter, as well as utilities for managing changes +require('gitsigns').setup { + signs = { + add = { text = '+' }, ---@diagnostic disable-line: missing-fields + change = { text = '~' }, ---@diagnostic disable-line: missing-fields + delete = { text = '_' }, ---@diagnostic disable-line: missing-fields + topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields + changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields + }, +} + +-- Useful plugin to show you pending keybinds. +require('which-key').setup { + -- Delay between pressing a key and opening which-key (milliseconds) + delay = 0, + icons = { mappings = vim.g.have_nerd_font }, + -- Document existing key chains + spec = { + { 's', group = '[S]earch', mode = { 'n', 'v' } }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first + { 'gr', group = 'LSP Actions', mode = { 'n' } }, + }, +} +-- Fuzzy Finder (files, lsp, etc) +-- +-- By default, Telescope is included and acts as your picker for everything. + +-- # TODO: Rework this docstring +-- +-- If you would like to switch to a different picker (like snacks, or fzf-lua) +-- you can disable the Telescope plugin by setting enabled to false and enable +-- your replacement picker by requiring it explicitly (e.g. 'custom.plugins.snacks') + +-- Note: If you customize your config for yourself, +-- it’s best to remove the Telescope plugin config entirely +-- instead of just disabling it here, to keep your config clean. +-- +-- Telescope is a fuzzy finder that comes with a lot of different things that +-- it can fuzzy find! It's more than just a "file finder", it can search +-- many different aspects of Neovim, your workspace, LSP, and more! +-- +-- The easiest way to use Telescope, is to start by doing something like: +-- :Telescope help_tags +-- +-- After running this command, a window will open up and you're able to +-- type in the prompt window. You'll see a list of `help_tags` options and +-- a corresponding preview of the help. +-- +-- Two important keymaps to use while in Telescope are: +-- - Insert mode: +-- - Normal mode: ? +-- +-- This opens a window that shows you all of the keymaps for the current +-- Telescope picker. This is really useful to discover what Telescope can +-- do as well as how to actually do it! + +-- [[ Configure Telescope ]] +-- See `:help telescope` and `:help telescope.setup()` +require('telescope').setup { + -- You can put your default mappings / updates / etc. in here + -- All the info you're looking for is in `:help telescope.setup()` + -- + -- defaults = { + -- mappings = { + -- i = { [''] = 'to_fuzzy_refine' }, + -- }, + -- }, + -- pickers = {} + extensions = { + ['ui-select'] = { require('telescope.themes').get_dropdown() }, + }, +} + +-- Enable Telescope extensions if they are installed +pcall(require('telescope').load_extension, 'fzf') +pcall(require('telescope').load_extension, 'ui-select') + +-- See `:help telescope.builtin` +local builtin = require 'telescope.builtin' +vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) +vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) +vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) +vim.keymap.set({ 'n', 'v' }, 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) +vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) +vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) +vim.keymap.set('n', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) +vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + +-- Add Telescope-based LSP pickers when an LSP attaches to a buffer. +-- If you later switch picker plugins, this is where to update these mappings. +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), + callback = function(event) + local buf = event.buf + + -- Find references for the word under your cursor. + vim.keymap.set('n', 'grr', builtin.lsp_references, { buffer = buf, desc = '[G]oto [R]eferences' }) + + -- Jump to the implementation of the word under your cursor. + -- Useful when your language has ways of declaring types without an actual implementation. + vim.keymap.set('n', 'gri', builtin.lsp_implementations, { buffer = buf, desc = '[G]oto [I]mplementation' }) + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press . + vim.keymap.set('n', 'grd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' }) + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + vim.keymap.set('n', 'gO', builtin.lsp_document_symbols, { buffer = buf, desc = 'Open Document Symbols' }) + + -- Fuzzy find all the symbols in your current workspace. + -- Similar to document symbols, except searches over your entire project. + vim.keymap.set('n', 'gW', builtin.lsp_dynamic_workspace_symbols, { buffer = buf, desc = 'Open Workspace Symbols' }) + + -- Jump to the type of the word under your cursor. + -- Useful when you're not sure what type a variable is and you want to see + -- the definition of its *type*, not where it was *defined*. + vim.keymap.set('n', 'grt', builtin.lsp_type_definitions, { buffer = buf, desc = '[G]oto [T]ype Definition' }) + end, +}) + +-- Override default behavior and theme when searching +vim.keymap.set('n', '/', function() + -- You can pass additional configuration to Telescope to change the theme, layout, etc. + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) +end, { desc = '[/] Fuzzily search in current buffer' }) + +-- It's also possible to pass additional configuration options. +-- See `:help telescope.builtin.live_grep()` for information about particular keys +vim.keymap.set( + 'n', + 's/', + function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, + { desc = '[S]earch [/] in Open Files' } +) + +-- Shortcut for searching your Neovim configuration files +vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) + +-- LSP Plugins + +-- Automatically install LSPs and related tools to stdpath for Neovim +-- Mason must be loaded before its dependents so we need to set it up here. +require('mason').setup {} + +-- Useful status updates for LSP. +require('fidget').setup {} + +-- Brief aside: **What is LSP?** +-- +-- LSP is an initialism you've probably heard, but might not understand what it is. +-- +-- LSP stands for Language Server Protocol. It's a protocol that helps editors +-- and language tooling communicate in a standardized fashion. +-- +-- In general, you have a "server" which is some tool built to understand a particular +-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers +-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone +-- processes that communicate with some "client" - in this case, Neovim! +-- +-- LSP provides Neovim with features like: +-- - Go to definition +-- - Find references +-- - Autocompletion +-- - Symbol Search +-- - and more! +-- +-- Thus, Language Servers are external tools that must be installed separately from +-- Neovim. This is where `mason` and related plugins come into play. +-- +-- If you're wondering about lsp vs treesitter, you can check out the wonderfully +-- and elegantly composed help section, `:help lsp-vs-treesitter` + +-- This function gets run when an LSP attaches to a particular buffer. +-- That is to say, every time a new file is opened that is associated with +-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this +-- function will be executed to configure the current buffer +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), + callback = function(event) + -- NOTE: Remember that Lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself. + -- + -- In this case, we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end + + -- Rename the variable under your cursor. + -- Most Language Servers support renaming across files, etc. + map('grn', vim.lsp.buf.rename, '[R]e[n]ame') + + -- Execute a code action, usually your cursor needs to be on top of an error + -- or a suggestion from your LSP for this to activate. + map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) + + -- WARN: This is not Goto Definition, this is Goto Declaration. + -- For example, in C this would take you to the header. + map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + + -- The following two autocommands are used to highlight references of the + -- word under your cursor when your cursor rests there for a little while. + -- See `:help CursorHold` for information about when this is executed + -- + -- When you move your cursor, the highlights will be cleared (the second autocommand). + local client = vim.lsp.get_client_by_id(event.data.client_id) + if client and client:supports_method('textDocument/documentHighlight', event.buf) then + local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + + vim.api.nvim_create_autocmd('LspDetach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + end, + }) + end + + -- The following code creates a keymap to toggle inlay hints in your + -- code, if the language server you are using supports them + -- + -- This may be unwanted, since they displace some of your code + if client and client:supports_method('textDocument/inlayHint', event.buf) then + map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') + end + end, +}) + +-- Enable the following language servers +-- Feel free to add/remove any LSPs that you want here. They will automatically be installed. +-- See `:help lsp-config` for information about keys and how to configure +---@type table +local servers = { + -- clangd = {}, + -- gopls = {}, + -- pyright = {}, + -- rust_analyzer = {}, + -- + -- Some languages (like typescript) have entire language plugins that can be useful: + -- https://github.com/pmizio/typescript-tools.nvim + -- + -- But for many setups, the LSP (`ts_ls`) will work just fine + -- ts_ls = {}, + + stylua = {}, -- Used to format Lua code + + -- Special Lua Config, as recommended by neovim help docs + lua_ls = { + on_init = function(client) + client.server_capabilities.documentFormattingProvider = false -- Disable formatting (formatting is done by stylua) + + if client.workspace_folders then + local path = client.workspace_folders[1].name + if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + version = 'LuaJIT', + path = { 'lua/?.lua', 'lua/?/init.lua' }, + }, + workspace = { + checkThirdParty = false, + -- NOTE: this is a lot slower and will cause issues when working on your own configuration. + -- See https://github.com/neovim/nvim-lspconfig/issues/3189 + library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), { + '${3rd}/luv/library', + '${3rd}/busted/library', + }), + }, + }) + end, + ---@type lspconfig.settings.lua_ls + settings = { + Lua = { + format = { enable = false }, -- Disable formatting (formatting is done by stylua) + }, + }, + }, +} + +-- Ensure the servers and tools above are installed +-- +-- To check the current status of installed tools and/or manually install +-- other tools, you can run +-- :Mason +-- +-- You can press `g?` for help in this menu. +local ensure_installed = vim.tbl_keys(servers or {}) +vim.list_extend(ensure_installed, { + -- You can add other tools here that you want Mason to install +}) + +require('mason-tool-installer').setup { ensure_installed = ensure_installed } + +for name, server in pairs(servers) do + vim.lsp.config(name, server) + vim.lsp.enable(name) +end + +-- Autoformat +require('conform').setup { + notify_on_error = false, + format_on_save = function(bufnr) + -- You can specify filetypes to autoformat on save here: + local enabled_filetypes = { + -- lua = true, + -- python = true, + } + if enabled_filetypes[vim.bo[bufnr].filetype] then + return { timeout_ms = 500 } + else + return nil + end + end, + default_format_opts = { + lsp_format = 'fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely. + }, + -- You can also specify external formatters in here. + formatters_by_ft = { + -- rust = { 'rustfmt' }, + -- Conform can also run multiple formatters sequentially + -- python = { "isort", "black" }, + -- + -- You can use 'stop_after_first' to run the first available formatter from the list + -- javascript = { "prettierd", "prettier", stop_after_first = true }, + }, +} + +vim.keymap.set({ 'n', 'v' }, 'f', function() require('conform').format { async = true } end, { desc = '[F]ormat buffer' }) + +-- Snippet Engine +-- +-- `friendly-snippets` contains a variety of premade snippets. +-- See the README about individual language/framework/plugin snippets: +-- https://github.com/rafamadriz/friendly-snippets +-- +-- vim.pack.add { gh 'rafamadriz/friendly-snippets' } +-- require('luasnip.loaders.from_vscode').lazy_load() +require('luasnip').setup {} + +-- Autocompletion +require('blink.cmp').setup { + keymap = { + -- 'default' (recommended) for mappings similar to built-in completions + -- to accept ([y]es) the completion. + -- This will auto-import if your LSP supports it. + -- This will expand snippets if the LSP sent a snippet. + -- 'super-tab' for tab to accept + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- For an understanding of why the 'default' preset is recommended, + -- you will need to read `:help ins-completion` + -- + -- No, but seriously. Please read `:help ins-completion`, it is really good! + -- + -- All presets have the following mappings: + -- /: move to right/left of your snippet expansion + -- : Open menu or open docs if already open + -- / or /: Select next/previous item + -- : Hide menu + -- : Toggle signature help + -- + -- See `:help blink-cmp-config-keymap` for defining your own keymap + preset = 'default', + + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + }, + + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = 'mono', + }, + + completion = { + -- By default, you may press `` to show the documentation. + -- Optionally, set `auto_show = true` to show the documentation after a delay. + documentation = { auto_show = false, auto_show_delay_ms = 500 }, + }, + + sources = { + default = { 'lsp', 'path', 'snippets' }, + }, + + snippets = { preset = 'luasnip' }, + + -- Blink.cmp includes an optional, recommended rust fuzzy matcher, + -- which automatically downloads a prebuilt binary when enabled. + -- + -- By default, we use the Lua implementation instead, but you may enable + -- the rust implementation via `'prefer_rust_with_warning'` + -- + -- See `:help blink-cmp-config-fuzzy` for more information + fuzzy = { implementation = 'lua' }, + + -- Shows a signature help window while you type arguments for a function + signature = { enabled = true }, +} + +-- You can easily change to a different colorscheme. +-- Change the name of the colorscheme plugin below, and then +-- change the command in the config to whatever the name of that colorscheme is. +-- +-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. +---@diagnostic disable-next-line: missing-fields +require('tokyonight').setup { + styles = { + comments = { italic = false }, -- Disable italics in comments + }, +} + +-- Load the colorscheme here. +-- Like many other themes, this one has different styles, and you could load +-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. +vim.cmd.colorscheme 'tokyonight-night' + +-- Highlight todo, notes, etc in comments +require('todo-comments').setup { signs = false } + +-- Collection of various small independent plugins/modules + +-- Better Around/Inside textobjects +-- +-- Examples: +-- - va) - [V]isually select [A]round [)]paren +-- - yiiq - [Y]ank [I]nside [I]+1 [Q]uote +-- - ci' - [C]hange [I]nside [']quote +require('mini.ai').setup { + -- NOTE: Avoid conflicts with the built-in incremental selection mappings on Neovim>=0.12 (see `:help treesitter-incremental-selection`) + mappings = { + around_next = 'aa', + inside_next = 'ii', + }, + n_lines = 500, +} + +-- Add/delete/replace surroundings (brackets, quotes, etc.) +-- +-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren +-- - sd' - [S]urround [D]elete [']quotes +-- - sr)' - [S]urround [R]eplace [)] ['] +require('mini.surround').setup() + +-- Simple and easy statusline. +-- You could remove this setup call if you don't like it, +-- and try some other statusline plugin +local statusline = require 'mini.statusline' +-- Set `use_icons` to true if you have a Nerd Font +statusline.setup { use_icons = vim.g.have_nerd_font } + +-- You can configure sections in the statusline by overriding their +-- default behavior. For example, here we set the section for +-- cursor location to LINE:COLUMN +---@diagnostic disable-next-line: duplicate-set-field +statusline.section_location = function() return '%2l:%-2v' end + +-- ... and there is more! +-- Check out: https://github.com/nvim-mini/mini.nvim + +-- [[ Configure Treesitter ]] +-- Used to highlight, edit, and navigate code +-- +-- See `:help nvim-treesitter-intro` + +-- Ensure basic parsers are installed +local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } +require('nvim-treesitter').install(parsers) + +---@param buf integer +---@param language string +local function treesitter_try_attach(buf, language) + -- Check if a parser exists and load it + if not vim.treesitter.language.add(language) then return end + -- Enable syntax highlighting and other treesitter features + vim.treesitter.start(buf, language) + + -- Enable treesitter based folds + -- For more info on folds see `:help folds` + -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + -- vim.wo.foldmethod = 'expr' + + -- Check if treesitter indentation is available for this language, and if so enable it + -- in case there is no indent query, the indentexpr will fallback to the vim's built in one + local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil + + -- Enable treesitter based indentation + if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end +end + +local available_parsers = require('nvim-treesitter').get_available() +vim.api.nvim_create_autocmd('FileType', { + callback = function(args) + local buf, filetype = args.buf, args.match + + local language = vim.treesitter.language.get_lang(filetype) + if not language then return end + + local installed_parsers = require('nvim-treesitter').get_installed 'parsers' + + if vim.tbl_contains(installed_parsers, language) then + -- Enable the parser if it is already installed + treesitter_try_attach(buf, language) + elseif vim.tbl_contains(available_parsers, language) then + -- If a parser is available in `nvim-treesitter`, auto-install it and enable it after the installation is done + require('nvim-treesitter').install(language):await(function() treesitter_try_attach(buf, language) end) + else + -- Try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` + treesitter_try_attach(buf, language) + end + end, +}) + +-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the +-- init.lua. If you want these files, they are in the repository, so you can just download them and +-- place them in the correct locations. + +-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart +-- +-- Here are some example plugins that I've included in the Kickstart repository. +-- Uncomment any of the lines below to enable them (you will need to restart nvim). +-- +-- require 'kickstart.plugins.debug' +-- require 'kickstart.plugins.indent_line' +-- require 'kickstart.plugins.lint' +-- require 'kickstart.plugins.autopairs' +-- require 'kickstart.plugins.neo-tree' +-- require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps + +-- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` +-- +-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. +-- require 'custom.plugins' +-- +-- For additional information with loading, sourcing and examples see `:help vim.pack` +-- and `:help vim.pack-examples` + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index b3ddcfdd..c05db465 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -3,6 +3,11 @@ -- -- See the kickstart.nvim README for more information ----@module 'lazy' ----@type LazySpec -return {} +-- Iterate over all Lua files in the plugins directory and load them +local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins') +for file_name, type in vim.fs.dir(plugins_dir) do + if type == 'file' and file_name:match '%.lua$' and file_name ~= 'init.lua' then + local module = file_name:gsub('%.lua$', '') + require('custom.plugins.' .. module) + end +end diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index ca684516..99102381 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -12,7 +12,7 @@ local check_version = function() return end - if vim.version.ge(vim.version(), '0.11') then + if vim.version.ge(vim.version(), '0.12') then vim.health.ok(string.format("Neovim version is: '%s'", verstr)) else vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 351dad86..1d2cdab0 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -1,10 +1,5 @@ -- autopairs -- https://github.com/windwp/nvim-autopairs ----@module 'lazy' ----@type LazySpec -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - opts = {}, -} +vim.pack.add { 'https://github.com/windwp/nvim-autopairs' } +require('nvim-autopairs').setup {} diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 7e58905e..db5448c2 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -6,105 +6,90 @@ -- be extended to other languages as well. That's why it's called -- kickstart.nvim and not kitchen-sink.nvim ;) ----@module 'lazy' ----@type LazySpec -return { - -- NOTE: Yes, you can install new plugins here! - 'mfussenegger/nvim-dap', - -- NOTE: And you can specify dependencies as well - dependencies = { - -- Creates a beautiful debugger UI - 'rcarriga/nvim-dap-ui', - - -- Required dependency for nvim-dap-ui - 'nvim-neotest/nvim-nio', - - -- Installs the debug adapters for you - 'mason-org/mason.nvim', - 'jay-babu/mason-nvim-dap.nvim', - - -- Add your own debuggers here - 'leoluz/nvim-dap-go', - }, - keys = { - -- Basic debugging keymaps, feel free to change to your liking! - { '', function() require('dap').continue() end, desc = 'Debug: Start/Continue' }, - { '', function() require('dap').step_into() end, desc = 'Debug: Step Into' }, - { '', function() require('dap').step_over() end, desc = 'Debug: Step Over' }, - { '', function() require('dap').step_out() end, desc = 'Debug: Step Out' }, - { 'b', function() require('dap').toggle_breakpoint() end, desc = 'Debug: Toggle Breakpoint' }, - { 'B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, desc = 'Debug: Set Breakpoint' }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { '', function() require('dapui').toggle() end, desc = 'Debug: See last session result.' }, - }, - config = function() - local dap = require 'dap' - local dapui = require 'dapui' - - require('mason-nvim-dap').setup { - -- Makes a best effort to setup the various debuggers with - -- reasonable debug configurations - automatic_installation = true, - - -- You can provide additional configuration to the handlers, - -- see mason-nvim-dap README for more information - handlers = {}, - - -- You'll need to check that you have the required things installed - -- online, please don't ask me how to install them :) - ensure_installed = { - -- Update this to ensure that you have the debuggers for the langs you want - 'delve', - }, - } - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - ---@diagnostic disable-next-line: missing-fields - dapui.setup { - -- Set icons to characters that are more likely to work in every terminal. - -- Feel free to remove or use ones that you like more! :) - -- Don't feel like these are good choices. - icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, - ---@diagnostic disable-next-line: missing-fields - controls = { - icons = { - pause = '⏸', - play = '▶', - step_into = '⏎', - step_over = '⏭', - step_out = '⏮', - step_back = 'b', - run_last = '▶▶', - terminate = '⏹', - disconnect = '⏏', - }, - }, - } - - -- Change breakpoint icons - -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) - -- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) - -- local breakpoint_icons = vim.g.have_nerd_font - -- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } - -- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } - -- for type, icon in pairs(breakpoint_icons) do - -- local tp = 'Dap' .. type - -- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' - -- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) - -- end - - dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close - - -- Install golang specific config - require('dap-go').setup { - delve = { - -- On Windows delve must be run attached or it crashes. - -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring - detached = vim.fn.has 'win32' == 0, - }, - } - end, +vim.pack.add { + 'https://github.com/mfussenegger/nvim-dap', + 'https://github.com/rcarriga/nvim-dap-ui', + 'https://github.com/nvim-neotest/nvim-nio', + 'https://github.com/mason-org/mason.nvim', + 'https://github.com/jay-babu/mason-nvim-dap.nvim', + 'https://github.com/leoluz/nvim-dap-go', +} + +-- Basic debugging keymaps, feel free to change to your liking! +vim.keymap.set('n', '', function() require('dap').continue() end, { desc = 'Debug: Start/Continue' }) +vim.keymap.set('n', '', function() require('dap').step_into() end, { desc = 'Debug: Step Into' }) +vim.keymap.set('n', '', function() require('dap').step_over() end, { desc = 'Debug: Step Over' }) +vim.keymap.set('n', '', function() require('dap').step_out() end, { desc = 'Debug: Step Out' }) +vim.keymap.set('n', 'b', function() require('dap').toggle_breakpoint() end, { desc = 'Debug: Toggle Breakpoint' }) +vim.keymap.set('n', 'B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, { desc = 'Debug: Set Breakpoint' }) +-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. +vim.keymap.set('n', '', function() require('dapui').toggle() end, { desc = 'Debug: See last session result.' }) + +local dap = require 'dap' +local dapui = require 'dapui' + +require('mason-nvim-dap').setup { + -- Makes a best effort to setup the various debuggers with + -- reasonable debug configurations + automatic_installation = true, + + -- You can provide additional configuration to the handlers, + -- see mason-nvim-dap README for more information + handlers = {}, + + -- You'll need to check that you have the required things installed + -- online, please don't ask me how to install them :) + ensure_installed = { + -- Update this to ensure that you have the debuggers for the langs you want + 'delve', + }, +} + +-- Dap UI setup +-- For more information, see |:help nvim-dap-ui| +---@diagnostic disable-next-line: missing-fields +dapui.setup { + -- Set icons to characters that are more likely to work in every terminal. + -- Feel free to remove or use ones that you like more! :) + -- Don't feel like these are good choices. + icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, + ---@diagnostic disable-next-line: missing-fields + controls = { + icons = { + pause = '⏸', + play = '▶', + step_into = '⏎', + step_over = '⏭', + step_out = '⏮', + step_back = 'b', + run_last = '▶▶', + terminate = '⏹', + disconnect = '⏏', + }, + }, +} + +-- Change breakpoint icons +-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) +-- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) +-- local breakpoint_icons = vim.g.have_nerd_font +-- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } +-- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } +-- for type, icon in pairs(breakpoint_icons) do +-- local tp = 'Dap' .. type +-- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' +-- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) +-- end + +dap.listeners.after.event_initialized['dapui_config'] = dapui.open +dap.listeners.before.event_terminated['dapui_config'] = dapui.close +dap.listeners.before.event_exited['dapui_config'] = dapui.close + +-- Install golang specific config +require('dap-go').setup { + delve = { + -- On Windows delve must be run attached or it crashes. + -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring + detached = vim.fn.has 'win32' == 0, + }, } diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 500ea6c4..b7e40a87 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -2,62 +2,56 @@ -- NOTE: gitsigns is already included in init.lua but contains only the base -- config. This will add also the recommended keymaps. ----@module 'lazy' ----@type LazySpec -return { - 'lewis6991/gitsigns.nvim', - ---@module 'gitsigns' - ---@type Gitsigns.Config - ---@diagnostic disable-next-line: missing-fields - opts = { - on_attach = function(bufnr) - local gitsigns = require 'gitsigns' +vim.pack.add { 'https://github.com/lewis6991/gitsigns.nvim' } - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) +require('gitsigns').setup { + on_attach = function(bufnr) + local gitsigns = require 'gitsigns' + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then + vim.cmd.normal { ']c', bang = true } + else + gitsigns.nav_hunk 'next' end + end, { desc = 'Jump to next git [c]hange' }) - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal { ']c', bang = true } - else - gitsigns.nav_hunk 'next' - end - end, { desc = 'Jump to next git [c]hange' }) + map('n', '[c', function() + if vim.wo.diff then + vim.cmd.normal { '[c', bang = true } + else + gitsigns.nav_hunk 'prev' + end + end, { desc = 'Jump to previous git [c]hange' }) - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal { '[c', bang = true } - else - gitsigns.nav_hunk 'prev' - end - end, { desc = 'Jump to previous git [c]hange' }) + -- Actions + -- visual mode + map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) + map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) + -- normal mode + map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) + map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) + map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) + map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) + map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) + map('n', 'hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' }) + map('n', 'hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' }) + map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) + map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) + map('n', 'hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' }) + map('n', 'hq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' }) + -- Toggles + map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) + map('n', 'tw', gitsigns.toggle_word_diff, { desc = '[T]oggle git intra-line [w]ord diff' }) - -- Actions - -- visual mode - map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' }) - map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) - -- normal mode - map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) - map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) - map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) - map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) - map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) - map('n', 'hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' }) - map('n', 'hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' }) - map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) - map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) - map('n', 'hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' }) - map('n', 'hq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' }) - -- Toggles - map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tw', gitsigns.toggle_word_diff, { desc = '[T]oggle git intra-line [w]ord diff' }) - - -- Text object - map({ 'o', 'x' }, 'ih', gitsigns.select_hunk) - end, - }, + -- Text object + map({ 'o', 'x' }, 'ih', gitsigns.select_hunk) + end, } diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua index 946ac793..71873656 100644 --- a/lua/kickstart/plugins/indent_line.lua +++ b/lua/kickstart/plugins/indent_line.lua @@ -1,13 +1,6 @@ -- Add indentation guides even on blank lines ----@module 'lazy' ----@type LazySpec -return { - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` - main = 'ibl', - ---@module 'ibl' - ---@type ibl.config - opts = {}, -} +-- Enable `lukas-reineke/indent-blankline.nvim` +-- See `:help ibl` +vim.pack.add { 'https://github.com/lukas-reineke/indent-blankline.nvim' } +require('ibl').setup {} diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 556f3178..d6305445 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -1,59 +1,53 @@ -- Linting ----@module 'lazy' ----@type LazySpec -return { - 'mfussenegger/nvim-lint', - event = { 'BufReadPre', 'BufNewFile' }, - config = function() - local lint = require 'lint' - lint.linters_by_ft = { - markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm - } +vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' } - -- To allow other plugins to add linters to require('lint').linters_by_ft, - -- instead set linters_by_ft like this: - -- lint.linters_by_ft = lint.linters_by_ft or {} - -- lint.linters_by_ft['markdown'] = { 'markdownlint' } - -- - -- However, note that this will enable a set of default linters, - -- which will cause errors unless these tools are available: - -- { - -- clojure = { "clj-kondo" }, - -- dockerfile = { "hadolint" }, - -- inko = { "inko" }, - -- janet = { "janet" }, - -- json = { "jsonlint" }, - -- markdown = { "vale" }, - -- rst = { "vale" }, - -- ruby = { "ruby" }, - -- terraform = { "tflint" }, - -- text = { "vale" } - -- } - -- - -- You can disable the default linters by setting their filetypes to nil: - -- lint.linters_by_ft['clojure'] = nil - -- lint.linters_by_ft['dockerfile'] = nil - -- lint.linters_by_ft['inko'] = nil - -- lint.linters_by_ft['janet'] = nil - -- lint.linters_by_ft['json'] = nil - -- lint.linters_by_ft['markdown'] = nil - -- lint.linters_by_ft['rst'] = nil - -- lint.linters_by_ft['ruby'] = nil - -- lint.linters_by_ft['terraform'] = nil - -- lint.linters_by_ft['text'] = nil - - -- Create autocommand which carries out the actual linting - -- on the specified events. - local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) - vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { - group = lint_augroup, - callback = function() - -- Only run the linter in buffers that you can modify in order to - -- avoid superfluous noise, notably within the handy LSP pop-ups that - -- describe the hovered symbol using Markdown. - if vim.bo.modifiable then lint.try_lint() end - end, - }) - end, +local lint = require 'lint' +lint.linters_by_ft = { + markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm } + +-- To allow other plugins to add linters to require('lint').linters_by_ft, +-- instead set linters_by_ft like this: +-- lint.linters_by_ft = lint.linters_by_ft or {} +-- lint.linters_by_ft['markdown'] = { 'markdownlint' } +-- +-- However, note that this will enable a set of default linters, +-- which will cause errors unless these tools are available: +-- { +-- clojure = { "clj-kondo" }, +-- dockerfile = { "hadolint" }, +-- inko = { "inko" }, +-- janet = { "janet" }, +-- json = { "jsonlint" }, +-- markdown = { "vale" }, +-- rst = { "vale" }, +-- ruby = { "ruby" }, +-- terraform = { "tflint" }, +-- text = { "vale" } +-- } +-- +-- You can disable the default linters by setting their filetypes to nil: +-- lint.linters_by_ft['clojure'] = nil +-- lint.linters_by_ft['dockerfile'] = nil +-- lint.linters_by_ft['inko'] = nil +-- lint.linters_by_ft['janet'] = nil +-- lint.linters_by_ft['json'] = nil +-- lint.linters_by_ft['markdown'] = nil +-- lint.linters_by_ft['rst'] = nil +-- lint.linters_by_ft['ruby'] = nil +-- lint.linters_by_ft['terraform'] = nil +-- lint.linters_by_ft['text'] = nil + +-- Create autocommand which carries out the actual linting +-- on the specified events. +local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) +vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { + group = lint_augroup, + callback = function() + -- Only run the linter in buffers that you can modify in order to + -- avoid superfluous noise, notably within the handy LSP pop-ups that + -- describe the hovered symbol using Markdown. + if vim.bo.modifiable then lint.try_lint() end + end, +}) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index af8d4495..d9d69931 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -1,28 +1,25 @@ -- Neo-tree is a Neovim plugin to browse the file system -- https://github.com/nvim-neo-tree/neo-tree.nvim ----@module 'lazy' ----@type LazySpec -return { - 'nvim-neo-tree/neo-tree.nvim', - version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', - }, - lazy = false, - keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, - }, - ---@module 'neo-tree' - ---@type neotree.Config - opts = { - filesystem = { - window = { - mappings = { - ['\\'] = 'close_window', - }, +local plugins = { + { src = 'https://github.com/nvim-neo-tree/neo-tree.nvim', version = vim.version.range '*' }, + 'https://github.com/nvim-lua/plenary.nvim', + 'https://github.com/MunifTanjim/nui.nvim', +} + +if vim.g.have_nerd_font then + table.insert(plugins, 'https://github.com/nvim-tree/nvim-web-devicons') -- not strictly required, but recommended +end + +vim.pack.add(plugins) + +vim.keymap.set('n', '\\', 'Neotree reveal', { desc = 'NeoTree reveal', silent = true }) + +require('neo-tree').setup { + filesystem = { + window = { + mappings = { + ['\\'] = 'close_window', }, }, }, From 716d7465c0a071217c2cff871e44e19b9d02bb65 Mon Sep 17 00:00:00 2001 From: orip Date: Tue, 21 Apr 2026 13:10:16 +0300 Subject: [PATCH 130/140] Enable vim.loader for faster loading time --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index f9ee55a0..83dae557 100644 --- a/init.lua +++ b/init.lua @@ -84,6 +84,9 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now! :) --]] +-- Enable faster startup by caching compiled Lua modules +vim.loader.enable() + -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) From a42ed30a091bb50bb046e82ee89cefc75e2cef68 Mon Sep 17 00:00:00 2001 From: orip Date: Tue, 21 Apr 2026 15:27:07 +0300 Subject: [PATCH 131/140] Update the explanations and docs --- README.md | 32 ++++++++++++++++++----- init.lua | 78 ++++++++++++++++++++++++++++++------------------------- 2 files changed, 68 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index b3ce45e2..7c62e907 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,8 @@ nvim That's it! `vim.pack` will install all the plugins from your config. Use `:lua vim.pack.update(nil, { offline = true })` to inspect plugin state and -`:lua vim.pack.update()` to fetch updates. +`:lua vim.pack.update()` to fetch updates (`:write` applies updates, `:quit` +cancels them). #### Read The Friendly Documentation @@ -169,17 +170,36 @@ After installing all the dependencies continue with the [Install Kickstart](#ins #### Windows Installation
Windows with Microsoft C++ Build Tools and CMake -Installation may require installing build tools and updating the run command for `telescope-fzf-native` +Kickstart's default config is make-only for `telescope-fzf-native.nvim`. +If `make` is unavailable, the plugin is skipped. -See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) +Recommended: install `make` (see the chocolatey section below). -This requires: +If you want a CMake-only setup, customize `init.lua` in two places: -- Install CMake and the Microsoft C++ Build Tools on Windows +1. Include `telescope-fzf-native.nvim` when `cmake` is available: ```lua -{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } +if vim.fn.executable 'make' == 1 or vim.fn.executable 'cmake' == 1 then + table.insert(plugins, gh 'nvim-telescope/telescope-fzf-native.nvim') +end ``` + +2. In the `PackChanged` hook, use CMake when `make` is unavailable: + +```lua +if name == 'telescope-fzf-native.nvim' then + if vim.fn.executable 'make' == 1 then + run_build(name, { 'make' }, ev.data.path) + elseif vim.fn.executable 'cmake' == 1 then + run_build(name, { 'cmake', '-S.', '-Bbuild', '-DCMAKE_BUILD_TYPE=Release' }, ev.data.path) + run_build(name, { 'cmake', '--build', 'build', '--config', 'Release', '--target', 'install' }, ev.data.path) + end + return +end +``` + +See `telescope-fzf-native` documentation for [build details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation).
Windows with gcc/make using chocolatey Alternatively, one can install gcc and make which don't require changing the config, diff --git a/init.lua b/init.lua index 83dae557..565a5066 100644 --- a/init.lua +++ b/init.lua @@ -233,18 +233,18 @@ vim.api.nvim_create_autocmd('TextYankPost', { callback = function() vim.hl.on_yank() end, }) --- [[ Configure and install plugins with `vim.pack` ]] +-- [[ Install plugins with `vim.pack` ]] +-- See `:help vim.pack`, `:help vim.pack-examples` or the +-- excellent blog post from the creator of vim.pack and mini.nvim: +-- https://echasnovski.com/blog/2026-03-13-a-guide-to-vim-pack -- -- To inspect plugin state and pending updates, run -- :lua vim.pack.update(nil, { offline = true }) -- -- To update plugins, run -- :lua vim.pack.update() --- --- NOTE: Here is where you install your plugins. -local gh = function(repo) return 'https://github.com/' .. repo end -local run_build = function(name, cmd, cwd) +local function run_build(name, cmd, cwd) local result = vim.system(cmd, { cwd = cwd }):wait() if result.code ~= 0 then local stderr = result.stderr or '' @@ -255,6 +255,10 @@ local run_build = function(name, cmd, cwd) end end +-- This autocommand runs after a plugin is installed or updated and +-- runs the appropriate build command for that plugin if necessary. +-- +-- See `:help vim.pack-events` vim.api.nvim_create_autocmd('PackChanged', { callback = function(ev) local name = ev.data.spec.name @@ -279,8 +283,11 @@ vim.api.nvim_create_autocmd('PackChanged', { end, }) +local gh = function(repo) return 'https://github.com/' .. repo end + ---@type (string|vim.pack.Spec)[] local plugins = { + -- You can specify plugins with a git URL. `vim.pack` then uses the default branch (usually `main` or `master`) gh 'NMAC427/guess-indent.nvim', gh 'lewis6991/gitsigns.nvim', gh 'folke/which-key.nvim', @@ -293,11 +300,14 @@ local plugins = { gh 'WhoIsSethDaniel/mason-tool-installer.nvim', gh 'j-hui/fidget.nvim', gh 'stevearc/conform.nvim', + -- You can also specify plugins with a version range for semver git tags + -- See `:help vim.version.range()` for more info { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' }, { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' }, gh 'folke/tokyonight.nvim', gh 'folke/todo-comments.nvim', gh 'nvim-mini/mini.nvim', + -- You can also specify a branch or a specific commit { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' }, } @@ -306,8 +316,14 @@ if vim.fn.executable 'make' == 1 then table.insert(plugins, gh 'nvim-telescope/t -- Useful for getting pretty icons, but requires a Nerd Font. if vim.g.have_nerd_font then table.insert(plugins, gh 'nvim-tree/nvim-web-devicons') end +-- NOTE: Here is where the plugins are actually installed and added to the path vim.pack.add(plugins) +-- [[ Configure plugins ]] +-- For most plugins you need to call their `.setup()` to start them +-- +-- For example, here is the simplest possible setup for `guess-indent.nvim`, +-- which will automatically detect and set your indentation settings based on the current file. require('guess-indent').setup {} -- Here is a more advanced example that passes configuration options to `gitsigns.nvim` @@ -337,24 +353,16 @@ require('which-key').setup { { 'gr', group = 'LSP Actions', mode = { 'n' } }, }, } --- Fuzzy Finder (files, lsp, etc) --- --- By default, Telescope is included and acts as your picker for everything. --- # TODO: Rework this docstring --- --- If you would like to switch to a different picker (like snacks, or fzf-lua) --- you can disable the Telescope plugin by setting enabled to false and enable --- your replacement picker by requiring it explicitly (e.g. 'custom.plugins.snacks') - --- Note: If you customize your config for yourself, --- it’s best to remove the Telescope plugin config entirely --- instead of just disabling it here, to keep your config clean. +-- [[ Fuzzy Finder (files, lsp, etc) ]] -- -- Telescope is a fuzzy finder that comes with a lot of different things that -- it can fuzzy find! It's more than just a "file finder", it can search -- many different aspects of Neovim, your workspace, LSP, and more! -- +-- There are lots of other alternative pickers (like snacks.picker, or fzf-lua) +-- so feel free to experiment and see what you like! +-- -- The easiest way to use Telescope, is to start by doing something like: -- :Telescope help_tags -- @@ -370,7 +378,6 @@ require('which-key').setup { -- Telescope picker. This is really useful to discover what Telescope can -- do as well as how to actually do it! --- [[ Configure Telescope ]] -- See `:help telescope` and `:help telescope.setup()` require('telescope').setup { -- You can put your default mappings / updates / etc. in here @@ -465,15 +472,7 @@ vim.keymap.set( -- Shortcut for searching your Neovim configuration files vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) --- LSP Plugins - --- Automatically install LSPs and related tools to stdpath for Neovim --- Mason must be loaded before its dependents so we need to set it up here. -require('mason').setup {} - --- Useful status updates for LSP. -require('fidget').setup {} - +-- [[ LSP Configuration ]] -- Brief aside: **What is LSP?** -- -- LSP is an initialism you've probably heard, but might not understand what it is. @@ -499,6 +498,9 @@ require('fidget').setup {} -- If you're wondering about lsp vs treesitter, you can check out the wonderfully -- and elegantly composed help section, `:help lsp-vs-treesitter` +-- Useful status updates for LSP. +require('fidget').setup {} + -- This function gets run when an LSP attaches to a particular buffer. -- That is to say, every time a new file is opened that is associated with -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this @@ -620,6 +622,9 @@ local servers = { }, } +-- Automatically install LSPs and related tools to stdpath for Neovim +require('mason').setup {} + -- Ensure the servers and tools above are installed -- -- To check the current status of installed tools and/or manually install @@ -639,7 +644,7 @@ for name, server in pairs(servers) do vim.lsp.enable(name) end --- Autoformat +-- [[ Formatting ]] require('conform').setup { notify_on_error = false, format_on_save = function(bufnr) @@ -670,17 +675,19 @@ require('conform').setup { vim.keymap.set({ 'n', 'v' }, 'f', function() require('conform').format { async = true } end, { desc = '[F]ormat buffer' }) +-- [[ Autocompletion Configuration ]] + -- Snippet Engine --- +require('luasnip').setup {} + -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets -- -- vim.pack.add { gh 'rafamadriz/friendly-snippets' } -- require('luasnip.loaders.from_vscode').lazy_load() -require('luasnip').setup {} --- Autocompletion +-- The autocomplete engine require('blink.cmp').setup { keymap = { -- 'default' (recommended) for mappings similar to built-in completions @@ -741,9 +748,10 @@ require('blink.cmp').setup { signature = { enabled = true }, } +-- [[ Colorscheme ]] -- You can easily change to a different colorscheme. -- Change the name of the colorscheme plugin below, and then --- change the command in the config to whatever the name of that colorscheme is. +-- change the command under that to load whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. ---@diagnostic disable-next-line: missing-fields @@ -761,7 +769,8 @@ vim.cmd.colorscheme 'tokyonight-night' -- Highlight todo, notes, etc in comments require('todo-comments').setup { signs = false } --- Collection of various small independent plugins/modules +-- [[ mini.nvim ]] +-- A collection of various small independent plugins/modules -- Better Around/Inside textobjects -- @@ -874,9 +883,6 @@ vim.api.nvim_create_autocmd('FileType', { -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- require 'custom.plugins' --- --- For additional information with loading, sourcing and examples see `:help vim.pack` --- and `:help vim.pack-examples` -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 2e8d5b17cb51513ae6f1e54a65d7fac96b1b23e3 Mon Sep 17 00:00:00 2001 From: orip Date: Thu, 23 Apr 2026 21:01:25 +0300 Subject: [PATCH 132/140] Split into sections --- init.lua | 1530 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 791 insertions(+), 739 deletions(-) diff --git a/init.lua b/init.lua index 565a5066..27bb5397 100644 --- a/init.lua +++ b/init.lua @@ -84,805 +84,857 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now! :) --]] --- Enable faster startup by caching compiled Lua modules -vim.loader.enable() +-- ============================================================ +-- SECTION 1: FOUNDATION +-- Core Neovim settings, leaders, options, basic keymaps, basic autocmds +-- ============================================================ +do + -- Enable faster startup by caching compiled Lua modules + vim.loader.enable() --- Set as the leader key --- See `:help mapleader` --- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' + -- Set as the leader key + -- See `:help mapleader` + -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) + vim.g.mapleader = ' ' + vim.g.maplocalleader = ' ' --- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false + -- Set to true if you have a Nerd Font installed and selected in the terminal + vim.g.have_nerd_font = false --- [[ Setting options ]] --- See `:help vim.o` --- NOTE: You can change these options as you wish! --- For more options, you can see `:help option-list` + -- [[ Setting options ]] + -- See `:help vim.o` + -- NOTE: You can change these options as you wish! + -- For more options, you can see `:help option-list` --- Make line numbers default -vim.o.number = true --- You can also add relative line numbers, to help with jumping. --- Experiment for yourself to see if you like it! --- vim.o.relativenumber = true + -- Make line numbers default + vim.o.number = true + -- You can also add relative line numbers, to help with jumping. + -- Experiment for yourself to see if you like it! + -- vim.o.relativenumber = true --- Enable mouse mode, can be useful for resizing splits for example! -vim.o.mouse = 'a' + -- Enable mouse mode, can be useful for resizing splits for example! + vim.o.mouse = 'a' --- Don't show the mode, since it's already in the status line -vim.o.showmode = false + -- Don't show the mode, since it's already in the status line + vim.o.showmode = false --- Sync clipboard between OS and Neovim. --- Schedule the setting after `UiEnter` because it can increase startup-time. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) + -- Sync clipboard between OS and Neovim. + -- Schedule the setting after `UiEnter` because it can increase startup-time. + -- Remove this option if you want your OS clipboard to remain independent. + -- See `:help 'clipboard'` + vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) --- Enable break indent -vim.o.breakindent = true + -- Enable break indent + vim.o.breakindent = true --- Enable undo/redo changes even after closing and reopening a file -vim.o.undofile = true + -- Enable undo/redo changes even after closing and reopening a file + vim.o.undofile = true --- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.o.ignorecase = true -vim.o.smartcase = true + -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term + vim.o.ignorecase = true + vim.o.smartcase = true --- Keep signcolumn on by default -vim.o.signcolumn = 'yes' + -- Keep signcolumn on by default + vim.o.signcolumn = 'yes' --- Decrease update time -vim.o.updatetime = 250 + -- Decrease update time + vim.o.updatetime = 250 --- Decrease mapped sequence wait time -vim.o.timeoutlen = 300 + -- Decrease mapped sequence wait time + vim.o.timeoutlen = 300 --- Configure how new splits should be opened -vim.o.splitright = true -vim.o.splitbelow = true + -- Configure how new splits should be opened + vim.o.splitright = true + vim.o.splitbelow = true --- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'` --- and `:help 'listchars'` --- --- Notice listchars is set using `vim.opt` instead of `vim.o`. --- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables. --- See `:help lua-options` --- and `:help lua-guide-options` -vim.o.list = true -vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + -- Sets how neovim will display certain whitespace characters in the editor. + -- See `:help 'list'` + -- and `:help 'listchars'` + -- + -- Notice listchars is set using `vim.opt` instead of `vim.o`. + -- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables. + -- See `:help lua-options` + -- and `:help lua-guide-options` + vim.o.list = true + vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } --- Preview substitutions live, as you type! -vim.o.inccommand = 'split' + -- Preview substitutions live, as you type! + vim.o.inccommand = 'split' --- Show which line your cursor is on -vim.o.cursorline = true + -- Show which line your cursor is on + vim.o.cursorline = true --- Minimal number of screen lines to keep above and below the cursor. -vim.o.scrolloff = 10 + -- Minimal number of screen lines to keep above and below the cursor. + vim.o.scrolloff = 10 --- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), --- instead raise a dialog asking if you wish to save the current file(s) --- See `:help 'confirm'` -vim.o.confirm = true + -- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), + -- instead raise a dialog asking if you wish to save the current file(s) + -- See `:help 'confirm'` + vim.o.confirm = true --- [[ Basic Keymaps ]] --- See `:help vim.keymap.set()` + -- [[ Basic Keymaps ]] + -- See `:help vim.keymap.set()` --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') + -- Clear highlights on search when pressing in normal mode + -- See `:help hlsearch` + vim.keymap.set('n', '', 'nohlsearch') --- Diagnostic Config & Keymaps --- See `:help vim.diagnostic.Opts` -vim.diagnostic.config { - update_in_insert = false, - severity_sort = true, - float = { border = 'rounded', source = 'if_many' }, - underline = { severity = { min = vim.diagnostic.severity.WARN } }, + -- Diagnostic Config & Keymaps + -- See `:help vim.diagnostic.Opts` + vim.diagnostic.config { + update_in_insert = false, + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = { min = vim.diagnostic.severity.WARN } }, - -- Can switch between these as you prefer - virtual_text = true, -- Text shows up at the end of the line - virtual_lines = false, -- Text shows up underneath the line, with virtual lines + -- Can switch between these as you prefer + virtual_text = true, -- Text shows up at the end of the line + virtual_lines = false, -- Text shows up underneath the line, with virtual lines - -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` - jump = { float = true }, -} + -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` + jump = { float = true }, + } -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) --- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. --- --- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping --- or just use to exit terminal mode -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier + -- for people to discover. Otherwise, you normally need to press , which + -- is not what someone will guess without a bit more experience. + -- + -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping + -- or just use to exit terminal mode + vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) --- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') + -- TIP: Disable arrow keys in normal mode + -- vim.keymap.set('n', '', 'echo "Use h to move!!"') + -- vim.keymap.set('n', '', 'echo "Use l to move!!"') + -- vim.keymap.set('n', '', 'echo "Use k to move!!"') + -- vim.keymap.set('n', '', 'echo "Use j to move!!"') --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) + -- Keybinds to make split navigation easier. + -- Use CTRL+ to switch between windows + -- + -- See `:help wincmd` for a list of all window commands + vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) + vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) + vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) + vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) --- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes --- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) --- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) --- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) --- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) + -- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes + -- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) + -- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) + -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) + -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) --- [[ Basic Autocommands ]] --- See `:help lua-guide-autocommands` + -- [[ Basic Autocommands ]] + -- See `:help lua-guide-autocommands` --- Highlight when yanking (copying) text --- Try it with `yap` in normal mode --- See `:help vim.hl.on_yank()` -vim.api.nvim_create_autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() vim.hl.on_yank() end, -}) + -- Highlight when yanking (copying) text + -- Try it with `yap` in normal mode + -- See `:help vim.hl.on_yank()` + vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() vim.hl.on_yank() end, + }) +end --- [[ Install plugins with `vim.pack` ]] --- See `:help vim.pack`, `:help vim.pack-examples` or the --- excellent blog post from the creator of vim.pack and mini.nvim: --- https://echasnovski.com/blog/2026-03-13-a-guide-to-vim-pack --- --- To inspect plugin state and pending updates, run --- :lua vim.pack.update(nil, { offline = true }) --- --- To update plugins, run --- :lua vim.pack.update() +-- ============================================================ +-- SECTION 2: PLUGIN MANAGER +-- vim.pack, build hooks, install/update plugins, plugin specs +-- ============================================================ +do + -- [[ Install plugins with `vim.pack` ]] + -- See `:help vim.pack`, `:help vim.pack-examples` or the + -- excellent blog post from the creator of vim.pack and mini.nvim: + -- https://echasnovski.com/blog/2026-03-13-a-guide-to-vim-pack + -- + -- To inspect plugin state and pending updates, run + -- :lua vim.pack.update(nil, { offline = true }) + -- + -- To update plugins, run + -- :lua vim.pack.update() -local function run_build(name, cmd, cwd) - local result = vim.system(cmd, { cwd = cwd }):wait() - if result.code ~= 0 then - local stderr = result.stderr or '' - local stdout = result.stdout or '' - local output = stderr ~= '' and stderr or stdout - if output == '' then output = 'No output from build command.' end - vim.notify(('Build failed for %s:\n%s'):format(name, output), vim.log.levels.ERROR) + local function run_build(name, cmd, cwd) + local result = vim.system(cmd, { cwd = cwd }):wait() + if result.code ~= 0 then + local stderr = result.stderr or '' + local stdout = result.stdout or '' + local output = stderr ~= '' and stderr or stdout + if output == '' then output = 'No output from build command.' end + vim.notify(('Build failed for %s:\n%s'):format(name, output), vim.log.levels.ERROR) + end + end + + -- This autocommand runs after a plugin is installed or updated and + -- runs the appropriate build command for that plugin if necessary. + -- + -- See `:help vim.pack-events` + vim.api.nvim_create_autocmd('PackChanged', { + callback = function(ev) + local name = ev.data.spec.name + local kind = ev.data.kind + if kind ~= 'install' and kind ~= 'update' then return end + + if name == 'telescope-fzf-native.nvim' and vim.fn.executable 'make' == 1 then + run_build(name, { 'make' }, ev.data.path) + return + end + + if name == 'LuaSnip' then + if vim.fn.has 'win32' ~= 1 and vim.fn.executable 'make' == 1 then run_build(name, { 'make', 'install_jsregexp' }, ev.data.path) end + return + end + + if name == 'nvim-treesitter' then + if not ev.data.active then vim.cmd.packadd 'nvim-treesitter' end + vim.cmd 'TSUpdate' + return + end + end, + }) + + local gh = function(repo) return 'https://github.com/' .. repo end + + ---@type (string|vim.pack.Spec)[] + local plugins = { + -- You can specify plugins with a git URL. `vim.pack` then uses the default branch (usually `main` or `master`) + gh 'NMAC427/guess-indent.nvim', + gh 'lewis6991/gitsigns.nvim', + gh 'folke/which-key.nvim', + gh 'nvim-lua/plenary.nvim', + gh 'nvim-telescope/telescope.nvim', + gh 'nvim-telescope/telescope-ui-select.nvim', + gh 'neovim/nvim-lspconfig', + gh 'mason-org/mason.nvim', + gh 'mason-org/mason-lspconfig.nvim', + gh 'WhoIsSethDaniel/mason-tool-installer.nvim', + gh 'j-hui/fidget.nvim', + gh 'stevearc/conform.nvim', + -- You can also specify plugins with a version range for semver git tags + -- See `:help vim.version.range()` for more info + { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' }, + { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' }, + gh 'folke/tokyonight.nvim', + gh 'folke/todo-comments.nvim', + gh 'nvim-mini/mini.nvim', + -- You can also specify a branch or a specific commit + { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' }, + } + + if vim.fn.executable 'make' == 1 then table.insert(plugins, gh 'nvim-telescope/telescope-fzf-native.nvim') end + + -- Useful for getting pretty icons, but requires a Nerd Font. + if vim.g.have_nerd_font then table.insert(plugins, gh 'nvim-tree/nvim-web-devicons') end + + -- NOTE: Here is where the plugins are actually installed and added to the path + vim.pack.add(plugins) +end + +-- ============================================================ +-- SECTION 3: UI / CORE UX PLUGINS +-- guess-indent, gitsigns, which-key, colorscheme, todo-comments, mini modules +-- ============================================================ +do + -- [[ Configure plugins ]] + -- For most plugins you need to call their `.setup()` to start them + -- + -- For example, here is the simplest possible setup for `guess-indent.nvim`, + -- which will automatically detect and set your indentation settings based on the current file. + require('guess-indent').setup {} + + -- Here is a more advanced example that passes configuration options to `gitsigns.nvim` + -- + -- See `:help gitsigns` to understand what each configuration key does. + -- Adds git related signs to the gutter, as well as utilities for managing changes + require('gitsigns').setup { + signs = { + add = { text = '+' }, ---@diagnostic disable-line: missing-fields + change = { text = '~' }, ---@diagnostic disable-line: missing-fields + delete = { text = '_' }, ---@diagnostic disable-line: missing-fields + topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields + changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields + }, + } + + -- Useful plugin to show you pending keybinds. + require('which-key').setup { + -- Delay between pressing a key and opening which-key (milliseconds) + delay = 0, + icons = { mappings = vim.g.have_nerd_font }, + -- Document existing key chains + spec = { + { 's', group = '[S]earch', mode = { 'n', 'v' } }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first + { 'gr', group = 'LSP Actions', mode = { 'n' } }, + }, + } + + -- [[ Colorscheme ]] + -- You can easily change to a different colorscheme. + -- Change the name of the colorscheme plugin below, and then + -- change the command under that to load whatever the name of that colorscheme is. + -- + -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. + ---@diagnostic disable-next-line: missing-fields + require('tokyonight').setup { + styles = { + comments = { italic = false }, -- Disable italics in comments + }, + } + + -- Load the colorscheme here. + -- Like many other themes, this one has different styles, and you could load + -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. + vim.cmd.colorscheme 'tokyonight-night' + + -- Highlight todo, notes, etc in comments + require('todo-comments').setup { signs = false } + + -- [[ mini.nvim ]] + -- A collection of various small independent plugins/modules + + -- Better Around/Inside textobjects + -- + -- Examples: + -- - va) - [V]isually select [A]round [)]paren + -- - yiiq - [Y]ank [I]nside [I]+1 [Q]uote + -- - ci' - [C]hange [I]nside [']quote + require('mini.ai').setup { + -- NOTE: Avoid conflicts with the built-in incremental selection mappings on Neovim>=0.12 (see `:help treesitter-incremental-selection`) + mappings = { + around_next = 'aa', + inside_next = 'ii', + }, + n_lines = 500, + } + + -- Add/delete/replace surroundings (brackets, quotes, etc.) + -- + -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren + -- - sd' - [S]urround [D]elete [']quotes + -- - sr)' - [S]urround [R]eplace [)] ['] + require('mini.surround').setup() + + -- Simple and easy statusline. + -- You could remove this setup call if you don't like it, + -- and try some other statusline plugin + local statusline = require 'mini.statusline' + -- Set `use_icons` to true if you have a Nerd Font + statusline.setup { use_icons = vim.g.have_nerd_font } + + -- You can configure sections in the statusline by overriding their + -- default behavior. For example, here we set the section for + -- cursor location to LINE:COLUMN + ---@diagnostic disable-next-line: duplicate-set-field + statusline.section_location = function() return '%2l:%-2v' end + + -- ... and there is more! + -- Check out: https://github.com/nvim-mini/mini.nvim +end + +-- ============================================================ +-- SECTION 4: SEARCH & NAVIGATION +-- Telescope setup, keymaps, LSP picker mappings +-- ============================================================ +do + -- [[ Fuzzy Finder (files, lsp, etc) ]] + -- + -- Telescope is a fuzzy finder that comes with a lot of different things that + -- it can fuzzy find! It's more than just a "file finder", it can search + -- many different aspects of Neovim, your workspace, LSP, and more! + -- + -- There are lots of other alternative pickers (like snacks.picker, or fzf-lua) + -- so feel free to experiment and see what you like! + -- + -- The easiest way to use Telescope, is to start by doing something like: + -- :Telescope help_tags + -- + -- After running this command, a window will open up and you're able to + -- type in the prompt window. You'll see a list of `help_tags` options and + -- a corresponding preview of the help. + -- + -- Two important keymaps to use while in Telescope are: + -- - Insert mode: + -- - Normal mode: ? + -- + -- This opens a window that shows you all of the keymaps for the current + -- Telescope picker. This is really useful to discover what Telescope can + -- do as well as how to actually do it! + + -- See `:help telescope` and `:help telescope.setup()` + require('telescope').setup { + -- You can put your default mappings / updates / etc. in here + -- All the info you're looking for is in `:help telescope.setup()` + -- + -- defaults = { + -- mappings = { + -- i = { [''] = 'to_fuzzy_refine' }, + -- }, + -- }, + -- pickers = {} + extensions = { + ['ui-select'] = { require('telescope.themes').get_dropdown() }, + }, + } + + -- Enable Telescope extensions if they are installed + pcall(require('telescope').load_extension, 'fzf') + pcall(require('telescope').load_extension, 'ui-select') + + -- See `:help telescope.builtin` + local builtin = require 'telescope.builtin' + vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) + vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) + vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) + vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) + vim.keymap.set({ 'n', 'v' }, 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) + vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) + vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) + vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) + vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + + -- Add Telescope-based LSP pickers when an LSP attaches to a buffer. + -- If you later switch picker plugins, this is where to update these mappings. + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), + callback = function(event) + local buf = event.buf + + -- Find references for the word under your cursor. + vim.keymap.set('n', 'grr', builtin.lsp_references, { buffer = buf, desc = '[G]oto [R]eferences' }) + + -- Jump to the implementation of the word under your cursor. + -- Useful when your language has ways of declaring types without an actual implementation. + vim.keymap.set('n', 'gri', builtin.lsp_implementations, { buffer = buf, desc = '[G]oto [I]mplementation' }) + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press . + vim.keymap.set('n', 'grd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' }) + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + vim.keymap.set('n', 'gO', builtin.lsp_document_symbols, { buffer = buf, desc = 'Open Document Symbols' }) + + -- Fuzzy find all the symbols in your current workspace. + -- Similar to document symbols, except searches over your entire project. + vim.keymap.set('n', 'gW', builtin.lsp_dynamic_workspace_symbols, { buffer = buf, desc = 'Open Workspace Symbols' }) + + -- Jump to the type of the word under your cursor. + -- Useful when you're not sure what type a variable is and you want to see + -- the definition of its *type*, not where it was *defined*. + vim.keymap.set('n', 'grt', builtin.lsp_type_definitions, { buffer = buf, desc = '[G]oto [T]ype Definition' }) + end, + }) + + -- Override default behavior and theme when searching + vim.keymap.set('n', '/', function() + -- You can pass additional configuration to Telescope to change the theme, layout, etc. + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) + end, { desc = '[/] Fuzzily search in current buffer' }) + + -- It's also possible to pass additional configuration options. + -- See `:help telescope.builtin.live_grep()` for information about particular keys + vim.keymap.set( + 'n', + 's/', + function() + builtin.live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } + end, + { desc = '[S]earch [/] in Open Files' } + ) + + -- Shortcut for searching your Neovim configuration files + vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) +end + +-- ============================================================ +-- SECTION 5: LSP +-- LSP keymaps, server configuration, Mason tools installations +-- ============================================================ +do + -- [[ LSP Configuration ]] + -- Brief aside: **What is LSP?** + -- + -- LSP is an initialism you've probably heard, but might not understand what it is. + -- + -- LSP stands for Language Server Protocol. It's a protocol that helps editors + -- and language tooling communicate in a standardized fashion. + -- + -- In general, you have a "server" which is some tool built to understand a particular + -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers + -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone + -- processes that communicate with some "client" - in this case, Neovim! + -- + -- LSP provides Neovim with features like: + -- - Go to definition + -- - Find references + -- - Autocompletion + -- - Symbol Search + -- - and more! + -- + -- Thus, Language Servers are external tools that must be installed separately from + -- Neovim. This is where `mason` and related plugins come into play. + -- + -- If you're wondering about lsp vs treesitter, you can check out the wonderfully + -- and elegantly composed help section, `:help lsp-vs-treesitter` + + -- Useful status updates for LSP. + require('fidget').setup {} + + -- This function gets run when an LSP attaches to a particular buffer. + -- That is to say, every time a new file is opened that is associated with + -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this + -- function will be executed to configure the current buffer + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), + callback = function(event) + -- NOTE: Remember that Lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself. + -- + -- In this case, we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end + + -- Rename the variable under your cursor. + -- Most Language Servers support renaming across files, etc. + map('grn', vim.lsp.buf.rename, '[R]e[n]ame') + + -- Execute a code action, usually your cursor needs to be on top of an error + -- or a suggestion from your LSP for this to activate. + map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) + + -- WARN: This is not Goto Definition, this is Goto Declaration. + -- For example, in C this would take you to the header. + map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + + -- The following two autocommands are used to highlight references of the + -- word under your cursor when your cursor rests there for a little while. + -- See `:help CursorHold` for information about when this is executed + -- + -- When you move your cursor, the highlights will be cleared (the second autocommand). + local client = vim.lsp.get_client_by_id(event.data.client_id) + if client and client:supports_method('textDocument/documentHighlight', event.buf) then + local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + + vim.api.nvim_create_autocmd('LspDetach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + end, + }) + end + + -- The following code creates a keymap to toggle inlay hints in your + -- code, if the language server you are using supports them + -- + -- This may be unwanted, since they displace some of your code + if client and client:supports_method('textDocument/inlayHint', event.buf) then + map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') + end + end, + }) + + -- Enable the following language servers + -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. + -- See `:help lsp-config` for information about keys and how to configure + ---@type table + local servers = { + -- clangd = {}, + -- gopls = {}, + -- pyright = {}, + -- rust_analyzer = {}, + -- + -- Some languages (like typescript) have entire language plugins that can be useful: + -- https://github.com/pmizio/typescript-tools.nvim + -- + -- But for many setups, the LSP (`ts_ls`) will work just fine + -- ts_ls = {}, + + stylua = {}, -- Used to format Lua code + + -- Special Lua Config, as recommended by neovim help docs + lua_ls = { + on_init = function(client) + client.server_capabilities.documentFormattingProvider = false -- Disable formatting (formatting is done by stylua) + + if client.workspace_folders then + local path = client.workspace_folders[1].name + if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + version = 'LuaJIT', + path = { 'lua/?.lua', 'lua/?/init.lua' }, + }, + workspace = { + checkThirdParty = false, + -- NOTE: this is a lot slower and will cause issues when working on your own configuration. + -- See https://github.com/neovim/nvim-lspconfig/issues/3189 + library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), { + '${3rd}/luv/library', + '${3rd}/busted/library', + }), + }, + }) + end, + ---@type lspconfig.settings.lua_ls + settings = { + Lua = { + format = { enable = false }, -- Disable formatting (formatting is done by stylua) + }, + }, + }, + } + + -- Automatically install LSPs and related tools to stdpath for Neovim + require('mason').setup {} + + -- Ensure the servers and tools above are installed + -- + -- To check the current status of installed tools and/or manually install + -- other tools, you can run + -- :Mason + -- + -- You can press `g?` for help in this menu. + local ensure_installed = vim.tbl_keys(servers or {}) + vim.list_extend(ensure_installed, { + -- You can add other tools here that you want Mason to install + }) + + require('mason-tool-installer').setup { ensure_installed = ensure_installed } + + for name, server in pairs(servers) do + vim.lsp.config(name, server) + vim.lsp.enable(name) end end --- This autocommand runs after a plugin is installed or updated and --- runs the appropriate build command for that plugin if necessary. --- --- See `:help vim.pack-events` -vim.api.nvim_create_autocmd('PackChanged', { - callback = function(ev) - local name = ev.data.spec.name - local kind = ev.data.kind - if kind ~= 'install' and kind ~= 'update' then return end - - if name == 'telescope-fzf-native.nvim' and vim.fn.executable 'make' == 1 then - run_build(name, { 'make' }, ev.data.path) - return - end - - if name == 'LuaSnip' then - if vim.fn.has 'win32' ~= 1 and vim.fn.executable 'make' == 1 then run_build(name, { 'make', 'install_jsregexp' }, ev.data.path) end - return - end - - if name == 'nvim-treesitter' then - if not ev.data.active then vim.cmd.packadd 'nvim-treesitter' end - vim.cmd 'TSUpdate' - return - end - end, -}) - -local gh = function(repo) return 'https://github.com/' .. repo end - ----@type (string|vim.pack.Spec)[] -local plugins = { - -- You can specify plugins with a git URL. `vim.pack` then uses the default branch (usually `main` or `master`) - gh 'NMAC427/guess-indent.nvim', - gh 'lewis6991/gitsigns.nvim', - gh 'folke/which-key.nvim', - gh 'nvim-lua/plenary.nvim', - gh 'nvim-telescope/telescope.nvim', - gh 'nvim-telescope/telescope-ui-select.nvim', - gh 'neovim/nvim-lspconfig', - gh 'mason-org/mason.nvim', - gh 'mason-org/mason-lspconfig.nvim', - gh 'WhoIsSethDaniel/mason-tool-installer.nvim', - gh 'j-hui/fidget.nvim', - gh 'stevearc/conform.nvim', - -- You can also specify plugins with a version range for semver git tags - -- See `:help vim.version.range()` for more info - { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' }, - { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' }, - gh 'folke/tokyonight.nvim', - gh 'folke/todo-comments.nvim', - gh 'nvim-mini/mini.nvim', - -- You can also specify a branch or a specific commit - { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' }, -} - -if vim.fn.executable 'make' == 1 then table.insert(plugins, gh 'nvim-telescope/telescope-fzf-native.nvim') end - --- Useful for getting pretty icons, but requires a Nerd Font. -if vim.g.have_nerd_font then table.insert(plugins, gh 'nvim-tree/nvim-web-devicons') end - --- NOTE: Here is where the plugins are actually installed and added to the path -vim.pack.add(plugins) - --- [[ Configure plugins ]] --- For most plugins you need to call their `.setup()` to start them --- --- For example, here is the simplest possible setup for `guess-indent.nvim`, --- which will automatically detect and set your indentation settings based on the current file. -require('guess-indent').setup {} - --- Here is a more advanced example that passes configuration options to `gitsigns.nvim` --- --- See `:help gitsigns` to understand what each configuration key does. --- Adds git related signs to the gutter, as well as utilities for managing changes -require('gitsigns').setup { - signs = { - add = { text = '+' }, ---@diagnostic disable-line: missing-fields - change = { text = '~' }, ---@diagnostic disable-line: missing-fields - delete = { text = '_' }, ---@diagnostic disable-line: missing-fields - topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields - changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields - }, -} - --- Useful plugin to show you pending keybinds. -require('which-key').setup { - -- Delay between pressing a key and opening which-key (milliseconds) - delay = 0, - icons = { mappings = vim.g.have_nerd_font }, - -- Document existing key chains - spec = { - { 's', group = '[S]earch', mode = { 'n', 'v' } }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first - { 'gr', group = 'LSP Actions', mode = { 'n' } }, - }, -} - --- [[ Fuzzy Finder (files, lsp, etc) ]] --- --- Telescope is a fuzzy finder that comes with a lot of different things that --- it can fuzzy find! It's more than just a "file finder", it can search --- many different aspects of Neovim, your workspace, LSP, and more! --- --- There are lots of other alternative pickers (like snacks.picker, or fzf-lua) --- so feel free to experiment and see what you like! --- --- The easiest way to use Telescope, is to start by doing something like: --- :Telescope help_tags --- --- After running this command, a window will open up and you're able to --- type in the prompt window. You'll see a list of `help_tags` options and --- a corresponding preview of the help. --- --- Two important keymaps to use while in Telescope are: --- - Insert mode: --- - Normal mode: ? --- --- This opens a window that shows you all of the keymaps for the current --- Telescope picker. This is really useful to discover what Telescope can --- do as well as how to actually do it! - --- See `:help telescope` and `:help telescope.setup()` -require('telescope').setup { - -- You can put your default mappings / updates / etc. in here - -- All the info you're looking for is in `:help telescope.setup()` - -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} - extensions = { - ['ui-select'] = { require('telescope.themes').get_dropdown() }, - }, -} - --- Enable Telescope extensions if they are installed -pcall(require('telescope').load_extension, 'fzf') -pcall(require('telescope').load_extension, 'ui-select') - --- See `:help telescope.builtin` -local builtin = require 'telescope.builtin' -vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) -vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) -vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) -vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) -vim.keymap.set({ 'n', 'v' }, 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) -vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) -vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) -vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) -vim.keymap.set('n', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) -vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - --- Add Telescope-based LSP pickers when an LSP attaches to a buffer. --- If you later switch picker plugins, this is where to update these mappings. -vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), - callback = function(event) - local buf = event.buf - - -- Find references for the word under your cursor. - vim.keymap.set('n', 'grr', builtin.lsp_references, { buffer = buf, desc = '[G]oto [R]eferences' }) - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - vim.keymap.set('n', 'gri', builtin.lsp_implementations, { buffer = buf, desc = '[G]oto [I]mplementation' }) - - -- Jump to the definition of the word under your cursor. - -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . - vim.keymap.set('n', 'grd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' }) - - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - vim.keymap.set('n', 'gO', builtin.lsp_document_symbols, { buffer = buf, desc = 'Open Document Symbols' }) - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - vim.keymap.set('n', 'gW', builtin.lsp_dynamic_workspace_symbols, { buffer = buf, desc = 'Open Workspace Symbols' }) - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - vim.keymap.set('n', 'grt', builtin.lsp_type_definitions, { buffer = buf, desc = '[G]oto [T]ype Definition' }) - end, -}) - --- Override default behavior and theme when searching -vim.keymap.set('n', '/', function() - -- You can pass additional configuration to Telescope to change the theme, layout, etc. - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) -end, { desc = '[/] Fuzzily search in current buffer' }) - --- It's also possible to pass additional configuration options. --- See `:help telescope.builtin.live_grep()` for information about particular keys -vim.keymap.set( - 'n', - 's/', - function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end, - { desc = '[S]earch [/] in Open Files' } -) - --- Shortcut for searching your Neovim configuration files -vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) - --- [[ LSP Configuration ]] --- Brief aside: **What is LSP?** --- --- LSP is an initialism you've probably heard, but might not understand what it is. --- --- LSP stands for Language Server Protocol. It's a protocol that helps editors --- and language tooling communicate in a standardized fashion. --- --- In general, you have a "server" which is some tool built to understand a particular --- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers --- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone --- processes that communicate with some "client" - in this case, Neovim! --- --- LSP provides Neovim with features like: --- - Go to definition --- - Find references --- - Autocompletion --- - Symbol Search --- - and more! --- --- Thus, Language Servers are external tools that must be installed separately from --- Neovim. This is where `mason` and related plugins come into play. --- --- If you're wondering about lsp vs treesitter, you can check out the wonderfully --- and elegantly composed help section, `:help lsp-vs-treesitter` - --- Useful status updates for LSP. -require('fidget').setup {} - --- This function gets run when an LSP attaches to a particular buffer. --- That is to say, every time a new file is opened that is associated with --- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this --- function will be executed to configure the current buffer -vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), - callback = function(event) - -- NOTE: Remember that Lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - local map = function(keys, func, desc, mode) - mode = mode or 'n' - vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) - end - - -- Rename the variable under your cursor. - -- Most Language Servers support renaming across files, etc. - map('grn', vim.lsp.buf.rename, '[R]e[n]ame') - - -- Execute a code action, usually your cursor needs to be on top of an error - -- or a suggestion from your LSP for this to activate. - map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) - - -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header. - map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - - -- The following two autocommands are used to highlight references of the - -- word under your cursor when your cursor rests there for a little while. - -- See `:help CursorHold` for information about when this is executed - -- - -- When you move your cursor, the highlights will be cleared (the second autocommand). - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client:supports_method('textDocument/documentHighlight', event.buf) then - local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) - vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.document_highlight, - }) - - vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.clear_references, - }) - - vim.api.nvim_create_autocmd('LspDetach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), - callback = function(event2) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } - end, - }) - end - - -- The following code creates a keymap to toggle inlay hints in your - -- code, if the language server you are using supports them - -- - -- This may be unwanted, since they displace some of your code - if client and client:supports_method('textDocument/inlayHint', event.buf) then - map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') - end - end, -}) - --- Enable the following language servers --- Feel free to add/remove any LSPs that you want here. They will automatically be installed. --- See `:help lsp-config` for information about keys and how to configure ----@type table -local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- - -- Some languages (like typescript) have entire language plugins that can be useful: - -- https://github.com/pmizio/typescript-tools.nvim - -- - -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, - - stylua = {}, -- Used to format Lua code - - -- Special Lua Config, as recommended by neovim help docs - lua_ls = { - on_init = function(client) - client.server_capabilities.documentFormattingProvider = false -- Disable formatting (formatting is done by stylua) - - if client.workspace_folders then - local path = client.workspace_folders[1].name - if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end +-- ============================================================ +-- SECTION 6: FORMATTING +-- conform.nvim setup and keymap +-- ============================================================ +do + -- [[ Formatting ]] + require('conform').setup { + notify_on_error = false, + format_on_save = function(bufnr) + -- You can specify filetypes to autoformat on save here: + local enabled_filetypes = { + -- lua = true, + -- python = true, + } + if enabled_filetypes[vim.bo[bufnr].filetype] then + return { timeout_ms = 500 } + else + return nil end - - client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { - runtime = { - version = 'LuaJIT', - path = { 'lua/?.lua', 'lua/?/init.lua' }, - }, - workspace = { - checkThirdParty = false, - -- NOTE: this is a lot slower and will cause issues when working on your own configuration. - -- See https://github.com/neovim/nvim-lspconfig/issues/3189 - library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), { - '${3rd}/luv/library', - '${3rd}/busted/library', - }), - }, - }) end, - ---@type lspconfig.settings.lua_ls - settings = { - Lua = { - format = { enable = false }, -- Disable formatting (formatting is done by stylua) - }, + default_format_opts = { + lsp_format = 'fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely. }, - }, -} + -- You can also specify external formatters in here. + formatters_by_ft = { + -- rust = { 'rustfmt' }, + -- Conform can also run multiple formatters sequentially + -- python = { "isort", "black" }, + -- + -- You can use 'stop_after_first' to run the first available formatter from the list + -- javascript = { "prettierd", "prettier", stop_after_first = true }, + }, + } --- Automatically install LSPs and related tools to stdpath for Neovim -require('mason').setup {} - --- Ensure the servers and tools above are installed --- --- To check the current status of installed tools and/or manually install --- other tools, you can run --- :Mason --- --- You can press `g?` for help in this menu. -local ensure_installed = vim.tbl_keys(servers or {}) -vim.list_extend(ensure_installed, { - -- You can add other tools here that you want Mason to install -}) - -require('mason-tool-installer').setup { ensure_installed = ensure_installed } - -for name, server in pairs(servers) do - vim.lsp.config(name, server) - vim.lsp.enable(name) + vim.keymap.set({ 'n', 'v' }, 'f', function() require('conform').format { async = true } end, { desc = '[F]ormat buffer' }) end --- [[ Formatting ]] -require('conform').setup { - notify_on_error = false, - format_on_save = function(bufnr) - -- You can specify filetypes to autoformat on save here: - local enabled_filetypes = { - -- lua = true, - -- python = true, - } - if enabled_filetypes[vim.bo[bufnr].filetype] then - return { timeout_ms = 500 } - else - return nil - end - end, - default_format_opts = { - lsp_format = 'fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely. - }, - -- You can also specify external formatters in here. - formatters_by_ft = { - -- rust = { 'rustfmt' }, - -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, - }, -} +-- ============================================================ +-- SECTION 7: AUTOCOMPLETE & SNIPPETS +-- blink.cmp and luasnip setup +-- ============================================================ +do + -- [[ Snippet Engine ]] + require('luasnip').setup {} -vim.keymap.set({ 'n', 'v' }, 'f', function() require('conform').format { async = true } end, { desc = '[F]ormat buffer' }) - --- [[ Autocompletion Configuration ]] - --- Snippet Engine -require('luasnip').setup {} - --- `friendly-snippets` contains a variety of premade snippets. --- See the README about individual language/framework/plugin snippets: --- https://github.com/rafamadriz/friendly-snippets --- --- vim.pack.add { gh 'rafamadriz/friendly-snippets' } --- require('luasnip.loaders.from_vscode').lazy_load() - --- The autocomplete engine -require('blink.cmp').setup { - keymap = { - -- 'default' (recommended) for mappings similar to built-in completions - -- to accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - -- 'super-tab' for tab to accept - -- 'enter' for enter to accept - -- 'none' for no mappings - -- - -- For an understanding of why the 'default' preset is recommended, - -- you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - -- - -- All presets have the following mappings: - -- /: move to right/left of your snippet expansion - -- : Open menu or open docs if already open - -- / or /: Select next/previous item - -- : Hide menu - -- : Toggle signature help - -- - -- See `:help blink-cmp-config-keymap` for defining your own keymap - preset = 'default', - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, - - appearance = { - -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono', - }, - - completion = { - -- By default, you may press `` to show the documentation. - -- Optionally, set `auto_show = true` to show the documentation after a delay. - documentation = { auto_show = false, auto_show_delay_ms = 500 }, - }, - - sources = { - default = { 'lsp', 'path', 'snippets' }, - }, - - snippets = { preset = 'luasnip' }, - - -- Blink.cmp includes an optional, recommended rust fuzzy matcher, - -- which automatically downloads a prebuilt binary when enabled. + -- `friendly-snippets` contains a variety of premade snippets. + -- See the README about individual language/framework/plugin snippets: + -- https://github.com/rafamadriz/friendly-snippets -- - -- By default, we use the Lua implementation instead, but you may enable - -- the rust implementation via `'prefer_rust_with_warning'` - -- - -- See `:help blink-cmp-config-fuzzy` for more information - fuzzy = { implementation = 'lua' }, + -- vim.pack.add { gh 'rafamadriz/friendly-snippets' } + -- require('luasnip.loaders.from_vscode').lazy_load() - -- Shows a signature help window while you type arguments for a function - signature = { enabled = true }, -} + -- [[ Autocomplete Engine ]] + require('blink.cmp').setup { + keymap = { + -- 'default' (recommended) for mappings similar to built-in completions + -- to accept ([y]es) the completion. + -- This will auto-import if your LSP supports it. + -- This will expand snippets if the LSP sent a snippet. + -- 'super-tab' for tab to accept + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- For an understanding of why the 'default' preset is recommended, + -- you will need to read `:help ins-completion` + -- + -- No, but seriously. Please read `:help ins-completion`, it is really good! + -- + -- All presets have the following mappings: + -- /: move to right/left of your snippet expansion + -- : Open menu or open docs if already open + -- / or /: Select next/previous item + -- : Hide menu + -- : Toggle signature help + -- + -- See `:help blink-cmp-config-keymap` for defining your own keymap + preset = 'default', --- [[ Colorscheme ]] --- You can easily change to a different colorscheme. --- Change the name of the colorscheme plugin below, and then --- change the command under that to load whatever the name of that colorscheme is. --- --- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. ----@diagnostic disable-next-line: missing-fields -require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, -} + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + }, --- Load the colorscheme here. --- Like many other themes, this one has different styles, and you could load --- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. -vim.cmd.colorscheme 'tokyonight-night' + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = 'mono', + }, --- Highlight todo, notes, etc in comments -require('todo-comments').setup { signs = false } + completion = { + -- By default, you may press `` to show the documentation. + -- Optionally, set `auto_show = true` to show the documentation after a delay. + documentation = { auto_show = false, auto_show_delay_ms = 500 }, + }, --- [[ mini.nvim ]] --- A collection of various small independent plugins/modules + sources = { + default = { 'lsp', 'path', 'snippets' }, + }, --- Better Around/Inside textobjects --- --- Examples: --- - va) - [V]isually select [A]round [)]paren --- - yiiq - [Y]ank [I]nside [I]+1 [Q]uote --- - ci' - [C]hange [I]nside [']quote -require('mini.ai').setup { - -- NOTE: Avoid conflicts with the built-in incremental selection mappings on Neovim>=0.12 (see `:help treesitter-incremental-selection`) - mappings = { - around_next = 'aa', - inside_next = 'ii', - }, - n_lines = 500, -} + snippets = { preset = 'luasnip' }, --- Add/delete/replace surroundings (brackets, quotes, etc.) --- --- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren --- - sd' - [S]urround [D]elete [']quotes --- - sr)' - [S]urround [R]eplace [)] ['] -require('mini.surround').setup() + -- Blink.cmp includes an optional, recommended rust fuzzy matcher, + -- which automatically downloads a prebuilt binary when enabled. + -- + -- By default, we use the Lua implementation instead, but you may enable + -- the rust implementation via `'prefer_rust_with_warning'` + -- + -- See `:help blink-cmp-config-fuzzy` for more information + fuzzy = { implementation = 'lua' }, --- Simple and easy statusline. --- You could remove this setup call if you don't like it, --- and try some other statusline plugin -local statusline = require 'mini.statusline' --- Set `use_icons` to true if you have a Nerd Font -statusline.setup { use_icons = vim.g.have_nerd_font } - --- You can configure sections in the statusline by overriding their --- default behavior. For example, here we set the section for --- cursor location to LINE:COLUMN ----@diagnostic disable-next-line: duplicate-set-field -statusline.section_location = function() return '%2l:%-2v' end - --- ... and there is more! --- Check out: https://github.com/nvim-mini/mini.nvim - --- [[ Configure Treesitter ]] --- Used to highlight, edit, and navigate code --- --- See `:help nvim-treesitter-intro` - --- Ensure basic parsers are installed -local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } -require('nvim-treesitter').install(parsers) - ----@param buf integer ----@param language string -local function treesitter_try_attach(buf, language) - -- Check if a parser exists and load it - if not vim.treesitter.language.add(language) then return end - -- Enable syntax highlighting and other treesitter features - vim.treesitter.start(buf, language) - - -- Enable treesitter based folds - -- For more info on folds see `:help folds` - -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' - -- vim.wo.foldmethod = 'expr' - - -- Check if treesitter indentation is available for this language, and if so enable it - -- in case there is no indent query, the indentexpr will fallback to the vim's built in one - local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil - - -- Enable treesitter based indentation - if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end + -- Shows a signature help window while you type arguments for a function + signature = { enabled = true }, + } end -local available_parsers = require('nvim-treesitter').get_available() -vim.api.nvim_create_autocmd('FileType', { - callback = function(args) - local buf, filetype = args.buf, args.match +-- ============================================================ +-- SECTION 8: TREESITTER +-- Parser installation, syntax highlighting, folds, indentation +-- ============================================================ +do + -- [[ Configure Treesitter ]] + -- Used to highlight, edit, and navigate code + -- + -- See `:help nvim-treesitter-intro` - local language = vim.treesitter.language.get_lang(filetype) - if not language then return end + -- Ensure basic parsers are installed + local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } + require('nvim-treesitter').install(parsers) - local installed_parsers = require('nvim-treesitter').get_installed 'parsers' + ---@param buf integer + ---@param language string + local function treesitter_try_attach(buf, language) + -- Check if a parser exists and load it + if not vim.treesitter.language.add(language) then return end + -- Enable syntax highlighting and other treesitter features + vim.treesitter.start(buf, language) - if vim.tbl_contains(installed_parsers, language) then - -- Enable the parser if it is already installed - treesitter_try_attach(buf, language) - elseif vim.tbl_contains(available_parsers, language) then - -- If a parser is available in `nvim-treesitter`, auto-install it and enable it after the installation is done - require('nvim-treesitter').install(language):await(function() treesitter_try_attach(buf, language) end) - else - -- Try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` - treesitter_try_attach(buf, language) - end - end, -}) + -- Enable treesitter based folds + -- For more info on folds see `:help folds` + -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + -- vim.wo.foldmethod = 'expr' --- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the --- init.lua. If you want these files, they are in the repository, so you can just download them and --- place them in the correct locations. + -- Check if treesitter indentation is available for this language, and if so enable it + -- in case there is no indent query, the indentexpr will fallback to the vim's built in one + local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil --- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart --- --- Here are some example plugins that I've included in the Kickstart repository. --- Uncomment any of the lines below to enable them (you will need to restart nvim). --- --- require 'kickstart.plugins.debug' --- require 'kickstart.plugins.indent_line' --- require 'kickstart.plugins.lint' --- require 'kickstart.plugins.autopairs' --- require 'kickstart.plugins.neo-tree' --- require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps + -- Enable treesitter based indentation + if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end + end --- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` --- --- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. --- require 'custom.plugins' + local available_parsers = require('nvim-treesitter').get_available() + vim.api.nvim_create_autocmd('FileType', { + callback = function(args) + local buf, filetype = args.buf, args.match + + local language = vim.treesitter.language.get_lang(filetype) + if not language then return end + + local installed_parsers = require('nvim-treesitter').get_installed 'parsers' + + if vim.tbl_contains(installed_parsers, language) then + -- Enable the parser if it is already installed + treesitter_try_attach(buf, language) + elseif vim.tbl_contains(available_parsers, language) then + -- If a parser is available in `nvim-treesitter`, auto-install it and enable it after the installation is done + require('nvim-treesitter').install(language):await(function() treesitter_try_attach(buf, language) end) + else + -- Try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` + treesitter_try_attach(buf, language) + end + end, + }) +end + +-- ============================================================ +-- SECTION 9: OPTIONAL EXAMPLES / NEXT STEPS +-- kickstart.plugins.* examples +-- ============================================================ +do + -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the + -- init.lua. If you want these files, they are in the repository, so you can just download them and + -- place them in the correct locations. + + -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart + -- + -- Here are some example plugins that I've included in the Kickstart repository. + -- Uncomment any of the lines below to enable them (you will need to restart nvim). + -- + -- require 'kickstart.plugins.debug' + -- require 'kickstart.plugins.indent_line' + -- require 'kickstart.plugins.lint' + -- require 'kickstart.plugins.autopairs' + -- require 'kickstart.plugins.neo-tree' + -- require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps + + -- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- + -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. + -- require 'custom.plugins' +end -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 2fccee4349b166ffcdf282bd7a69cb9a36a70820 Mon Sep 17 00:00:00 2001 From: orip Date: Sat, 2 May 2026 23:46:47 +0300 Subject: [PATCH 133/140] Split the vim.pack.add call and move each part to the relevant sections --- init.lua | 117 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 73 insertions(+), 44 deletions(-) diff --git a/init.lua b/init.lua index 27bb5397..ec7ad44f 100644 --- a/init.lua +++ b/init.lua @@ -240,11 +240,14 @@ do end -- ============================================================ --- SECTION 2: PLUGIN MANAGER --- vim.pack, build hooks, install/update plugins, plugin specs +-- SECTION 2: PLUGIN MANAGER INTRO +-- vim.pack intro, build hooks -- ============================================================ do - -- [[ Install plugins with `vim.pack` ]] + -- [[ Intro to `vim.pack` ]] + -- `vim.pack` is a new plugin manager built into Neovim, + -- which provides a Lua interface for installing and managing plugins. + -- -- See `:help vim.pack`, `:help vim.pack-examples` or the -- excellent blog post from the creator of vim.pack and mini.nvim: -- https://echasnovski.com/blog/2026-03-13-a-guide-to-vim-pack @@ -254,6 +257,13 @@ do -- -- To update plugins, run -- :lua vim.pack.update() + -- + -- + -- Throughout the rest of the config there will be examples + -- of how to install and configure plugins using `vim.pack`. + -- + -- In this section we set up some autocommands to run build + -- steps for certain plugins after they are installed or updated. local function run_build(name, cmd, cwd) local result = vim.system(cmd, { cwd = cwd }):wait() @@ -293,60 +303,47 @@ do end end, }) - - local gh = function(repo) return 'https://github.com/' .. repo end - - ---@type (string|vim.pack.Spec)[] - local plugins = { - -- You can specify plugins with a git URL. `vim.pack` then uses the default branch (usually `main` or `master`) - gh 'NMAC427/guess-indent.nvim', - gh 'lewis6991/gitsigns.nvim', - gh 'folke/which-key.nvim', - gh 'nvim-lua/plenary.nvim', - gh 'nvim-telescope/telescope.nvim', - gh 'nvim-telescope/telescope-ui-select.nvim', - gh 'neovim/nvim-lspconfig', - gh 'mason-org/mason.nvim', - gh 'mason-org/mason-lspconfig.nvim', - gh 'WhoIsSethDaniel/mason-tool-installer.nvim', - gh 'j-hui/fidget.nvim', - gh 'stevearc/conform.nvim', - -- You can also specify plugins with a version range for semver git tags - -- See `:help vim.version.range()` for more info - { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' }, - { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' }, - gh 'folke/tokyonight.nvim', - gh 'folke/todo-comments.nvim', - gh 'nvim-mini/mini.nvim', - -- You can also specify a branch or a specific commit - { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' }, - } - - if vim.fn.executable 'make' == 1 then table.insert(plugins, gh 'nvim-telescope/telescope-fzf-native.nvim') end - - -- Useful for getting pretty icons, but requires a Nerd Font. - if vim.g.have_nerd_font then table.insert(plugins, gh 'nvim-tree/nvim-web-devicons') end - - -- NOTE: Here is where the plugins are actually installed and added to the path - vim.pack.add(plugins) end +---Because most plugins are hosted on GitHub, you can use the helper +---function to have less repetition in the following sections. +---@param repo string +---@return string +local function gh(repo) return 'https://github.com/' .. repo end + -- ============================================================ -- SECTION 3: UI / CORE UX PLUGINS -- guess-indent, gitsigns, which-key, colorscheme, todo-comments, mini modules -- ============================================================ do - -- [[ Configure plugins ]] - -- For most plugins you need to call their `.setup()` to start them + -- [[ Installing and Configuring Plugins ]] -- - -- For example, here is the simplest possible setup for `guess-indent.nvim`, - -- which will automatically detect and set your indentation settings based on the current file. + -- To install a plugin simply call `vim.pack.add` with its git url. + -- This will download the default branch of the plugin, which will usually be `main` or `master` + -- You can also have more advanced specs, which we will talk about later. + -- + -- For most plugins its not enough to install them, you also need to call their `.setup()` to start them. + -- + -- For example, lets say we want to install `guess-indent.nvim` - a plugin for + -- automatically detecting and setting the indentation. + -- + -- We first install it from https://github.com/NMAC427/guess-indent.nvim + -- and then call its `setup()` function to start it with default settings. + vim.pack.add { gh 'NMAC427/guess-indent.nvim' } require('guess-indent').setup {} - -- Here is a more advanced example that passes configuration options to `gitsigns.nvim` + -- Because lua is a real programming language, you can also have some logic to your installation - + -- like only installing a plugin if a condition is met. + -- + -- Here we only install `nvim-web-devicons` (which adds pretty icons) if we have a Nerd Font, + -- since otherwise the icons won't display properly. + if vim.g.have_nerd_font then vim.pack.add { gh 'nvim-tree/nvim-web-devicons' } end + + -- Here is a more advanced configuration example that passes options to `gitsigns.nvim` -- -- See `:help gitsigns` to understand what each configuration key does. -- Adds git related signs to the gutter, as well as utilities for managing changes + vim.pack.add { gh 'lewis6991/gitsigns.nvim' } require('gitsigns').setup { signs = { add = { text = '+' }, ---@diagnostic disable-line: missing-fields @@ -358,6 +355,7 @@ do } -- Useful plugin to show you pending keybinds. + vim.pack.add { gh 'folke/which-key.nvim' } require('which-key').setup { -- Delay between pressing a key and opening which-key (milliseconds) delay = 0, @@ -377,6 +375,7 @@ do -- change the command under that to load whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. + vim.pack.add { gh 'folke/tokyonight.nvim' } ---@diagnostic disable-next-line: missing-fields require('tokyonight').setup { styles = { @@ -390,10 +389,12 @@ do vim.cmd.colorscheme 'tokyonight-night' -- Highlight todo, notes, etc in comments + vim.pack.add { gh 'folke/todo-comments.nvim' } require('todo-comments').setup { signs = false } -- [[ mini.nvim ]] -- A collection of various small independent plugins/modules + vim.pack.add { gh 'nvim-mini/mini.nvim' } -- Better Around/Inside textobjects -- @@ -463,6 +464,17 @@ do -- Telescope picker. This is really useful to discover what Telescope can -- do as well as how to actually do it! + ---@type (string|vim.pack.Spec)[] + local telescope_plugins = { + gh 'nvim-lua/plenary.nvim', + gh 'nvim-telescope/telescope.nvim', + gh 'nvim-telescope/telescope-ui-select.nvim', + } + if vim.fn.executable 'make' == 1 then table.insert(telescope_plugins, gh 'nvim-telescope/telescope-fzf-native.nvim') end + + -- NOTE: You can install multiple plugins at once + vim.pack.add(telescope_plugins) + -- See `:help telescope` and `:help telescope.setup()` require('telescope').setup { -- You can put your default mappings / updates / etc. in here @@ -590,6 +602,7 @@ do -- and elegantly composed help section, `:help lsp-vs-treesitter` -- Useful status updates for LSP. + vim.pack.add { gh 'j-hui/fidget.nvim' } require('fidget').setup {} -- This function gets run when an LSP attaches to a particular buffer. @@ -713,6 +726,13 @@ do }, } + vim.pack.add { + gh 'neovim/nvim-lspconfig', + gh 'mason-org/mason.nvim', + gh 'mason-org/mason-lspconfig.nvim', + gh 'WhoIsSethDaniel/mason-tool-installer.nvim', + } + -- Automatically install LSPs and related tools to stdpath for Neovim require('mason').setup {} @@ -742,6 +762,7 @@ end -- ============================================================ do -- [[ Formatting ]] + vim.pack.add { gh 'stevearc/conform.nvim' } require('conform').setup { notify_on_error = false, format_on_save = function(bufnr) @@ -779,6 +800,10 @@ end -- ============================================================ do -- [[ Snippet Engine ]] + + -- NOTE: You can also specify plugin using a version range for its git tag. + -- See `:help vim.version.range()` for more info + vim.pack.add { { src = gh 'L3MON4D3/LuaSnip', version = vim.version.range '2.*' } } require('luasnip').setup {} -- `friendly-snippets` contains a variety of premade snippets. @@ -789,6 +814,7 @@ do -- require('luasnip.loaders.from_vscode').lazy_load() -- [[ Autocomplete Engine ]] + vim.pack.add { { src = gh 'saghen/blink.cmp', version = vim.version.range '1.*' } } require('blink.cmp').setup { keymap = { -- 'default' (recommended) for mappings similar to built-in completions @@ -860,6 +886,9 @@ do -- -- See `:help nvim-treesitter-intro` + -- NOTE: You can also specify a branch or a specific commit + vim.pack.add { { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' } } + -- Ensure basic parsers are installed local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } require('nvim-treesitter').install(parsers) From a5d4d12c8cd4973b8a4602f1795518fa1d270071 Mon Sep 17 00:00:00 2001 From: Nathan Zeng Date: Sun, 5 Apr 2026 22:30:06 -0700 Subject: [PATCH 134/140] fix: deprecated diagnostic jumping config --- init.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ec7ad44f..5d29c72d 100644 --- a/init.lua +++ b/init.lua @@ -192,7 +192,15 @@ do virtual_lines = false, -- Text shows up underneath the line, with virtual lines -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` - jump = { float = true }, + jump = { + on_jump = function(_, bufnr) + vim.diagnostic.open_float { + bufnr = bufnr, + scope = 'cursor', + focus = false, + } + end, + }, } vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) From 97b3cbb7904950cecd0e5c0e9f3fe2abcf298509 Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Thu, 28 May 2026 01:45:20 +0100 Subject: [PATCH 135/140] chore: add discussions to issue template Now that GitHub discussions have been enabled (see https://github.com/nvim-lua/kickstart.nvim/issues/2026), add links in the issue template to help redirect help/feature requests from the bug tracker. --- .github/ISSUE_TEMPLATE/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..2bf7fff8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,10 @@ +blank_issues_enabled: false + +contact_links: + - name: Help + url: https://github.com/nvim-lua/kickstart.nvim/discussions/categories/q-a + about: Ask the community for help + + - name: Ideas + url: https://github.com/nvim-lua/kickstart.nvim/discussions/categories/ideas + about: Share ideas for new features From 7031a09bf9790ad25ee6f04a3d571431f8e33bba Mon Sep 17 00:00:00 2001 From: orip Date: Thu, 11 Jun 2026 16:44:01 +0300 Subject: [PATCH 136/140] Split the `foundation` section into `options` and `keymaps` --- init.lua | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 5d29c72d..764d58c2 100644 --- a/init.lua +++ b/init.lua @@ -85,7 +85,7 @@ P.S. You can delete this when you're done too. It's your config now! :) --]] -- ============================================================ --- SECTION 1: FOUNDATION +-- SECTION 1: OPTIONS -- Core Neovim settings, leaders, options, basic keymaps, basic autocmds -- ============================================================ do @@ -171,7 +171,13 @@ do -- instead raise a dialog asking if you wish to save the current file(s) -- See `:help 'confirm'` vim.o.confirm = true +end +-- ============================================================ +-- SECTION 2: KEYMAPS +-- basic keymaps +-- ============================================================ +do -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -248,7 +254,7 @@ do end -- ============================================================ --- SECTION 2: PLUGIN MANAGER INTRO +-- SECTION 3: PLUGIN MANAGER INTRO -- vim.pack intro, build hooks -- ============================================================ do @@ -320,7 +326,7 @@ end local function gh(repo) return 'https://github.com/' .. repo end -- ============================================================ --- SECTION 3: UI / CORE UX PLUGINS +-- SECTION 4: UI / CORE UX PLUGINS -- guess-indent, gitsigns, which-key, colorscheme, todo-comments, mini modules -- ============================================================ do @@ -444,7 +450,7 @@ do end -- ============================================================ --- SECTION 4: SEARCH & NAVIGATION +-- SECTION 5: SEARCH & NAVIGATION -- Telescope setup, keymaps, LSP picker mappings -- ============================================================ do @@ -579,7 +585,7 @@ do end -- ============================================================ --- SECTION 5: LSP +-- SECTION 6: LSP -- LSP keymaps, server configuration, Mason tools installations -- ============================================================ do @@ -765,7 +771,7 @@ do end -- ============================================================ --- SECTION 6: FORMATTING +-- SECTION 7: FORMATTING -- conform.nvim setup and keymap -- ============================================================ do @@ -803,7 +809,7 @@ do end -- ============================================================ --- SECTION 7: AUTOCOMPLETE & SNIPPETS +-- SECTION 8: AUTOCOMPLETE & SNIPPETS -- blink.cmp and luasnip setup -- ============================================================ do @@ -885,7 +891,7 @@ do end -- ============================================================ --- SECTION 8: TREESITTER +-- SECTION 9: TREESITTER -- Parser installation, syntax highlighting, folds, indentation -- ============================================================ do @@ -947,7 +953,7 @@ do end -- ============================================================ --- SECTION 9: OPTIONAL EXAMPLES / NEXT STEPS +-- SECTION 10: OPTIONAL EXAMPLES / NEXT STEPS -- kickstart.plugins.* examples -- ============================================================ do From f660e1f897d39e7471381f5c889618c7d27be4fe Mon Sep 17 00:00:00 2001 From: orip Date: Thu, 11 Jun 2026 16:44:01 +0300 Subject: [PATCH 137/140] Follow symlinks for the neovim config picker Closes: #2078 --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 764d58c2..7b47ff8c 100644 --- a/init.lua +++ b/init.lua @@ -581,7 +581,7 @@ do ) -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) + vim.keymap.set('n', 'sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config', follow = true } end, { desc = '[S]earch [N]eovim files' }) end -- ============================================================ From ec3f4489c29b95cc4a15f0f1ae90ae54a675289b Mon Sep 17 00:00:00 2001 From: orip Date: Wed, 22 Apr 2026 20:27:51 +0300 Subject: [PATCH 138/140] Switch from nvim-web-devicons to mini.icons --- init.lua | 14 +++++++------- lua/kickstart/plugins/neo-tree.lua | 8 +------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/init.lua b/init.lua index 7b47ff8c..aff5250e 100644 --- a/init.lua +++ b/init.lua @@ -346,13 +346,6 @@ do vim.pack.add { gh 'NMAC427/guess-indent.nvim' } require('guess-indent').setup {} - -- Because lua is a real programming language, you can also have some logic to your installation - - -- like only installing a plugin if a condition is met. - -- - -- Here we only install `nvim-web-devicons` (which adds pretty icons) if we have a Nerd Font, - -- since otherwise the icons won't display properly. - if vim.g.have_nerd_font then vim.pack.add { gh 'nvim-tree/nvim-web-devicons' } end - -- Here is a more advanced configuration example that passes options to `gitsigns.nvim` -- -- See `:help gitsigns` to understand what each configuration key does. @@ -410,6 +403,13 @@ do -- A collection of various small independent plugins/modules vim.pack.add { gh 'nvim-mini/mini.nvim' } + -- If a nerd font is available, load the icons module for pretty icons in various plugins. + if vim.g.have_nerd_font then + require('mini.icons').setup() + -- Used for backwards compatibility with plugins that require `nvim-web-devicons` (e.g. telescope.nvim) + MiniIcons.mock_nvim_web_devicons() + end + -- Better Around/Inside textobjects -- -- Examples: diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index d9d69931..549629ae 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -1,18 +1,12 @@ -- Neo-tree is a Neovim plugin to browse the file system -- https://github.com/nvim-neo-tree/neo-tree.nvim -local plugins = { +vim.pack.add { { src = 'https://github.com/nvim-neo-tree/neo-tree.nvim', version = vim.version.range '*' }, 'https://github.com/nvim-lua/plenary.nvim', 'https://github.com/MunifTanjim/nui.nvim', } -if vim.g.have_nerd_font then - table.insert(plugins, 'https://github.com/nvim-tree/nvim-web-devicons') -- not strictly required, but recommended -end - -vim.pack.add(plugins) - vim.keymap.set('n', '\\', 'Neotree reveal', { desc = 'NeoTree reveal', silent = true }) require('neo-tree').setup { From ac51593f7afbead01447441d0aa30fb363c35bc5 Mon Sep 17 00:00:00 2001 From: orip Date: Thu, 11 Jun 2026 17:52:24 +0300 Subject: [PATCH 139/140] Add checkhealth to bug report step --- .github/ISSUE_TEMPLATE/bug_report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 86598b8d..b061e410 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,9 +10,11 @@ assignees: '' ## Before Reporting an Issue + - I have read the kickstart.nvim README.md. - I have read the appropriate plugin's documentation. - I have searched that this issue has not been reported before. +- I have ran `:checkhealth` and so no obvious issue. - [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.** From f0a2108ed51547793c758d9318bad94f242b22e5 Mon Sep 17 00:00:00 2001 From: orip Date: Thu, 11 Jun 2026 18:55:49 +0300 Subject: [PATCH 140/140] Follow symlinks in the custom plugins loader fixes: #2087 --- lua/custom/plugins/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index c05db465..01e91722 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -5,8 +5,8 @@ -- Iterate over all Lua files in the plugins directory and load them local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins') -for file_name, type in vim.fs.dir(plugins_dir) do - if type == 'file' and file_name:match '%.lua$' and file_name ~= 'init.lua' then +for file_name, type in vim.fs.dir(plugins_dir, { follow = true }) do + if (type == 'file' or type == 'link') and file_name:match '%.lua$' and file_name ~= 'init.lua' then local module = file_name:gsub('%.lua$', '') require('custom.plugins.' .. module) end