From a26816c4223401ef94410fe7c34e6310d8c5a5dc Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 17 Jul 2025 10:26:38 -0400 Subject: [PATCH 01/52] sync --- init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index b98ffc6198a..59138226a2d 100644 --- a/init.lua +++ b/init.lua @@ -671,17 +671,17 @@ require('lazy').setup({ -- - 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/ local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, + 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 -- -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, + ts_ls = {}, -- lua_ls = { From e1aee4bb951e063890cee6f03447cc029fdd2b78 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 24 Jul 2025 12:33:19 -0400 Subject: [PATCH 02/52] things --- init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.lua b/init.lua index 59138226a2d..0ab86bc19bf 100644 --- a/init.lua +++ b/init.lua @@ -437,6 +437,14 @@ require('lazy').setup({ vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 'g', builtin.git_bcommits, { desc = '[Git]' }) + vim.keymap.set('n', 'gb', builtin.git_bcommits, { desc = '[Git] Buffer Commits' }) + vim.keymap.set('n', 'gr', builtin.git_bcommits_range, { desc = '[Git] Buffer Commits Range' }) + vim.keymap.set('n', 'gc', builtin.git_commits, { desc = '[Git] Commits' }) + vim.keymap.set('n', 'gf', builtin.git_files, { desc = '[Git] Files' }) + vim.keymap.set('n', 'gt', builtin.git_stash, { desc = '[Git] Stash' }) + vim.keymap.set('n', 'gs', builtin.git_status, { desc = '[Git] Status' }) + -- 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. From 9bae26dd5a743378aaf8418d21aca6130e72a082 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 24 Jul 2025 12:52:44 -0400 Subject: [PATCH 03/52] init lua --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 0ab86bc19bf..6f40edf7694 100644 --- a/init.lua +++ b/init.lua @@ -437,9 +437,10 @@ require('lazy').setup({ vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - vim.keymap.set('n', 'g', builtin.git_bcommits, { desc = '[Git]' }) - vim.keymap.set('n', 'gb', builtin.git_bcommits, { desc = '[Git] Buffer Commits' }) + vim.keymap.set('n', 'g', '', { desc = '[Git]' }) + vim.keymap.set('n', 'gl', builtin.git_bcommits, { desc = '[Git] Buffer Commits' }) vim.keymap.set('n', 'gr', builtin.git_bcommits_range, { desc = '[Git] Buffer Commits Range' }) + vim.keymap.set('n', 'gb', builtin.git_branches, { desc = '[Git] Branches' }) vim.keymap.set('n', 'gc', builtin.git_commits, { desc = '[Git] Commits' }) vim.keymap.set('n', 'gf', builtin.git_files, { desc = '[Git] Files' }) vim.keymap.set('n', 'gt', builtin.git_stash, { desc = '[Git] Stash' }) From 868feb4383b1c2fadd9caaaf3336991ca8e0ceb7 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 24 Jul 2025 13:08:32 -0400 Subject: [PATCH 04/52] gd --- init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.lua b/init.lua index 6f40edf7694..6817a0015ad 100644 --- a/init.lua +++ b/init.lua @@ -445,6 +445,11 @@ require('lazy').setup({ vim.keymap.set('n', 'gf', builtin.git_files, { desc = '[Git] Files' }) vim.keymap.set('n', 'gt', builtin.git_stash, { desc = '[Git] Stash' }) vim.keymap.set('n', 'gs', builtin.git_status, { desc = '[Git] Status' }) + vim.keymap.set('n', 'gm', function() + builtin.git_commits { + git_command = { 'git', 'log', '--oneline', '--decorate', 'main..HEAD' }, + } + end, { desc = '[Git] Commits ahead of main' }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() From e214fab6680fa2786b3081b1f28d1d3e37a10768 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 1 Aug 2025 15:08:03 -0400 Subject: [PATCH 05/52] add nvim-tree --- init.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 6817a0015ad..6ec61abc7f9 100644 --- a/init.lua +++ b/init.lua @@ -205,6 +205,18 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +-- Open terminal in horizontal split +vim.keymap.set('n', 'th', ':split | terminal', { desc = 'Terminal horizontal split' }) + +-- Open terminal in vertical split +vim.keymap.set('n', 'tv', ':vsplit | terminal', { desc = 'Terminal vertical split' }) + +-- Open terminal in new tab +vim.keymap.set('n', 'tt', ':tabnew | terminal', { desc = 'Terminal in new tab' }) + +-- Toggle terminal (requires a plugin like toggleterm.nvim) +vim.keymap.set('n', 'tf', ':ToggleTerm', { desc = 'Toggle floating terminal' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -475,7 +487,14 @@ require('lazy').setup({ end, { desc = '[S]earch [N]eovim files' }) end, }, - + { + 'nvim-tree/nvim-tree.lua', + dependencies = 'nvim-tree/nvim-web-devicons', + config = function() + require('nvim-tree').setup() + vim.keymap.set('n', 'x', ':NvimTreeToggle', { noremap = true, silent = true }) + end, + }, -- LSP Plugins { -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins From e224bba226dcbef16ca90de0f0a04bc260f0f7ac Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 4 Aug 2025 11:35:21 -0400 Subject: [PATCH 06/52] thangs --- init.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 6ec61abc7f9..9c5c6601ede 100644 --- a/init.lua +++ b/init.lua @@ -487,14 +487,6 @@ require('lazy').setup({ end, { desc = '[S]earch [N]eovim files' }) end, }, - { - 'nvim-tree/nvim-tree.lua', - dependencies = 'nvim-tree/nvim-web-devicons', - config = function() - require('nvim-tree').setup() - vim.keymap.set('n', 'x', ':NvimTreeToggle', { noremap = true, silent = true }) - end, - }, -- LSP Plugins { -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins @@ -1010,7 +1002,8 @@ require('lazy').setup({ -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.neo-tree', + vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'Toggle NeoTree' }), -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` From 81f2e7c7fdb6e9d707245fd2f6b784cc26aa6e08 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 4 Aug 2025 11:45:50 -0400 Subject: [PATCH 07/52] gitsigns --- init.lua | 59 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 9c5c6601ede..108166850e3 100644 --- a/init.lua +++ b/init.lua @@ -286,13 +286,56 @@ require('lazy').setup({ { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, + 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' }) + + 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, }, }, @@ -1004,7 +1047,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'Toggle NeoTree' }), - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend 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 47be0540ecdd95a1c3d943ba973443b45896fdd2 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 4 Aug 2025 22:49:05 -0400 Subject: [PATCH 08/52] thing --- init.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 108166850e3..696c5a0bc5e 100644 --- a/init.lua +++ b/init.lua @@ -338,7 +338,16 @@ require('lazy').setup({ end, }, }, - + { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'MunifTanjim/nui.nvim', + 'nvim-tree/nvim-web-devicons', + }, + lazy = false, + }, -- 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 @@ -751,7 +760,6 @@ require('lazy').setup({ -- But for many setups, the LSP (`ts_ls`) will work just fine ts_ls = {}, -- - lua_ls = { -- cmd = { ... }, -- filetypes = { ... }, @@ -1041,12 +1049,12 @@ require('lazy').setup({ -- 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.debug', -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', + require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', - vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'Toggle NeoTree' }), + vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'Toggle NeoTree' }), require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` From 2bddc423c74f9a128bbc08060479b19ed0c9df0d Mon Sep 17 00:00:00 2001 From: jordanyono Date: Tue, 12 Aug 2025 19:45:04 -0400 Subject: [PATCH 09/52] neotree --- init.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 696c5a0bc5e..5748edd4f84 100644 --- a/init.lua +++ b/init.lua @@ -347,6 +347,17 @@ require('lazy').setup({ 'nvim-tree/nvim-web-devicons', }, lazy = false, + opts = { + filesystem = { + visible = true, + window = { + mappings = { + ['.'] = 'set_root', -- Set current directory as root + ['H'] = 'toggle_hidden', -- Toggle hidden files with 'H' + }, + }, + }, + }, }, -- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- @@ -951,7 +962,6 @@ require('lazy').setup({ 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. From ce74176b293cdeda500e420ed9665a3ed9729def Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 18 Aug 2025 17:14:00 -0400 Subject: [PATCH 10/52] lock and load --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 5748edd4f84..b7d71d2f163 100644 --- a/init.lua +++ b/init.lua @@ -349,7 +349,7 @@ require('lazy').setup({ lazy = false, opts = { filesystem = { - visible = true, + visible = false, window = { mappings = { ['.'] = 'set_root', -- Set current directory as root @@ -922,7 +922,7 @@ require('lazy').setup({ -- : Toggle signature help -- -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', + preset = 'super-tab', -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps From 2f469766cc5c34b63039f657d79d3ac25f91ab09 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Tue, 2 Sep 2025 16:36:56 -0400 Subject: [PATCH 11/52] update --- init.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index b7d71d2f163..855d9c6b57d 100644 --- a/init.lua +++ b/init.lua @@ -110,14 +110,6 @@ vim.o.mouse = 'a' -- 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) - -- Enable break indent vim.o.breakindent = true @@ -217,6 +209,10 @@ vim.keymap.set('n', 'tt', ':tabnew | terminal', { desc = 'Terminal i -- Toggle terminal (requires a plugin like toggleterm.nvim) vim.keymap.set('n', 'tf', ':ToggleTerm', { desc = 'Toggle floating terminal' }) +-- relative line number +vim.opt.number = true +vim.opt.relativenumber = true + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` From 903b0c8b22ce040a372943de5b5d3c2a36862c1c Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 12 Sep 2025 06:43:28 -0400 Subject: [PATCH 12/52] blame --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 855d9c6b57d..17bc55476e3 100644 --- a/init.lua +++ b/init.lua @@ -324,6 +324,7 @@ require('lazy').setup({ 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', 'Hb', gitsigns.blame_line, { desc = 'git [B]lame toggle' }) map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', 'hD', function() gitsigns.diffthis '@' From 37a2b56005731a56bda96de5e297420bd512c2f6 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 12 Sep 2025 06:45:15 -0400 Subject: [PATCH 13/52] blame --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 17bc55476e3..68743512147 100644 --- a/init.lua +++ b/init.lua @@ -324,7 +324,7 @@ require('lazy').setup({ 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', 'Hb', gitsigns.blame_line, { desc = 'git [B]lame toggle' }) + map('n', 'Hb', gitsigns.blame, { desc = 'git [B]lame toggle' }) map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', 'hD', function() gitsigns.diffthis '@' From cd9f5a7eb11bb21807638e14b1829753bb2386bb Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 12 Sep 2025 06:46:29 -0400 Subject: [PATCH 14/52] blame --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 68743512147..9330662cce8 100644 --- a/init.lua +++ b/init.lua @@ -324,7 +324,7 @@ require('lazy').setup({ 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', 'Hb', gitsigns.blame, { desc = 'git [B]lame toggle' }) + map('n', 'hB', gitsigns.blame, { desc = 'git [B]lame toggle' }) map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', 'hD', function() gitsigns.diffthis '@' From 3fb64a9be185cdc4b58fbc896d8c9eba5af4d6dd Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 19 Sep 2025 15:18:43 -0400 Subject: [PATCH 15/52] paste no yank --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index 9330662cce8..b0008ac6e6f 100644 --- a/init.lua +++ b/init.lua @@ -213,6 +213,10 @@ vim.keymap.set('n', 'tf', ':ToggleTerm', { desc = 'Toggle floating t vim.opt.number = true vim.opt.relativenumber = true +-- paste does not yank in visual mode +-- Make Visual mode paste not clobber the default register +vim.keymap.set('x', 'p', '"_dP', { noremap = true, silent = true }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` From 99decc9168086d595a06dbef46df39cbf88fd96c Mon Sep 17 00:00:00 2001 From: jordanyono Date: Wed, 8 Oct 2025 10:33:17 -0400 Subject: [PATCH 16/52] add --- lua/kickstart/plugins/neo-tree.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c7067891df0..2d028336136 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -16,6 +16,7 @@ return { opts = { filesystem = { window = { + use_libuv_file_watcher = true, mappings = { ['\\'] = 'close_window', }, From 427af219d87c0126ad4cbdcd0989deaff84dfbe5 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Wed, 8 Oct 2025 10:46:59 -0400 Subject: [PATCH 17/52] add --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index b0008ac6e6f..3a2f8ba9d5c 100644 --- a/init.lua +++ b/init.lua @@ -1061,9 +1061,9 @@ require('lazy').setup({ -- 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.indent_line', require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'Toggle NeoTree' }), require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps From 5f7f4fae240397db14d4a7ba504d0bd6d9a09633 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Wed, 8 Oct 2025 11:00:42 -0400 Subject: [PATCH 18/52] add gopls --- init.lua | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 3a2f8ba9d5c..981b3acaf64 100644 --- a/init.lua +++ b/init.lua @@ -761,7 +761,59 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { clangd = {}, - gopls = {}, + gopls = { + settings = { + gopls = { + -- Completion settings + completeUnimported = true, -- Suggest symbols from packages that are not yet imported + usePlaceholders = true, -- Insert argument placeholders for functions + deepCompletion = true, -- Include deep completions (e.g., struct fields) + matcher = 'Fuzzy', -- Matching algorithm for completions + linksInHover = true, -- Show documentation links in hover popups + + -- Static analysis and diagnostics + staticcheck = true, -- Enable additional static analysis checks + analyses = { + unusedparams = true, -- Detect unused function parameters + nilness = true, -- Detect nil pointer errors + unusedwrite = true, -- Detect assignments that are never read + shadow = true, -- Detect variable shadowing + }, + + -- Code lenses + codelenses = { + generate = true, -- Enable 'go generate' code lens + gc_details = true, -- Show memory details on functions + tidy = true, -- Enable 'go mod tidy' lens + test = true, -- Enable run/test lenses + }, + + -- Hover and signature help + hoverKind = 'FullDocumentation', -- Show full documentation in hover + usePlaceholders = true, -- Insert placeholders for function arguments + + -- Import management + gofumpt = true, -- Use `gofumpt` formatting style + completeUnimported = true, -- Suggest symbols from unimported packages + directoryFilters = { '-vendor' }, -- Exclude vendor directories from analysis + }, + }, + + -- Auto organize imports on save + on_attach = function(client, bufnr) + if client.name == 'gopls' then + vim.api.nvim_create_autocmd('BufWritePre', { + buffer = bufnr, + callback = function() + vim.lsp.buf.code_action { + context = { only = { 'source.organizeImports' } }, + apply = true, + } + end, + }) + end + end, + }, pyright = {}, rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs From c81ec8776f4fea6289af619dabbbdda9c7e488ec Mon Sep 17 00:00:00 2001 From: jordanyono Date: Wed, 8 Oct 2025 11:11:29 -0400 Subject: [PATCH 19/52] trhing --- init.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 981b3acaf64..56bb89b5a39 100644 --- a/init.lua +++ b/init.lua @@ -790,11 +790,9 @@ require('lazy').setup({ -- Hover and signature help hoverKind = 'FullDocumentation', -- Show full documentation in hover - usePlaceholders = true, -- Insert placeholders for function arguments -- Import management gofumpt = true, -- Use `gofumpt` formatting style - completeUnimported = true, -- Suggest symbols from unimported packages directoryFilters = { '-vendor' }, -- Exclude vendor directories from analysis }, }, @@ -806,7 +804,7 @@ require('lazy').setup({ buffer = bufnr, callback = function() vim.lsp.buf.code_action { - context = { only = { 'source.organizeImports' } }, + context = { diagnostics = {}, only = { 'source.organizeImports' } }, apply = true, } end, From a1f1968cb3bb67f08de191d7ad473942e95f71db Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 9 Oct 2025 14:33:19 -0400 Subject: [PATCH 20/52] ts configgy --- init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 56bb89b5a39..225a09fe534 100644 --- a/init.lua +++ b/init.lua @@ -820,7 +820,12 @@ require('lazy').setup({ -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`ts_ls`) will work just fine - ts_ls = {}, + ts_ls = { + settings = {}, + on_attach = function(client) + client.server_capabilities.documentFormattingProvider = false + end, + }, -- lua_ls = { -- cmd = { ... }, From 70d8b82df24ec76b40ba64509a0178048a802b5e Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 13 Oct 2025 13:54:00 -0400 Subject: [PATCH 21/52] more treesitting --- init.lua | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 225a09fe534..387b55662f0 100644 --- a/init.lua +++ b/init.lua @@ -1086,7 +1086,31 @@ require('lazy').setup({ 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' }, + ensure_installed = { + 'bash', + 'c', + 'diff', + 'html', + 'lua', + 'luadoc', + 'markdown', + 'markdown_inline', + 'query', + 'vim', + 'vimdoc', + 'go', + 'rust', + 'python', + 'json', + 'toml', + 'htlm', + 'css', + 'helm', + 'dockerfile', + 'bash', + 'yaml', + 'sql', + }, -- Autoinstall languages that are not installed auto_install = true, highlight = { From d2edadcbe145e94b923e402b2caacde1d0d19ba1 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 13 Oct 2025 14:04:51 -0400 Subject: [PATCH 22/52] fix --- init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/init.lua b/init.lua index 387b55662f0..6edfcb3c358 100644 --- a/init.lua +++ b/init.lua @@ -1103,7 +1103,6 @@ require('lazy').setup({ 'python', 'json', 'toml', - 'htlm', 'css', 'helm', 'dockerfile', From b44766ba67337aff75ca067ff58ff0b4619749ad Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 16 Oct 2025 22:35:33 -0400 Subject: [PATCH 23/52] yayaya --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 6edfcb3c358..33210d8ad57 100644 --- a/init.lua +++ b/init.lua @@ -824,6 +824,7 @@ require('lazy').setup({ settings = {}, on_attach = function(client) client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false end, }, -- From c577052c67ef43186943c151108e2ebaf609298f Mon Sep 17 00:00:00 2001 From: Jordan Yono Date: Mon, 20 Oct 2025 06:24:52 -0400 Subject: [PATCH 24/52] nerd font --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 33210d8ad57..c92350377f3 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ 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 +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` From 1c6512d2277411971c0294027ca73ab5cd0fd89d Mon Sep 17 00:00:00 2001 From: jordanyono Date: Tue, 21 Oct 2025 11:22:08 -0400 Subject: [PATCH 25/52] no write --- init.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 33210d8ad57..44011ed07e1 100644 --- a/init.lua +++ b/init.lua @@ -825,6 +825,15 @@ require('lazy').setup({ on_attach = function(client) client.server_capabilities.documentFormattingProvider = false client.server_capabilities.documentRangeFormattingProvider = false + + -- Disable format on save for this buffer + vim.api.nvim_buf_set_option(bufnr, 'formatoptions', '') + vim.api.nvim_create_autocmd('BufWritePre', { + buffer = bufnr, + callback = function() + -- Do nothing, preventing format on save + end, + }) end, }, -- @@ -900,7 +909,15 @@ require('lazy').setup({ -- 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 } + local disable_filetypes = { + c = true, + cpp = true, + typescript = true, + typescriptreact = true, + javascript = true, + javascriptreact = true, + python = true, + } if disable_filetypes[vim.bo[bufnr].filetype] then return nil else From 6bd14e253713aba9aad85af3370460a47e023421 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 27 Oct 2025 23:28:56 -0400 Subject: [PATCH 26/52] updates --- init.lua | 21 ------------------ lua/custom/plugins/init.lua | 39 ++++++++++++++++++++++++++++++++- lua/kickstart/plugins/debug.lua | 20 ++++++++--------- 3 files changed, 48 insertions(+), 32 deletions(-) diff --git a/init.lua b/init.lua index efebc4f6c02..9f2870e4310 100644 --- a/init.lua +++ b/init.lua @@ -339,27 +339,6 @@ require('lazy').setup({ end, }, }, - { - 'nvim-neo-tree/neo-tree.nvim', - version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - 'MunifTanjim/nui.nvim', - 'nvim-tree/nvim-web-devicons', - }, - lazy = false, - opts = { - filesystem = { - visible = false, - window = { - mappings = { - ['.'] = 'set_root', -- Set current directory as root - ['H'] = 'toggle_hidden', -- Toggle hidden files with 'H' - }, - }, - }, - }, - }, -- 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 diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..ff38bf7735f 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,41 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { + 'mistweaverco/kulala.nvim', + keys = { + { 'Rs', desc = 'Send request' }, + { 'Ra', desc = 'Send all requests' }, + { 'Rb', desc = 'Open scratchpad' }, + }, + ft = { 'http', 'rest' }, + opts = { + -- your configuration comes here + global_keymaps = false, + global_keymaps_prefix = 'R', + kulala_keymaps_prefix = '', + }, + }, + { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'MunifTanjim/nui.nvim', + 'nvim-tree/nvim-web-devicons', + }, + lazy = false, + opts = { + filesystem = { + visible = false, + window = { + mappings = { + ['.'] = 'set_root', -- Set current directory as root + ['H'] = 'toggle_hidden', -- Toggle hidden files with 'H' + }, + }, + }, + }, + }, +} diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 8e332bf2ff9..8ca03a0e074 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -121,16 +121,16 @@ 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 + 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 From f3cadfaf0bc4c07163816dc57821fcfa3096b260 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 27 Oct 2025 23:59:54 -0400 Subject: [PATCH 27/52] woo --- init.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/init.lua b/init.lua index 9f2870e4310..deee96dca71 100644 --- a/init.lua +++ b/init.lua @@ -258,6 +258,49 @@ rtp:prepend(lazypath) -- -- NOTE: Here is where you install your plugins. require('lazy').setup({ + -- your other plugins + { + -- TODO Set to use ccurl + -- Official installation from mistweaverco/kulala.nvim + 'mistweaverco/kulala.nvim', + ft = { 'http', 'rest' }, -- Supports both .http and .rest files + + opts = { + -- By default global keymaps are disabled + -- Set to true to enable all built-in keymaps + global_keymaps = false, + }, + keys = { + -- Request execution + { 'kr', 'lua require("kulala").run()', desc = 'Kulala: Run request' }, + { 'ka', 'lua require("kulala").run_all()', desc = 'Kulala: Run all requests' }, + { 'kR', 'lua require("kulala").replay()', desc = 'Kulala: Replay last request' }, + + -- View & Inspection + { 'kt', 'lua require("kulala").toggle_view()', desc = 'Kulala: Toggle view' }, + { 'ki', 'lua require("kulala").inspect()', desc = 'Kulala: Inspect current request' }, + { 'ks', 'lua require("kulala").show_stats()', desc = 'Kulala: Show stats' }, + + -- Navigation + { 'kn', 'lua require("kulala").jump_next()', desc = 'Kulala: Jump to next request' }, + { 'kp', 'lua require("kulala").jump_prev()', desc = 'Kulala: Jump to previous request' }, + + -- Copy/Paste & Scratchpad + { 'kc', 'lua require("kulala").copy()', desc = 'Kulala: Copy as cURL' }, + { 'kC', 'lua require("kulala").from_curl()', desc = 'Kulala: Paste from cURL' }, + { 'kb', 'lua require("kulala").scratchpad()', desc = 'Kulala: Open scratchpad' }, + + -- Environment management + { 'ke', 'lua require("kulala").set_selected_env()', desc = 'Kulala: Select environment' }, + { 'kg', 'lua require("kulala").download_graphql_schema()', desc = 'Kulala: Download GraphQL schema' }, + + -- Utility + { 'kx', 'lua require("kulala").close()', desc = 'Kulala: Close' }, + { 'kD', 'lua require("kulala").clear_cached_files()', desc = 'Kulala: Clear cache' }, + }, + }, + + -- more plugins -- 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 @@ -1142,6 +1185,7 @@ require('lazy').setup({ require 'kickstart.plugins.neo-tree', vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'Toggle NeoTree' }), require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'custom.plugins', -- 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 a8a15331c908a40ad72112f7fa09b477b77a969d Mon Sep 17 00:00:00 2001 From: jordanyono Date: Tue, 4 Nov 2025 13:46:45 -0500 Subject: [PATCH 28/52] changes --- init.lua | 30 ++++++++++++++++++++++++------ lua/kickstart/plugins/debug.lua | 13 +++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index deee96dca71..410e99451ae 100644 --- a/init.lua +++ b/init.lua @@ -791,28 +791,45 @@ require('lazy').setup({ usePlaceholders = true, -- Insert argument placeholders for functions deepCompletion = true, -- Include deep completions (e.g., struct fields) matcher = 'Fuzzy', -- Matching algorithm for completions + + -- Hover and signature help + hoverKind = 'FullDocumentation', -- Show full documentation in hover + linkTarget = 'pkg.go.dev', linksInHover = true, -- Show documentation links in hover popups + -- Static analysis and diagnostics -- Static analysis and diagnostics staticcheck = true, -- Enable additional static analysis checks analyses = { unusedparams = true, -- Detect unused function parameters - nilness = true, -- Detect nil pointer errors unusedwrite = true, -- Detect assignments that are never read + nilness = true, -- Detect nil pointer errors shadow = true, -- Detect variable shadowing + useany = true, -- Recommend using 'any' instead of 'interface{}' + unusedvariable = true, -- Detect unused variables + }, + + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, }, -- Code lenses codelenses = { - generate = true, -- Enable 'go generate' code lens gc_details = true, -- Show memory details on functions + generate = true, -- Enable 'go generate' code lens + regenerate_cgo = true, -- Regenerate cgo definitions tidy = true, -- Enable 'go mod tidy' lens + upgrade_dependency = true, -- Upgrade dependencies + vendor = true, -- Vendor dependencies test = true, -- Enable run/test lenses }, - -- Hover and signature help - hoverKind = 'FullDocumentation', -- Show full documentation in hover - -- Import management gofumpt = true, -- Use `gofumpt` formatting style directoryFilters = { '-vendor' }, -- Exclude vendor directories from analysis @@ -1183,7 +1200,8 @@ require('lazy').setup({ require 'kickstart.plugins.lint', require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', - vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'Toggle NeoTree' }), + vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'NeoTree Toggle' }), + vim.keymap.set('n', 'z', 'Neotree reveal', { desc = 'NeoTree Reveal' }), require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps require 'custom.plugins', diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 8ca03a0e074..8d473ed33de 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -144,5 +144,18 @@ return { detached = vim.fn.has 'win32' == 0, }, } + dap.configurations.go = dap.configurations.go or {} + table.insert(dap.configurations.go, { + type = 'go', + name = 'Attach remote (localhost:2345)', + mode = 'remote', + request = 'attach', + -- Connect to the port, not PID + port = 2345, + host = '127.0.0.1', + substitutePath = { + { from = '${workspaceFolder}', to = vim.fn.getcwd() }, + }, + }) end, } From 357bbdb942893496c317ab518e9e73f4658e601f Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 20 Nov 2025 17:30:16 -0500 Subject: [PATCH 29/52] adding val --- init.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/init.lua b/init.lua index 410e99451ae..3a5bab6e8bb 100644 --- a/init.lua +++ b/init.lua @@ -571,6 +571,25 @@ require('lazy').setup({ 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', 'shg', function() + builtin.live_grep { + prompt_title = 'Live Grep (All Files)', + -- This function adds the flags to the underlying grep command + additional_args = function(args) + return { '--hidden', '--no-ignore', '--no-ignore-parent' } + end, + } + end, { desc = '[S]earch [H]idden [G]rep)' }) + + vim.keymap.set('n', 'shf', function() + builtin.find_files { + prompt_title = 'Find All Files (Hidden + Ignored)', + hidden = true, -- Show hidden dotfiles + no_ignore = true, -- Ignore .gitignore rules + no_ignore_parent = true, -- Ignore .gitignore rules of all parents, too + } + end, { desc = 'Find All Files' }) end, }, -- LSP Plugins From b3b3270082d4dba840a86aa98a82618eb66f6563 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 20 Nov 2025 17:44:45 -0500 Subject: [PATCH 30/52] hidden greps --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 3a5bab6e8bb..63698e51427 100644 --- a/init.lua +++ b/init.lua @@ -577,7 +577,7 @@ require('lazy').setup({ prompt_title = 'Live Grep (All Files)', -- This function adds the flags to the underlying grep command additional_args = function(args) - return { '--hidden', '--no-ignore', '--no-ignore-parent' } + return { '--hidden', '--no-ignore', '--no-ignore-parent', '--glob=!**/.git/*' } end, } end, { desc = '[S]earch [H]idden [G]rep)' }) @@ -588,6 +588,7 @@ require('lazy').setup({ hidden = true, -- Show hidden dotfiles no_ignore = true, -- Ignore .gitignore rules no_ignore_parent = true, -- Ignore .gitignore rules of all parents, too + file_ignore_patterns = { '.git/' }, -- <--- Explicitly remove the .git folder } end, { desc = 'Find All Files' }) end, From 68a8adbc25a974110311695f647a1b315569e4bb Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 21 Nov 2025 15:28:32 -0500 Subject: [PATCH 31/52] move h to a --- init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 63698e51427..2cd3fd81638 100644 --- a/init.lua +++ b/init.lua @@ -572,7 +572,7 @@ require('lazy').setup({ builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) - vim.keymap.set('n', 'shg', function() + vim.keymap.set('n', 'sag', function() builtin.live_grep { prompt_title = 'Live Grep (All Files)', -- This function adds the flags to the underlying grep command @@ -580,9 +580,9 @@ require('lazy').setup({ return { '--hidden', '--no-ignore', '--no-ignore-parent', '--glob=!**/.git/*' } end, } - end, { desc = '[S]earch [H]idden [G]rep)' }) + end, { desc = '[S]earch [A]ll [G]rep)' }) - vim.keymap.set('n', 'shf', function() + vim.keymap.set('n', 'saf', function() builtin.find_files { prompt_title = 'Find All Files (Hidden + Ignored)', hidden = true, -- Show hidden dotfiles @@ -590,7 +590,7 @@ require('lazy').setup({ no_ignore_parent = true, -- Ignore .gitignore rules of all parents, too file_ignore_patterns = { '.git/' }, -- <--- Explicitly remove the .git folder } - end, { desc = 'Find All Files' }) + end, { desc = '[S]earch [A]ll [F]iles' }) end, }, -- LSP Plugins From fb6a5bb614fc7c09b0ed3ebce78cee0f0d7a1b09 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 21 Nov 2025 15:41:23 -0500 Subject: [PATCH 32/52] add sql-formatter --- init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init.lua b/init.lua index 2cd3fd81638..be6eb211fcf 100644 --- a/init.lua +++ b/init.lua @@ -988,11 +988,17 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + sql = { 'sql-formatter' }, -- 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 }, + --formatters = { + ['sql-formatter'] = { + -- Change "postgresql" to "mysql", "mariadb", "bigquery", "sqlite", etc. + prepend_args = { '-l', 'postgresql' }, + }, }, }, }, From 1bd862e78b79aa350b64d6cd68f3291e854a07e7 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 21 Nov 2025 16:00:02 -0500 Subject: [PATCH 33/52] fixing formatter --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index be6eb211fcf..1affde17566 100644 --- a/init.lua +++ b/init.lua @@ -928,6 +928,7 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'sql-formatter', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -995,8 +996,9 @@ require('lazy').setup({ -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, --formatters = { + }, + formatters = { ['sql-formatter'] = { - -- Change "postgresql" to "mysql", "mariadb", "bigquery", "sqlite", etc. prepend_args = { '-l', 'postgresql' }, }, }, From fea500cefbff2c8213aeef985b1476f2118bc8f9 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 21 Nov 2025 16:50:22 -0500 Subject: [PATCH 34/52] fix formatter --- init.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 1affde17566..e1d50cde864 100644 --- a/init.lua +++ b/init.lua @@ -989,17 +989,16 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, - sql = { 'sql-formatter' }, + sql = { 'sql_formatter' }, -- 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 }, - --formatters = { }, formatters = { - ['sql-formatter'] = { - prepend_args = { '-l', 'postgresql' }, + ['sql_formatter'] = { + prepend_args = { '-l', 'postgresql', '-c', '{"useTabs": true}' }, }, }, }, From 819633aec189035d242551131aba86e7c1a8f0f6 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Sun, 23 Nov 2025 17:59:16 -0500 Subject: [PATCH 35/52] better naming --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index e1d50cde864..ed7c6a0e6a1 100644 --- a/init.lua +++ b/init.lua @@ -580,7 +580,7 @@ require('lazy').setup({ return { '--hidden', '--no-ignore', '--no-ignore-parent', '--glob=!**/.git/*' } end, } - end, { desc = '[S]earch [A]ll [G]rep)' }) + end, { desc = '[S]earch [A]ll Files [G]rep)' }) vim.keymap.set('n', 'saf', function() builtin.find_files { From 10c0f99c99247bad5858febf083308effc3ce5c4 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Tue, 16 Dec 2025 14:37:23 -0500 Subject: [PATCH 36/52] moar --- init.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/init.lua b/init.lua index ed7c6a0e6a1..beabe94ce32 100644 --- a/init.lua +++ b/init.lua @@ -929,6 +929,7 @@ require('lazy').setup({ vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code 'sql-formatter', + 'prettier', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -977,6 +978,7 @@ require('lazy').setup({ javascript = true, javascriptreact = true, python = true, + sql = true, } if disable_filetypes[vim.bo[bufnr].filetype] then return nil @@ -1193,6 +1195,8 @@ require('lazy').setup({ 'bash', 'yaml', 'sql', + 'hcl', + 'terraform', }, -- Autoinstall languages that are not installed auto_install = true, @@ -1212,6 +1216,14 @@ require('lazy').setup({ -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, + { + 'towolf/vim-helm', + event = 'BufReadPre', + config = function() + -- This plugin automatically detects helm files (including .tpl) + -- and sets the filetype to "helm" instead of "yaml" + 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 From 7005b044de6aa0658f56bf515ebbfef9b068e00a Mon Sep 17 00:00:00 2001 From: jordanyono Date: Wed, 17 Dec 2025 09:47:04 -0500 Subject: [PATCH 37/52] links --- init.lua | 3 +++ lua/custom/git_links.lua | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 lua/custom/git_links.lua diff --git a/init.lua b/init.lua index beabe94ce32..c29c9622465 100644 --- a/init.lua +++ b/init.lua @@ -231,6 +231,9 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +local custom_git = require './lua/custom/git_links' +vim.keymap.set({ 'n', 'v' }, 'go', custom_git.open_github, { desc = 'Open in GitHub' }) + -- [[ 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' diff --git a/lua/custom/git_links.lua b/lua/custom/git_links.lua new file mode 100644 index 00000000000..001346c4086 --- /dev/null +++ b/lua/custom/git_links.lua @@ -0,0 +1,40 @@ +local M = {} + +M.open_github = function() + -- Get current file path relative to the git project root + local file_path = vim.fn.systemlist('git ls-files --full-name ' .. vim.fn.expand '%')[1] + if not file_path or file_path == '' then + print 'File not tracked by git.' + return + end + + -- Get remote URL and clean it up (handles HTTPS and SSH) + local remote = vim.fn.system('git config --get remote.origin.url'):gsub('\n', ''):gsub('%.git$', '') + if remote:match '^git@' then + remote = remote:gsub(':', '/'):gsub('git@', 'https://') + end + + -- Get current branch + local branch = vim.fn.system('git rev-parse --abbrev-ref HEAD'):gsub('\n', '') + + -- Get line numbers (handles single line or visual selection) + local line_start = vim.fn.line 'v' + local line_end = vim.fn.line '.' + if line_start > line_end then + line_start, line_end = line_end, line_start + end + + local line_anchor = 'L' .. line_end + if vim.fn.mode():match '[vV]' then + line_anchor = 'L' .. line_start .. '-L' .. line_end + end + + -- Build and open the URL + local url = string.format('%s/blob/%s/%s#%s', remote, branch, file_path, line_anchor) + + -- Linux only: using xdg-open in the background to avoid freezing Neovim + vim.fn.jobstart({ 'xdg-open', url }, { detach = true }) + print 'Opened in GitHub' +end + +return M From 9b06a7cb5cfcf8826278318e8d36e92189e7e52a Mon Sep 17 00:00:00 2001 From: jordanyono Date: Wed, 17 Dec 2025 12:18:31 -0500 Subject: [PATCH 38/52] gitty --- init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index c29c9622465..536bcae719e 100644 --- a/init.lua +++ b/init.lua @@ -231,8 +231,8 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) -local custom_git = require './lua/custom/git_links' -vim.keymap.set({ 'n', 'v' }, 'go', custom_git.open_github, { desc = 'Open in GitHub' }) +local git_links = require 'custom.git_links' +vim.keymap.set({ 'n', 'v' }, 'go', git_links.open_github, { desc = 'Open in GitHub' }) -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info @@ -765,7 +765,8 @@ require('lazy').setup({ vim.diagnostic.config { severity_sort = true, float = { border = 'rounded', source = 'if_many' }, - underline = { severity = vim.diagnostic.severity.ERROR }, + -- underline = { severity = vim.diagnostic.severity.ERROR }, + underline = true, signs = vim.g.have_nerd_font and { text = { [vim.diagnostic.severity.ERROR] = '󰅚 ', From d54396f4780cbb96065ab34522a83d9da9cd9c6b Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 6 Feb 2026 12:17:04 -0500 Subject: [PATCH 39/52] autoread external --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 536bcae719e..ecd531bb8e9 100644 --- a/init.lua +++ b/init.lua @@ -213,6 +213,9 @@ vim.keymap.set('n', 'tf', ':ToggleTerm', { desc = 'Toggle floating t vim.opt.number = true vim.opt.relativenumber = true +-- autoreload when external changes +vim.opt.autoread = true + -- paste does not yank in visual mode -- Make Visual mode paste not clobber the default register vim.keymap.set('x', 'p', '"_dP', { noremap = true, silent = true }) From 3236f481d7316cbbadc62bc8570badadcf96ea3f Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 26 Feb 2026 14:48:02 -0500 Subject: [PATCH 40/52] json fmt --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index ecd531bb8e9..4143e2c18a2 100644 --- a/init.lua +++ b/init.lua @@ -999,6 +999,7 @@ require('lazy').setup({ formatters_by_ft = { lua = { 'stylua' }, sql = { 'sql_formatter' }, + json = { 'prettier' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- From f68d07c4e060cb93d000ef72f3200aee5b871c6c Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 5 Mar 2026 11:36:26 -0500 Subject: [PATCH 41/52] update --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 4143e2c18a2..bc886d19ea7 100644 --- a/init.lua +++ b/init.lua @@ -813,6 +813,9 @@ require('lazy').setup({ gopls = { settings = { gopls = { + buildFlags = { + '-tags=integration,small,medium,large', + }, -- Completion settings completeUnimported = true, -- Suggest symbols from packages that are not yet imported usePlaceholders = true, -- Insert argument placeholders for functions @@ -833,7 +836,6 @@ require('lazy').setup({ nilness = true, -- Detect nil pointer errors shadow = true, -- Detect variable shadowing useany = true, -- Recommend using 'any' instead of 'interface{}' - unusedvariable = true, -- Detect unused variables }, hints = { @@ -937,6 +939,7 @@ require('lazy').setup({ 'stylua', -- Used to format Lua code 'sql-formatter', 'prettier', + 'staticcheck', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } From c5e4e5cca7fa0b9fe19a2554ac5b1e1ca09173df Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 5 Mar 2026 16:08:46 -0500 Subject: [PATCH 42/52] tags --- init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index bc886d19ea7..a88225f9840 100644 --- a/init.lua +++ b/init.lua @@ -814,7 +814,11 @@ require('lazy').setup({ settings = { gopls = { buildFlags = { - '-tags=integration,small,medium,large', + '-tags', + 'functional,integration,small,medium,large', + }, + env = { + GOFLAGS = '-tags=functional,integration,small,medium,large', }, -- Completion settings completeUnimported = true, -- Suggest symbols from packages that are not yet imported @@ -989,6 +993,7 @@ require('lazy').setup({ javascriptreact = true, python = true, sql = true, + json = true, } if disable_filetypes[vim.bo[bufnr].filetype] then return nil From 1df4c345f6c3a3f988679b1aa168b781f3e6bbff Mon Sep 17 00:00:00 2001 From: jordanyono Date: Tue, 17 Mar 2026 15:13:18 -0400 Subject: [PATCH 43/52] more lua --- init.lua | 156 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 140 insertions(+), 16 deletions(-) diff --git a/init.lua b/init.lua index a88225f9840..91fed44fa8d 100644 --- a/init.lua +++ b/init.lua @@ -835,13 +835,138 @@ require('lazy').setup({ -- Static analysis and diagnostics staticcheck = true, -- Enable additional static analysis checks analyses = { - unusedparams = true, -- Detect unused function parameters - unusedwrite = true, -- Detect assignments that are never read - nilness = true, -- Detect nil pointer errors - shadow = true, -- Detect variable shadowing - useany = true, -- Recommend using 'any' instead of 'interface{}' + -- ========================================== + -- 1. Core 'go vet' & gopls Specific Checks + -- ========================================== + asmdecl = true, + assign = true, + atomic = true, + atomicalign = true, + bools = true, + buildtag = true, + cgocall = true, + composites = true, + copylock = true, + defers = true, + directive = true, + errorsas = true, + framepointer = true, + httpresponse = true, + ifaceassert = true, + loopclosure = true, + lostcancel = true, + nilfunc = true, + printf = true, + shift = true, + sigchanyzer = true, + slog = true, + stdmethods = true, + stringintconv = true, + structtag = true, + testinggoroutine = true, + tests = true, + timeformat = true, + unmarshal = true, + unreachable = true, + unsafeptr = true, + unusedresult = true, + deepequalerrors = true, + embed = true, + fieldalignment = true, + fillreturns = true, + infertypeargs = true, + nilness = true, + nonewvars = true, + noresultvalues = true, + shadow = true, + simplifycompositelit = true, + simplifyrange = true, + simplifyslice = true, + sortslice = true, + stubmethods = true, + undeclaredname = true, + unusedparams = true, + unusedvariable = true, + unusedwrite = true, + useany = true, + + -- ========================================== + -- 2. S Series: Staticcheck Simplifications + -- ========================================== + S1000 = true, -- Use plain channel send or receive instead of single-case select + S1001 = true, -- Replace for loop with call to copy + S1002 = true, -- Omit comparison with boolean constant + S1003 = true, -- Replace call to strings.Index with strings.Contains + S1004 = true, -- Replace call to bytes.Compare with bytes.Equal + S1005 = true, -- Drop unnecessary use of the blank identifier + S1006 = true, -- Use 'for { ... }' for infinite loops + S1007 = true, -- Simplify regular expression by using raw string literal + S1008 = true, -- Simplify returning boolean expression + S1009 = true, -- Omit redundant nil check on slices, maps, and channels + S1010 = true, -- Omit default slice index + S1011 = true, -- Use a single append to concatenate two slices + S1012 = true, -- Replace time.Now().Sub(x) with time.Since(x) + S1016 = true, -- Use a type conversion instead of manually copying struct fields + S1017 = true, -- Replace manual trimming with strings.TrimPrefix + S1018 = true, -- Use 'copy' for sliding elements + S1019 = true, -- Simplify 'make' call by omitting redundant arguments + S1020 = true, -- Omit redundant nil check in type assertion + S1021 = true, -- Merge variable declaration and assignment + S1023 = true, -- Omit redundant control flow (e.g. return in void func) + S1024 = true, -- Replace x.Sub(time.Now()) with time.Until(x) + S1025 = true, -- Don't use fmt.Sprintf("%s", x) unnecessarily + S1028 = true, -- Simplify error construction with fmt.Errorf + S1029 = true, -- Range over string rather than running loop over bytes + S1030 = true, -- Use bytes.Buffer.String or bytes.Buffer.Bytes + S1031 = true, -- Omit redundant nil check around loop + S1032 = true, -- Use sort.Ints(x), sort.Float64s(x), and sort.Strings(x) + S1033 = true, -- Unnecessary guard around call to delete + S1034 = true, -- Use result of type assertion to simplify cases + S1035 = true, -- Redundant call to net/http.CanonicalHeaderKey + S1036 = true, -- Unnecessary guard around map access + S1037 = true, -- Elaborate sleep with time.Sleep + S1038 = true, -- Unnecessarily complex formatting directives + S1039 = true, -- Unnecessary use of fmt.Sprint + S1040 = true, -- Type assertion to current type + + -- ========================================== + -- 3. ST Series: Staticcheck Style Checks + -- ========================================== + ST1000 = true, -- Incorrect or missing package comment + ST1001 = true, -- Dot imports are discouraged + ST1003 = true, -- Poorly chosen identifier names (e.g. snake_case in Go) + ST1005 = true, -- Incorrectly formatted error string + ST1006 = true, -- Poorly chosen receiver name + ST1008 = true, -- A function's error value should be its last return value + ST1011 = true, -- Poorly chosen name for variable of type time.Duration + ST1012 = true, -- Poorly chosen name for error variable + ST1013 = true, -- Should use constants for HTTP error codes + ST1015 = true, -- A switch's default case should be the first or last case + ST1016 = true, -- Use consistent method receiver names + ST1017 = true, -- Don't use Yoda conditions + ST1018 = true, -- Avoid zero-width and control characters in string literals + ST1019 = true, -- Importing the same package multiple times + ST1020 = true, -- The documentation of an exported function should start with the function's name + ST1021 = true, -- The documentation of an exported type should start with type's name + ST1022 = true, -- The documentation of an exported variable/constant should start with variable's name + ST1023 = true, -- Redundant type in variable declaration + + -- ========================================== + -- 4. QF Series: Staticcheck Quick Fixes + -- ========================================== + QF1001 = true, -- Apply De Morgan's law + QF1002 = true, -- Convert untagged switch to tagged switch + QF1003 = true, -- Convert if/else-if chain to tagged switch + QF1004 = true, -- Use strings.ReplaceAll instead of strings.Replace + QF1005 = true, -- Expand call to math.Pow + QF1006 = true, -- Lift if+break into loop condition + QF1007 = true, -- Merge conditional assignment into variable declaration + QF1008 = true, -- Omit embedded fields from selector expression + QF1009 = true, -- Use time.Time.Equal instead of == + QF1010 = true, -- Convert slice of bytes to string when printing it + QF1011 = true, -- Omit redundant type from variable declaration + QF1012 = true, -- Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...)) }, - hints = { assignVariableTypes = true, compositeLiteralFields = true, @@ -851,18 +976,17 @@ require('lazy').setup({ parameterNames = true, rangeVariableTypes = true, }, - - -- Code lenses codelenses = { - gc_details = true, -- Show memory details on functions - generate = true, -- Enable 'go generate' code lens - regenerate_cgo = true, -- Regenerate cgo definitions - tidy = true, -- Enable 'go mod tidy' lens - upgrade_dependency = true, -- Upgrade dependencies - vendor = true, -- Vendor dependencies - test = true, -- Enable run/test lenses + gc_details = true, -- Toggles the display of compiler optimization details (escape analysis, inlining) + generate = true, -- Injects a "run go generate" link above `//go:generate` comments + regenerate_cgo = true, -- Injects a link to regenerate C declarations above `import "C"` + run_govulncheck = true, -- (Legacy) Injects a link above `module` in go.mod to run vulnerability analysis + test = true, -- Injects "run test" and "debug test" links above `Test...` and `Benchmark...` functions + tidy = true, -- Injects a "run go mod tidy" link above the `module` directive in go.mod + upgrade_dependency = true, -- Injects links in go.mod to upgrade direct/transitive dependencies + vendor = true, -- Injects a "run go mod vendor" link in go.mod + vulncheck = true, -- (Modern) Injects a synchronous govulncheck link in go.mod }, - -- Import management gofumpt = true, -- Use `gofumpt` formatting style directoryFilters = { '-vendor' }, -- Exclude vendor directories from analysis From 4782828d2ff74863f324d83848d425b6c295cda4 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Tue, 17 Mar 2026 18:02:15 -0400 Subject: [PATCH 44/52] fix --- init.lua | 242 +++++++++++++++----------------- lua/kickstart/plugins/debug.lua | 1 + 2 files changed, 118 insertions(+), 125 deletions(-) diff --git a/init.lua b/init.lua index 91fed44fa8d..42b109257ce 100644 --- a/init.lua +++ b/init.lua @@ -619,7 +619,19 @@ 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', + opts = { + ensure_installed = { + 'goimports', + 'gofumpt', + 'gomodifytags', + 'impl', + 'golangci-lint', + 'delve', + }, + }, + }, 'mason-org/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', @@ -710,10 +722,6 @@ require('lazy').setup({ 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) @@ -722,12 +730,31 @@ require('lazy').setup({ end end + local client = vim.lsp.get_client_by_id(event.data.client_id) + + -- ========================================================================= + -- NEW: The gopls Semantic Tokens Workaround + -- ========================================================================= + if client and client.name == 'gopls' and not client.server_capabilities.semanticTokensProvider then + local semantic = client.config.capabilities.textDocument.semanticTokens + if semantic then + client.server_capabilities.semanticTokensProvider = { + full = true, + legend = { + tokenTypes = semantic.tokenTypes, + tokenModifiers = semantic.tokenModifiers, + }, + range = true, + } + 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 local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { @@ -810,34 +837,35 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { clangd = {}, + + -- ========================================================================= + -- UPDATED: The unified "God Mode" gopls config + -- ========================================================================= gopls = { settings = { gopls = { + -- Use just ONE method for build flags to avoid conflicts buildFlags = { '-tags', 'functional,integration,small,medium,large', }, - env = { - GOFLAGS = '-tags=functional,integration,small,medium,large', - }, + -- Completion settings - completeUnimported = true, -- Suggest symbols from packages that are not yet imported - usePlaceholders = true, -- Insert argument placeholders for functions - deepCompletion = true, -- Include deep completions (e.g., struct fields) - matcher = 'Fuzzy', -- Matching algorithm for completions + completeUnimported = true, + usePlaceholders = true, + deepCompletion = true, + matcher = 'Fuzzy', -- Hover and signature help - hoverKind = 'FullDocumentation', -- Show full documentation in hover + hoverKind = 'FullDocumentation', linkTarget = 'pkg.go.dev', - linksInHover = true, -- Show documentation links in hover popups + linksInHover = true, -- Static analysis and diagnostics - -- Static analysis and diagnostics - staticcheck = true, -- Enable additional static analysis checks + staticcheck = true, -- THIS automatically runs the officially supported staticcheck suite + analyses = { - -- ========================================== - -- 1. Core 'go vet' & gopls Specific Checks - -- ========================================== + -- Only natively supported go vet / gopls checks go here asmdecl = true, assign = true, atomic = true, @@ -872,7 +900,6 @@ require('lazy').setup({ unusedresult = true, deepequalerrors = true, embed = true, - fieldalignment = true, fillreturns = true, infertypeargs = true, nilness = true, @@ -889,84 +916,8 @@ require('lazy').setup({ unusedvariable = true, unusedwrite = true, useany = true, - - -- ========================================== - -- 2. S Series: Staticcheck Simplifications - -- ========================================== - S1000 = true, -- Use plain channel send or receive instead of single-case select - S1001 = true, -- Replace for loop with call to copy - S1002 = true, -- Omit comparison with boolean constant - S1003 = true, -- Replace call to strings.Index with strings.Contains - S1004 = true, -- Replace call to bytes.Compare with bytes.Equal - S1005 = true, -- Drop unnecessary use of the blank identifier - S1006 = true, -- Use 'for { ... }' for infinite loops - S1007 = true, -- Simplify regular expression by using raw string literal - S1008 = true, -- Simplify returning boolean expression - S1009 = true, -- Omit redundant nil check on slices, maps, and channels - S1010 = true, -- Omit default slice index - S1011 = true, -- Use a single append to concatenate two slices - S1012 = true, -- Replace time.Now().Sub(x) with time.Since(x) - S1016 = true, -- Use a type conversion instead of manually copying struct fields - S1017 = true, -- Replace manual trimming with strings.TrimPrefix - S1018 = true, -- Use 'copy' for sliding elements - S1019 = true, -- Simplify 'make' call by omitting redundant arguments - S1020 = true, -- Omit redundant nil check in type assertion - S1021 = true, -- Merge variable declaration and assignment - S1023 = true, -- Omit redundant control flow (e.g. return in void func) - S1024 = true, -- Replace x.Sub(time.Now()) with time.Until(x) - S1025 = true, -- Don't use fmt.Sprintf("%s", x) unnecessarily - S1028 = true, -- Simplify error construction with fmt.Errorf - S1029 = true, -- Range over string rather than running loop over bytes - S1030 = true, -- Use bytes.Buffer.String or bytes.Buffer.Bytes - S1031 = true, -- Omit redundant nil check around loop - S1032 = true, -- Use sort.Ints(x), sort.Float64s(x), and sort.Strings(x) - S1033 = true, -- Unnecessary guard around call to delete - S1034 = true, -- Use result of type assertion to simplify cases - S1035 = true, -- Redundant call to net/http.CanonicalHeaderKey - S1036 = true, -- Unnecessary guard around map access - S1037 = true, -- Elaborate sleep with time.Sleep - S1038 = true, -- Unnecessarily complex formatting directives - S1039 = true, -- Unnecessary use of fmt.Sprint - S1040 = true, -- Type assertion to current type - - -- ========================================== - -- 3. ST Series: Staticcheck Style Checks - -- ========================================== - ST1000 = true, -- Incorrect or missing package comment - ST1001 = true, -- Dot imports are discouraged - ST1003 = true, -- Poorly chosen identifier names (e.g. snake_case in Go) - ST1005 = true, -- Incorrectly formatted error string - ST1006 = true, -- Poorly chosen receiver name - ST1008 = true, -- A function's error value should be its last return value - ST1011 = true, -- Poorly chosen name for variable of type time.Duration - ST1012 = true, -- Poorly chosen name for error variable - ST1013 = true, -- Should use constants for HTTP error codes - ST1015 = true, -- A switch's default case should be the first or last case - ST1016 = true, -- Use consistent method receiver names - ST1017 = true, -- Don't use Yoda conditions - ST1018 = true, -- Avoid zero-width and control characters in string literals - ST1019 = true, -- Importing the same package multiple times - ST1020 = true, -- The documentation of an exported function should start with the function's name - ST1021 = true, -- The documentation of an exported type should start with type's name - ST1022 = true, -- The documentation of an exported variable/constant should start with variable's name - ST1023 = true, -- Redundant type in variable declaration - - -- ========================================== - -- 4. QF Series: Staticcheck Quick Fixes - -- ========================================== - QF1001 = true, -- Apply De Morgan's law - QF1002 = true, -- Convert untagged switch to tagged switch - QF1003 = true, -- Convert if/else-if chain to tagged switch - QF1004 = true, -- Use strings.ReplaceAll instead of strings.Replace - QF1005 = true, -- Expand call to math.Pow - QF1006 = true, -- Lift if+break into loop condition - QF1007 = true, -- Merge conditional assignment into variable declaration - QF1008 = true, -- Omit embedded fields from selector expression - QF1009 = true, -- Use time.Time.Equal instead of == - QF1010 = true, -- Convert slice of bytes to string when printing it - QF1011 = true, -- Omit redundant type from variable declaration - QF1012 = true, -- Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...)) }, + hints = { assignVariableTypes = true, compositeLiteralFields = true, @@ -976,24 +927,23 @@ require('lazy').setup({ parameterNames = true, rangeVariableTypes = true, }, + codelenses = { - gc_details = true, -- Toggles the display of compiler optimization details (escape analysis, inlining) - generate = true, -- Injects a "run go generate" link above `//go:generate` comments - regenerate_cgo = true, -- Injects a link to regenerate C declarations above `import "C"` - run_govulncheck = true, -- (Legacy) Injects a link above `module` in go.mod to run vulnerability analysis - test = true, -- Injects "run test" and "debug test" links above `Test...` and `Benchmark...` functions - tidy = true, -- Injects a "run go mod tidy" link above the `module` directive in go.mod - upgrade_dependency = true, -- Injects links in go.mod to upgrade direct/transitive dependencies - vendor = true, -- Injects a "run go mod vendor" link in go.mod - vulncheck = true, -- (Modern) Injects a synchronous govulncheck link in go.mod + gc_details = true, + generate = true, + regenerate_cgo = true, + test = true, + tidy = true, + upgrade_dependency = true, + vendor = true, + vulncheck = true, }, - -- Import management - gofumpt = true, -- Use `gofumpt` formatting style - directoryFilters = { '-vendor' }, -- Exclude vendor directories from analysis + + gofumpt = true, + directoryFilters = { '-vendor' }, }, }, - -- Auto organize imports on save on_attach = function(client, bufnr) if client.name == 'gopls' then vim.api.nvim_create_autocmd('BufWritePre', { @@ -1008,6 +958,8 @@ require('lazy').setup({ end end, }, + -- ========================================================================= + pyright = {}, rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -1018,12 +970,12 @@ require('lazy').setup({ -- But for many setups, the LSP (`ts_ls`) will work just fine ts_ls = { settings = {}, - on_attach = function(client) + on_attach = function(client, bufnr) client.server_capabilities.documentFormattingProvider = false client.server_capabilities.documentRangeFormattingProvider = false -- Disable format on save for this buffer - vim.api.nvim_buf_set_option(bufnr, 'formatoptions', '') + vim.api.nvim_set_option_value('formatoptions', '', { buf = bufnr }) vim.api.nvim_create_autocmd('BufWritePre', { buffer = bufnr, callback = function() @@ -1032,7 +984,7 @@ require('lazy').setup({ }) end, }, - -- + lua_ls = { -- cmd = { ... }, -- filetypes = { ... }, @@ -1048,6 +1000,14 @@ require('lazy').setup({ }, }, } + -- + -- -- + -- -- FORCE GOPLS SETUP + -- -- + -- local gopls_config = servers.gopls + -- gopls_config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, gopls_config.capabilities or {}) + -- require('lspconfig').gopls.setup(gopls_config) + -- -- Ensure the servers and tools above are installed -- @@ -1068,26 +1028,41 @@ require('lazy').setup({ 'sql-formatter', 'prettier', 'staticcheck', + 'goimports', + 'gofumpt', + 'gomodifytags', + 'impl', + 'golangci-lint', + 'delve', }) 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, - }, + -- We are removing the handlers block here to prevent Mason + -- from silently skipping unmanaged/globally-installed binaries. } + + -- Ensure lspconfig is loaded so defaults are populated in Nvim 0.11 + require 'lspconfig' + + -- Explicitly set up all servers defined in the servers table. + for server_name, server in pairs(servers) do + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + + if vim.fn.has 'nvim-0.11' == 1 then + -- Neovim 0.11+ native config API (prevents deprecation warning) + local def = vim.lsp.config[server_name] or {} + vim.lsp.config[server_name] = vim.tbl_deep_extend('force', def, server) + vim.lsp.enable(server_name) + else + -- Neovim 0.10 and earlier legacy API + require('lspconfig')[server_name].setup(server) + end + end end, }, - { -- Autoformat 'stevearc/conform.nvim', event = { 'BufWritePre' }, @@ -1325,6 +1300,9 @@ require('lazy').setup({ 'vim', 'vimdoc', 'go', + 'gomod', + 'gowork', + 'gosum', 'rust', 'python', 'json', @@ -1364,6 +1342,20 @@ require('lazy').setup({ -- and sets the filetype to "helm" instead of "yaml" end, }, + { + 'fredrikaverpil/neotest-golang', + }, + { + 'nvim-mini/mini.icons', + opts = { + file = { + ['.go-version'] = { glyph = '', hl = 'MiniIconsBlue' }, + }, + filetype = { + gotmpl = { glyph = '󰟓', hl = 'MiniIconsGrey' }, + }, + }, + }, -- 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 diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 8d473ed33de..8c81d08c049 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -138,6 +138,7 @@ return { -- Install golang specific config require('dap-go').setup { + dap_configurations_from_gopls = false, delve = { -- On Windows delve must be run attached or it crashes. -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring From afdb4a3ae43b6f0abe72baceaf1de4025eefe952 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 20 Mar 2026 13:45:01 -0400 Subject: [PATCH 45/52] fix --- init.lua | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/init.lua b/init.lua index 42b109257ce..482e36a7292 100644 --- a/init.lua +++ b/init.lua @@ -621,16 +621,7 @@ require('lazy').setup({ -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` { 'mason-org/mason.nvim', - opts = { - ensure_installed = { - 'goimports', - 'gofumpt', - 'gomodifytags', - 'impl', - 'golangci-lint', - 'delve', - }, - }, + opts = {}, }, 'mason-org/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', From ffa39ac7e4c96ac7fbf3cb4ef856fbfe7ca0090e Mon Sep 17 00:00:00 2001 From: jordanyono Date: Fri, 27 Mar 2026 12:20:25 -0400 Subject: [PATCH 46/52] things --- init.lua | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 482e36a7292..a9dfc5dc212 100644 --- a/init.lua +++ b/init.lua @@ -344,6 +344,17 @@ require('lazy').setup({ vim.keymap.set(mode, l, r, opts) end + -- Detect branch once per buffer attach + local primary_branch = 'main' + local handle = io.popen 'git branch --list main master' + if handle then + local result = handle:read '*a' + handle:close() + if not string.find(result, 'main') and string.find(result, 'master') then + primary_branch = 'master' + end + end + -- Navigation map('n', ']c', function() if vim.wo.diff then @@ -362,14 +373,13 @@ require('lazy').setup({ 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' }) @@ -378,13 +388,20 @@ require('lazy').setup({ map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) map('n', 'hB', gitsigns.blame, { desc = 'git [B]lame toggle' }) + + -- Diff Mappings 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', 'hm', function() + gitsigns.diffthis(primary_branch) + end, { desc = 'git diff against [m]ain/master' }) + -- 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', 'ht', gitsigns.toggle_current_line_blame, { desc = '[t]oggle git show blame line' }) + map('n', 'hv', gitsigns.preview_hunk_inline, { desc = 'toggle git show deleted ([v]iew)' }) end, }, }, From 128a67d4b3cfd6748208333e0a67a2854ebb9d19 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Wed, 1 Apr 2026 10:12:33 -0400 Subject: [PATCH 47/52] save --- init.lua | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/init.lua b/init.lua index a9dfc5dc212..18dcd0644f6 100644 --- a/init.lua +++ b/init.lua @@ -554,23 +554,31 @@ require('lazy').setup({ vim.keymap.set('n', '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', 'sD', function() + local current_dir = vim.fn.expand '%:p:h' -- Gets the absolute path to the current file's folder + require('telescope.builtin').diagnostics { + cwd = current_dir, + -- This ensures it searches within the directory, not just the file + root_dir = current_dir, + } + end, { desc = '[S]earch [D]iagnostics in current directory' }) 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', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - vim.keymap.set('n', 'g', '', { desc = '[Git]' }) - vim.keymap.set('n', 'gl', builtin.git_bcommits, { desc = '[Git] Buffer Commits' }) - vim.keymap.set('n', 'gr', builtin.git_bcommits_range, { desc = '[Git] Buffer Commits Range' }) - vim.keymap.set('n', 'gb', builtin.git_branches, { desc = '[Git] Branches' }) - vim.keymap.set('n', 'gc', builtin.git_commits, { desc = '[Git] Commits' }) - vim.keymap.set('n', 'gf', builtin.git_files, { desc = '[Git] Files' }) - vim.keymap.set('n', 'gt', builtin.git_stash, { desc = '[Git] Stash' }) - vim.keymap.set('n', 'gs', builtin.git_status, { desc = '[Git] Status' }) - vim.keymap.set('n', 'gm', function() - builtin.git_commits { - git_command = { 'git', 'log', '--oneline', '--decorate', 'main..HEAD' }, - } - end, { desc = '[Git] Commits ahead of main' }) + -- vim.keymap.set('n', 'g', '', { desc = '[Git]' }) + -- vim.keymap.set('n', 'gl', builtin.git_bcommits, { desc = '[Git] Buffer Commits' }) + -- vim.keymap.set('n', 'gr', builtin.git_bcommits_range, { desc = '[Git] Buffer Commits Range' }) + -- vim.keymap.set('n', 'gb', builtin.git_branches, { desc = '[Git] Branches' }) + -- vim.keymap.set('n', 'gc', builtin.git_commits, { desc = '[Git] Commits' }) + -- vim.keymap.set('n', 'gf', builtin.git_files, { desc = '[Git] Files' }) + -- vim.keymap.set('n', 'gt', builtin.git_stash, { desc = '[Git] Stash' }) + -- vim.keymap.set('n', 'gs', builtin.git_status, { desc = '[Git] Status' }) + -- vim.keymap.set('n', 'gm', function() + -- builtin.git_commits { + -- git_command = { 'git', 'log', '--oneline', '--decorate', 'main..HEAD' }, + -- } + -- end, { desc = '[Git] Commits ahead of main' }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() @@ -852,7 +860,6 @@ require('lazy').setup({ gopls = { settings = { gopls = { - -- Use just ONE method for build flags to avoid conflicts buildFlags = { '-tags', 'functional,integration,small,medium,large', @@ -869,6 +876,9 @@ require('lazy').setup({ linkTarget = 'pkg.go.dev', linksInHover = true, + -- Does this actually help? + expandWorkspaceToModule = true, + -- Static analysis and diagnostics staticcheck = true, -- THIS automatically runs the officially supported staticcheck suite From 8744577e91dfd3f6db7ad97773958d880333bc38 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Thu, 30 Apr 2026 10:25:23 -0400 Subject: [PATCH 48/52] fix overrides --- init.lua | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index a720254b5dc..fe908c2a137 100644 --- a/init.lua +++ b/init.lua @@ -253,6 +253,16 @@ vim.api.nvim_create_autocmd('TextYankPost', { callback = function() vim.hl.on_yank() end, }) +-- Safer defaults when reading Markdown (e.g. cloned READMEs): modelines in .md are rare and +-- can be abused; preview stays in-editor via render-markdown.nvim (no browser / Electron). +vim.api.nvim_create_autocmd('FileType', { + group = vim.api.nvim_create_augroup('kickstart-markdown-safe-read', { clear = true }), + pattern = 'markdown', + callback = function() + vim.opt_local.modeline = false + end, +}) + local git_links = require 'custom.git_links' vim.keymap.set({ 'n', 'v' }, 'go', git_links.open_github, { desc = 'Open in GitHub' }) @@ -425,6 +435,18 @@ require('lazy').setup({ -- -- Use the `dependencies` key to specify the dependencies of a particular plugin + -- In-buffer Markdown viewing (no external preview server). LaTeX is off so formulas do not + -- spawn optional converters (utftex / latex2text). See :RenderMarkdown toggle + { + 'MeanderingProgrammer/render-markdown.nvim', + dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, + ft = { 'markdown', 'markdown.mdx' }, + opts = { + latex = { enabled = false }, + completions = { lsp = { enabled = true }, blink = { enabled = true } }, + }, + }, + { -- Fuzzy Finder (files, lsp, etc) 'nvim-telescope/telescope.nvim', -- By default, Telescope is included and acts as your picker for everything. @@ -587,6 +609,9 @@ require('lazy').setup({ -- Main LSP Configuration 'neovim/nvim-lspconfig', dependencies = { + -- Load before this plugin's config runs so get_lsp_capabilities() exists even when + -- LSP startup happens before VimEnter (e.g. `nvim file.py`). + { 'saghen/blink.cmp', version = '1.*' }, -- 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({})` @@ -659,18 +684,18 @@ require('lazy').setup({ -- 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') + -- Defer requiring Telescope until keypress: on `nvim file.py`, LspAttach can run + -- before VimEnter, when lazy.nvim has not loaded telescope.nvim yet. + -- + -- Nvim 0.11+ sets *global* defaults grr/gri/grt/gO → vim.lsp.buf.* which uses + -- quickfix / loclist. Buffer-local maps here override those for this buffer. + map('grr', function() require('telescope.builtin').lsp_references() end, '[R]eferences') + map('gri', function() require('telescope.builtin').lsp_implementations() end, '[I]mplementation') + map('gO', function() require('telescope.builtin').lsp_document_symbols() end, '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') + map('gW', function() require('telescope.builtin').lsp_dynamic_workspace_symbols() end, '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') + map('grt', function() require('telescope.builtin').lsp_type_definitions() end, '[G]oto [T]ype Definition') -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) local function client_supports_method(client, method, bufnr) From 9738cf2c3628d3100fc2e81a868e466253c8e3dd Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 4 May 2026 22:01:34 -0400 Subject: [PATCH 49/52] fix --- init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index fe908c2a137..ff7c3c084d2 100644 --- a/init.lua +++ b/init.lua @@ -687,14 +687,16 @@ require('lazy').setup({ -- Defer requiring Telescope until keypress: on `nvim file.py`, LspAttach can run -- before VimEnter, when lazy.nvim has not loaded telescope.nvim yet. -- - -- Nvim 0.11+ sets *global* defaults grr/gri/grt/gO → vim.lsp.buf.* which uses - -- quickfix / loclist. Buffer-local maps here override those for this buffer. + -- Nvim 0.11+ sets *global* defaults grr/gri/grt/gO → vim.lsp.buf.* (quickfix / loclist). + -- Buffer-local maps override. Match kickstart.nvim: grr gri grd gO gW grt (see telescope + -- LspAttach in upstream). `grd` is not a core default — it was only in your fork/telescope. map('grr', function() require('telescope.builtin').lsp_references() end, '[R]eferences') map('gri', function() require('telescope.builtin').lsp_implementations() end, '[I]mplementation') + map('grd', function() require('telescope.builtin').lsp_definitions() end, '[G]oto [D]efinition') map('gO', function() require('telescope.builtin').lsp_document_symbols() end, 'Open Document Symbols') - map('gW', function() require('telescope.builtin').lsp_dynamic_workspace_symbols() end, 'Open Workspace Symbols') - + -- gopls may error on anonymous func types ("cannot find type name from type func(...)"): + -- put the cursor on a named identifier, or use grd on the symbol name — same LSP limit. map('grt', function() require('telescope.builtin').lsp_type_definitions() end, '[G]oto [T]ype Definition') -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) From bdca899d86c0c7c446cb98a3fdc9adb829eb2196 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 4 May 2026 22:24:53 -0400 Subject: [PATCH 50/52] split and test --- lua/custom/plugins/init.lua | 27 +- lua/kickstart/autocmds.lua | 13 + lua/kickstart/diagnostics.lua | 26 ++ lua/kickstart/init.lua | 10 + lua/kickstart/keymaps.lua | 23 ++ lua/kickstart/lazy.lua | 30 ++ lua/kickstart/options.lua | 41 +++ lua/kickstart/plugins/blink.lua | 95 +++++ lua/kickstart/plugins/conform.lua | 61 ++++ lua/kickstart/plugins/gitsigns.lua | 61 +++- lua/kickstart/plugins/guess_indent.lua | 4 + lua/kickstart/plugins/lsp.lua | 421 ++++++++++++++++++++++ lua/kickstart/plugins/mini.lua | 45 +++ lua/kickstart/plugins/mini_icons.lua | 14 + lua/kickstart/plugins/neo-tree.lua | 46 +-- lua/kickstart/plugins/neotest_golang.lua | 6 + lua/kickstart/plugins/render_markdown.lua | 12 + lua/kickstart/plugins/spec.lua | 43 +++ lua/kickstart/plugins/telescope.lua | 160 ++++++++ lua/kickstart/plugins/todo_comments.lua | 13 + lua/kickstart/plugins/tokyonight.lua | 24 ++ lua/kickstart/plugins/treesitter.lua | 57 +++ lua/kickstart/plugins/vim_helm.lua | 11 + lua/kickstart/plugins/which_key.lua | 23 ++ 24 files changed, 1200 insertions(+), 66 deletions(-) create mode 100644 lua/kickstart/autocmds.lua create mode 100644 lua/kickstart/diagnostics.lua create mode 100644 lua/kickstart/init.lua create mode 100644 lua/kickstart/keymaps.lua create mode 100644 lua/kickstart/lazy.lua create mode 100644 lua/kickstart/options.lua create mode 100644 lua/kickstart/plugins/blink.lua create mode 100644 lua/kickstart/plugins/conform.lua create mode 100644 lua/kickstart/plugins/guess_indent.lua create mode 100644 lua/kickstart/plugins/lsp.lua create mode 100644 lua/kickstart/plugins/mini.lua create mode 100644 lua/kickstart/plugins/mini_icons.lua create mode 100644 lua/kickstart/plugins/neotest_golang.lua create mode 100644 lua/kickstart/plugins/render_markdown.lua create mode 100644 lua/kickstart/plugins/spec.lua create mode 100644 lua/kickstart/plugins/telescope.lua create mode 100644 lua/kickstart/plugins/todo_comments.lua create mode 100644 lua/kickstart/plugins/tokyonight.lua create mode 100644 lua/kickstart/plugins/treesitter.lua create mode 100644 lua/kickstart/plugins/vim_helm.lua create mode 100644 lua/kickstart/plugins/which_key.lua diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index d1ec2e41be7..69190bb3fde 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,7 +1,4 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information +-- Add plugins here (neo-tree lives in `lua/kickstart/plugins/neo-tree.lua`). ---@module 'lazy' ---@type LazySpec @@ -15,31 +12,9 @@ return { }, ft = { 'http', 'rest' }, opts = { - -- your configuration comes here global_keymaps = false, global_keymaps_prefix = 'R', kulala_keymaps_prefix = '', }, }, - { - 'nvim-neo-tree/neo-tree.nvim', - version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - 'MunifTanjim/nui.nvim', - 'nvim-tree/nvim-web-devicons', - }, - lazy = false, - opts = { - filesystem = { - visible = false, - window = { - mappings = { - ['.'] = 'set_root', -- Set current directory as root - ['H'] = 'toggle_hidden', -- Toggle hidden files with 'H' - }, - }, - }, - }, - }, } diff --git a/lua/kickstart/autocmds.lua b/lua/kickstart/autocmds.lua new file mode 100644 index 00000000000..78f366b4042 --- /dev/null +++ b/lua/kickstart/autocmds.lua @@ -0,0 +1,13 @@ +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, +}) + +vim.api.nvim_create_autocmd('FileType', { + group = vim.api.nvim_create_augroup('kickstart-markdown-safe-read', { clear = true }), + pattern = 'markdown', + callback = function() + vim.opt_local.modeline = false + end, +}) diff --git a/lua/kickstart/diagnostics.lua b/lua/kickstart/diagnostics.lua new file mode 100644 index 00000000000..daceaf49a29 --- /dev/null +++ b/lua/kickstart/diagnostics.lua @@ -0,0 +1,26 @@ +vim.diagnostic.config { + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = true, + 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, + }, +} diff --git a/lua/kickstart/init.lua b/lua/kickstart/init.lua new file mode 100644 index 00000000000..d8b4c790d42 --- /dev/null +++ b/lua/kickstart/init.lua @@ -0,0 +1,10 @@ +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +vim.g.have_nerd_font = true + +require 'kickstart.options' +require 'kickstart.keymaps' +require 'kickstart.autocmds' +require 'kickstart.diagnostics' +require 'kickstart.lazy' diff --git a/lua/kickstart/keymaps.lua b/lua/kickstart/keymaps.lua new file mode 100644 index 00000000000..ec39d10b3c7 --- /dev/null +++ b/lua/kickstart/keymaps.lua @@ -0,0 +1,23 @@ +vim.keymap.set('n', '', 'nohlsearch') + +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + +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' }) + +vim.keymap.set('n', 'th', ':split | terminal', { desc = 'Terminal horizontal split' }) +vim.keymap.set('n', 'tv', ':vsplit | terminal', { desc = 'Terminal vertical split' }) +vim.keymap.set('n', 'tt', ':tabnew | terminal', { desc = 'Terminal in new tab' }) +vim.keymap.set('n', 'tf', ':ToggleTerm', { desc = 'Toggle floating terminal' }) + +vim.keymap.set('x', 'p', '"_dP', { noremap = true, silent = true }) + +local git_links = require 'custom.git_links' +vim.keymap.set({ 'n', 'v' }, 'go', git_links.open_github, { desc = 'Open in GitHub' }) + +vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'NeoTree Toggle' }) +vim.keymap.set('n', 'z', 'Neotree reveal', { desc = 'NeoTree Reveal' }) diff --git a/lua/kickstart/lazy.lua b/lua/kickstart/lazy.lua new file mode 100644 index 00000000000..90213da2357 --- /dev/null +++ b/lua/kickstart/lazy.lua @@ -0,0 +1,30 @@ +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) + +require('lazy').setup(require 'kickstart.plugins.spec', { + ui = { + icons = vim.g.have_nerd_font and {} or { + cmd = '⌘', + config = '🛠', + event = '📅', + ft = '📂', + init = '⚙', + keys = '🗝', + plugin = '🔌', + runtime = '💻', + require = '🌙', + source = '📄', + start = '🚀', + task = '📌', + lazy = '💤 ', + }, + }, +}) diff --git a/lua/kickstart/options.lua b/lua/kickstart/options.lua new file mode 100644 index 00000000000..748a7d91762 --- /dev/null +++ b/lua/kickstart/options.lua @@ -0,0 +1,41 @@ +-- Options: see `:help vim.o` and `:help option-list` + +vim.o.number = true + +vim.o.mouse = 'a' + +vim.o.showmode = false + +vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) + +vim.o.breakindent = true + +vim.o.undofile = true + +vim.o.ignorecase = true +vim.o.smartcase = true + +vim.o.signcolumn = 'yes' + +vim.o.updatetime = 250 + +vim.o.timeoutlen = 300 + +vim.o.splitright = true +vim.o.splitbelow = true + +vim.o.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +vim.o.inccommand = 'split' + +vim.o.cursorline = true + +vim.o.scrolloff = 10 + +vim.o.confirm = true + +vim.opt.number = true +vim.opt.relativenumber = true + +vim.opt.autoread = true diff --git a/lua/kickstart/plugins/blink.lua b/lua/kickstart/plugins/blink.lua new file mode 100644 index 00000000000..46b7466eaec --- /dev/null +++ b/lua/kickstart/plugins/blink.lua @@ -0,0 +1,95 @@ +---@type LazySpec +return { +{ -- 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 :h blink-cmp-config-keymap for defining your own keymap + preset = 'super-tab', + + -- 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 :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 }, + }, +}, +} diff --git a/lua/kickstart/plugins/conform.lua b/lua/kickstart/plugins/conform.lua new file mode 100644 index 00000000000..84b0ef56a21 --- /dev/null +++ b/lua/kickstart/plugins/conform.lua @@ -0,0 +1,61 @@ +---@type LazySpec +return { +{ -- 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) + -- 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, + typescript = true, + typescriptreact = true, + javascript = true, + javascriptreact = true, + python = true, + sql = true, + json = true, + } + if disable_filetypes[vim.bo[bufnr].filetype] then + return nil + 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 = { + lua = { 'stylua' }, + sql = { 'sql_formatter' }, + json = { 'prettier' }, + -- 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 }, + }, + formatters = { + ['sql_formatter'] = { + prepend_args = { '-l', 'postgresql', '-c', '{"useTabs": true}' }, + }, + }, + }, +}, +} diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index 500ea6c4085..e83ce140d37 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -1,15 +1,18 @@ --- Adds git related signs to the gutter, as well as utilities for managing changes --- 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 { +{ -- 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 + }, on_attach = function(bufnr) local gitsigns = require 'gitsigns' @@ -19,6 +22,17 @@ return { vim.keymap.set(mode, l, r, opts) end + -- Detect branch once per buffer attach + local primary_branch = 'main' + local handle = io.popen 'git branch --list main master' + if handle then + local result = handle:read '*a' + handle:close() + if not string.find(result, 'main') and string.find(result, 'master') then + primary_branch = 'master' + end + end + -- Navigation map('n', ']c', function() if vim.wo.diff then @@ -37,27 +51,36 @@ return { 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('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('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', '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', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) + map('n', 'hB', gitsigns.blame, { desc = 'git [B]lame toggle' }) + + -- Diff Mappings 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' }) + map('n', 'hD', function() + gitsigns.diffthis '@' + end, { desc = 'git [D]iff against last commit' }) - -- Text object - map({ 'o', 'x' }, 'ih', gitsigns.select_hunk) + map('n', 'hm', function() + gitsigns.diffthis(primary_branch) + end, { desc = 'git diff against [m]ain/master' }) + + -- Toggles + map('n', 'ht', gitsigns.toggle_current_line_blame, { desc = '[t]oggle git show blame line' }) + map('n', 'hv', gitsigns.preview_hunk_inline, { desc = 'toggle git show deleted ([v]iew)' }) end, }, +}, } diff --git a/lua/kickstart/plugins/guess_indent.lua b/lua/kickstart/plugins/guess_indent.lua new file mode 100644 index 00000000000..80ddf99b77b --- /dev/null +++ b/lua/kickstart/plugins/guess_indent.lua @@ -0,0 +1,4 @@ +---@type LazySpec +return { + { 'NMAC427/guess-indent.nvim', opts = {} }, +} diff --git a/lua/kickstart/plugins/lsp.lua b/lua/kickstart/plugins/lsp.lua new file mode 100644 index 00000000000..ce5e251f55f --- /dev/null +++ b/lua/kickstart/plugins/lsp.lua @@ -0,0 +1,421 @@ +---@type LazySpec +return { +{ + -- Main LSP Configuration + 'neovim/nvim-lspconfig', + dependencies = { + -- Load before this plugin's config runs so get_lsp_capabilities() exists even when + -- LSP startup happens before VimEnter (e.g. `nvim file.py`). + { 'saghen/blink.cmp', version = '1.*' }, + -- 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') + + -- Defer requiring Telescope until keypress: on `nvim file.py`, LspAttach can run + -- before VimEnter, when lazy.nvim has not loaded telescope.nvim yet. + -- + -- Nvim 0.11+ sets *global* defaults grr/gri/grt/gO → vim.lsp.buf.* (quickfix / loclist). + -- Buffer-local maps override. Match kickstart.nvim: grr gri grd gO gW grt (see telescope + -- LspAttach in upstream). `grd` is not a core default — it was only in your fork/telescope. + map('grr', function() require('telescope.builtin').lsp_references() end, '[R]eferences') + map('gri', function() require('telescope.builtin').lsp_implementations() end, '[I]mplementation') + map('grd', function() require('telescope.builtin').lsp_definitions() end, '[G]oto [D]efinition') + map('gO', function() require('telescope.builtin').lsp_document_symbols() end, 'Open Document Symbols') + map('gW', function() require('telescope.builtin').lsp_dynamic_workspace_symbols() end, 'Open Workspace Symbols') + -- gopls may error on anonymous func types ("cannot find type name from type func(...)"): + -- put the cursor on a named identifier, or use grd on the symbol name — same LSP limit. + map('grt', function() require('telescope.builtin').lsp_type_definitions() end, '[G]oto [T]ype Definition') + + -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) + 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 + + local client = vim.lsp.get_client_by_id(event.data.client_id) + + -- ========================================================================= + -- NEW: The gopls Semantic Tokens Workaround + -- ========================================================================= + if client and client.name == 'gopls' and not client.server_capabilities.semanticTokensProvider then + local semantic = client.config.capabilities.textDocument.semanticTokens + if semantic then + client.server_capabilities.semanticTokensProvider = { + full = true, + legend = { + tokenTypes = semantic.tokenTypes, + tokenModifiers = semantic.tokenModifiers, + }, + range = true, + } + 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). + 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, + 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(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') + 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 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 + ---@type table + local servers = { + clangd = {}, + + -- ========================================================================= + -- UPDATED: The unified "God Mode" gopls config + -- ========================================================================= + gopls = { + settings = { + gopls = { + buildFlags = { + '-tags', + 'functional,integration,small,medium,large', + }, + + -- Completion settings + completeUnimported = true, + usePlaceholders = true, + deepCompletion = true, + matcher = 'Fuzzy', + + -- Hover and signature help + hoverKind = 'FullDocumentation', + linkTarget = 'pkg.go.dev', + linksInHover = true, + + -- Does this actually help? + expandWorkspaceToModule = true, + + -- Static analysis and diagnostics + staticcheck = true, -- THIS automatically runs the officially supported staticcheck suite + + analyses = { + -- Only natively supported go vet / gopls checks go here + asmdecl = true, + assign = true, + atomic = true, + atomicalign = true, + bools = true, + buildtag = true, + cgocall = true, + composites = true, + copylock = true, + defers = true, + directive = true, + errorsas = true, + framepointer = true, + httpresponse = true, + ifaceassert = true, + loopclosure = true, + lostcancel = true, + nilfunc = true, + printf = true, + shift = true, + sigchanyzer = true, + slog = true, + stdmethods = true, + stringintconv = true, + structtag = true, + testinggoroutine = true, + tests = true, + timeformat = true, + unmarshal = true, + unreachable = true, + unsafeptr = true, + unusedresult = true, + deepequalerrors = true, + embed = true, + fillreturns = true, + infertypeargs = true, + nilness = true, + nonewvars = true, + noresultvalues = true, + shadow = true, + simplifycompositelit = true, + simplifyrange = true, + simplifyslice = true, + sortslice = true, + stubmethods = true, + undeclaredname = true, + unusedparams = true, + unusedvariable = true, + unusedwrite = true, + useany = true, + }, + + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, + }, + + codelenses = { + gc_details = true, + generate = true, + regenerate_cgo = true, + test = true, + tidy = true, + upgrade_dependency = true, + vendor = true, + vulncheck = true, + }, + + gofumpt = true, + directoryFilters = { '-vendor' }, + }, + }, + + on_attach = function(client, bufnr) + if client.name == 'gopls' then + vim.api.nvim_create_autocmd('BufWritePre', { + buffer = bufnr, + callback = function() + vim.lsp.buf.code_action { + context = { diagnostics = {}, only = { 'source.organizeImports' } }, + apply = true, + } + end, + }) + end + end, + }, + -- ========================================================================= + + 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 + -- + -- But for many setups, the LSP (`ts_ls`) will work just fine + ts_ls = { + settings = {}, + on_attach = function(client, bufnr) + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + + -- Disable format on save for this buffer + vim.api.nvim_set_option_value('formatoptions', '', { buf = bufnr }) + vim.api.nvim_create_autocmd('BufWritePre', { + buffer = bufnr, + callback = function() + -- Do nothing, preventing format on save + end, + }) + end, + }, + + 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) + }, + }, + }, + } + -- + -- -- + -- -- FORCE GOPLS SETUP + -- -- + -- local gopls_config = servers.gopls + -- gopls_config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, gopls_config.capabilities or {}) + -- require('lspconfig').gopls.setup(gopls_config) + -- + + -- 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, { + 'stylua', -- Used to format Lua code + 'sql-formatter', + 'prettier', + 'staticcheck', + 'goimports', + 'gofumpt', + 'gomodifytags', + 'impl', + 'golangci-lint', + 'delve', + }) + + 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, + -- We are removing the handlers block here to prevent Mason + -- from silently skipping unmanaged/globally-installed binaries. + } + + -- Ensure lspconfig is loaded so defaults are populated in Nvim 0.11 + require 'lspconfig' + + -- Explicitly set up all servers defined in the servers table. + for server_name, server in pairs(servers) do + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + + if vim.fn.has 'nvim-0.11' == 1 then + -- Neovim 0.11+ native config API (prevents deprecation warning) + local def = vim.lsp.config[server_name] or {} + vim.lsp.config[server_name] = vim.tbl_deep_extend('force', def, server) + vim.lsp.enable(server_name) + else + -- Neovim 0.10 and earlier legacy API + require('lspconfig')[server_name].setup(server) + end + end + end, +}, +} diff --git a/lua/kickstart/plugins/mini.lua b/lua/kickstart/plugins/mini.lua new file mode 100644 index 00000000000..9be7ada7f61 --- /dev/null +++ b/lua/kickstart/plugins/mini.lua @@ -0,0 +1,45 @@ +---@type LazySpec +return { +{ -- 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, +}, +} diff --git a/lua/kickstart/plugins/mini_icons.lua b/lua/kickstart/plugins/mini_icons.lua new file mode 100644 index 00000000000..3e6c96a0699 --- /dev/null +++ b/lua/kickstart/plugins/mini_icons.lua @@ -0,0 +1,14 @@ +---@type LazySpec +return { +{ + 'nvim-mini/mini.icons', + opts = { + file = { + ['.go-version'] = { glyph = '', hl = 'MiniIconsBlue' }, + }, + filetype = { + gotmpl = { glyph = '󰟓', hl = 'MiniIconsGrey' }, + }, + }, +}, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index 2775623e64a..64f1ebb9a44 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -1,28 +1,32 @@ --- Neo-tree is a Neovim plugin to browse the file system --- https://github.com/nvim-neo-tree/neo-tree.nvim +-- Neo-tree: 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 = { - use_libuv_file_watcher = true, - mappings = { - ['\\'] = 'close_window', + { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', + 'MunifTanjim/nui.nvim', + }, + lazy = false, + keys = { + { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, + }, + ---@module 'neo-tree' + ---@type neotree.Config + opts = { + filesystem = { + visible = false, + window = { + use_libuv_file_watcher = true, + mappings = { + ['\\'] = 'close_window', + ['.'] = 'set_root', + ['H'] = 'toggle_hidden', + }, }, }, }, diff --git a/lua/kickstart/plugins/neotest_golang.lua b/lua/kickstart/plugins/neotest_golang.lua new file mode 100644 index 00000000000..043d0d372af --- /dev/null +++ b/lua/kickstart/plugins/neotest_golang.lua @@ -0,0 +1,6 @@ +---@type LazySpec +return { +{ + 'fredrikaverpil/neotest-golang', +}, +} diff --git a/lua/kickstart/plugins/render_markdown.lua b/lua/kickstart/plugins/render_markdown.lua new file mode 100644 index 00000000000..53fb986c60d --- /dev/null +++ b/lua/kickstart/plugins/render_markdown.lua @@ -0,0 +1,12 @@ +---@type LazySpec +return { +{ + 'MeanderingProgrammer/render-markdown.nvim', + dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, + ft = { 'markdown', 'markdown.mdx' }, + opts = { + latex = { enabled = false }, + completions = { lsp = { enabled = true }, blink = { enabled = true } }, + }, +}, +} diff --git a/lua/kickstart/plugins/spec.lua b/lua/kickstart/plugins/spec.lua new file mode 100644 index 00000000000..71cfad65562 --- /dev/null +++ b/lua/kickstart/plugins/spec.lua @@ -0,0 +1,43 @@ +---@param out table +---@param chunk LazySpec|LazySpec[] +local function append_specs(out, chunk) + if type(chunk[1]) == 'string' then + out[#out + 1] = chunk + return + end + for i = 1, #chunk do + out[#out + 1] = chunk[i] + end +end + +---@type LazySpec +local specs = {} +local mods = { + 'kickstart.plugins.guess_indent', + 'kickstart.plugins.gitsigns', + 'kickstart.plugins.which_key', + 'kickstart.plugins.render_markdown', + 'kickstart.plugins.telescope', + 'kickstart.plugins.lsp', + 'kickstart.plugins.conform', + 'kickstart.plugins.blink', + 'kickstart.plugins.tokyonight', + 'kickstart.plugins.todo_comments', + 'kickstart.plugins.mini', + 'kickstart.plugins.treesitter', + 'kickstart.plugins.vim_helm', + 'kickstart.plugins.neotest_golang', + 'kickstart.plugins.mini_icons', + 'kickstart.plugins.debug', + 'kickstart.plugins.indent_line', + 'kickstart.plugins.lint', + 'kickstart.plugins.autopairs', + 'kickstart.plugins.neo-tree', + 'custom.plugins', +} + +for _, mod in ipairs(mods) do + append_specs(specs, require(mod)) +end + +return specs diff --git a/lua/kickstart/plugins/telescope.lua b/lua/kickstart/plugins/telescope.lua new file mode 100644 index 00000000000..6071d6d3d5b --- /dev/null +++ b/lua/kickstart/plugins/telescope.lua @@ -0,0 +1,160 @@ +---@type LazySpec +return { +{ -- 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', 'sD', function() + local current_dir = vim.fn.expand '%:p:h' -- Gets the absolute path to the current file's folder + require('telescope.builtin').diagnostics { + cwd = current_dir, + -- This ensures it searches within the directory, not just the file + root_dir = current_dir, + } + end, { desc = '[S]earch [D]iagnostics in current directory' }) + 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' }) + + -- vim.keymap.set('n', 'g', '', { desc = '[Git]' }) + -- vim.keymap.set('n', 'gl', builtin.git_bcommits, { desc = '[Git] Buffer Commits' }) + -- vim.keymap.set('n', 'gr', builtin.git_bcommits_range, { desc = '[Git] Buffer Commits Range' }) + -- vim.keymap.set('n', 'gb', builtin.git_branches, { desc = '[Git] Branches' }) + -- vim.keymap.set('n', 'gc', builtin.git_commits, { desc = '[Git] Commits' }) + -- vim.keymap.set('n', 'gf', builtin.git_files, { desc = '[Git] Files' }) + -- vim.keymap.set('n', 'gt', builtin.git_stash, { desc = '[Git] Stash' }) + -- vim.keymap.set('n', 'gs', builtin.git_status, { desc = '[Git] Status' }) + -- vim.keymap.set('n', 'gm', function() + -- builtin.git_commits { + -- git_command = { 'git', 'log', '--oneline', '--decorate', 'main..HEAD' }, + -- } + -- end, { desc = '[Git] Commits ahead of main' }) + + -- 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. + 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' }) + + vim.keymap.set('n', 'sag', function() + builtin.live_grep { + prompt_title = 'Live Grep (All Files)', + -- This function adds the flags to the underlying grep command + additional_args = function(args) + return { '--hidden', '--no-ignore', '--no-ignore-parent', '--glob=!**/.git/*' } + end, + } + end, { desc = '[S]earch [A]ll Files [G]rep)' }) + + vim.keymap.set('n', 'saf', function() + builtin.find_files { + prompt_title = 'Find All Files (Hidden + Ignored)', + hidden = true, -- Show hidden dotfiles + no_ignore = true, -- Ignore .gitignore rules + no_ignore_parent = true, -- Ignore .gitignore rules of all parents, too + file_ignore_patterns = { '.git/' }, -- <--- Explicitly remove the .git folder + } + end, { desc = '[S]earch [A]ll [F]iles' }) + end, +}, +} diff --git a/lua/kickstart/plugins/todo_comments.lua b/lua/kickstart/plugins/todo_comments.lua new file mode 100644 index 00000000000..93c2395ca7a --- /dev/null +++ b/lua/kickstart/plugins/todo_comments.lua @@ -0,0 +1,13 @@ +---@type LazySpec +return { +-- 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 }, +}, +} diff --git a/lua/kickstart/plugins/tokyonight.lua b/lua/kickstart/plugins/tokyonight.lua new file mode 100644 index 00000000000..65b6e41ee11 --- /dev/null +++ b/lua/kickstart/plugins/tokyonight.lua @@ -0,0 +1,24 @@ +---@type LazySpec +return { +{ -- 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, +}, +} diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua new file mode 100644 index 00000000000..58a764d5a10 --- /dev/null +++ b/lua/kickstart/plugins/treesitter.lua @@ -0,0 +1,57 @@ +---@type LazySpec +return { +{ -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + lazy = false, + 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', + 'go', + 'gomod', + 'gowork', + 'gosum', + 'rust', + 'python', + 'json', + 'toml', + 'css', + 'helm', + 'dockerfile', + 'bash', + 'yaml', + 'sql', + 'hcl', + 'terraform', + }, + -- 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 +}, +} diff --git a/lua/kickstart/plugins/vim_helm.lua b/lua/kickstart/plugins/vim_helm.lua new file mode 100644 index 00000000000..8c3baea9dec --- /dev/null +++ b/lua/kickstart/plugins/vim_helm.lua @@ -0,0 +1,11 @@ +---@type LazySpec +return { +{ + 'towolf/vim-helm', + event = 'BufReadPre', + config = function() + -- This plugin automatically detects helm files (including .tpl) + -- and sets the filetype to "helm" instead of "yaml" + end, +}, +} diff --git a/lua/kickstart/plugins/which_key.lua b/lua/kickstart/plugins/which_key.lua new file mode 100644 index 00000000000..cae42bb1adf --- /dev/null +++ b/lua/kickstart/plugins/which_key.lua @@ -0,0 +1,23 @@ +---@type LazySpec +return { +{ -- 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' } }, + }, + }, +}, +} From ddba4459ff247a4bed6d6b7cf858b8cd53055d03 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 4 May 2026 22:27:20 -0400 Subject: [PATCH 51/52] thing --- init.lua | 1414 +----------------------------------------------------- 1 file changed, 5 insertions(+), 1409 deletions(-) diff --git a/init.lua b/init.lua index ff7c3c084d2..099e5c7a34e 100644 --- a/init.lua +++ b/init.lua @@ -1,1411 +1,7 @@ --[[ + Neovim entrypoint: `lua/kickstart/init.lua` sets options, keymaps, autocommands, + diagnostics, then bootstraps lazy.nvim and loads `kickstart.plugins.spec`. + Kickstart’s long banner lived here originally; see upstream kickstart.nvim README if you want it back. +]] -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) ---]] - --- 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 = true - --- [[ 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 - --- 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 - --- 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 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 - --- Keep signcolumn on by default -vim.o.signcolumn = 'yes' - --- Decrease update time -vim.o.updatetime = 250 - --- Decrease mapped sequence wait time -vim.o.timeoutlen = 300 - --- 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 = '␣' } - --- Preview substitutions live, as you type! -vim.o.inccommand = 'split' - --- 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 - --- 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()` - --- 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 } }, - - -- 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 }, -} - -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' }) - --- 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' }) - --- 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" }) - --- Open terminal in horizontal split -vim.keymap.set('n', 'th', ':split | terminal', { desc = 'Terminal horizontal split' }) - --- Open terminal in vertical split -vim.keymap.set('n', 'tv', ':vsplit | terminal', { desc = 'Terminal vertical split' }) - --- Open terminal in new tab -vim.keymap.set('n', 'tt', ':tabnew | terminal', { desc = 'Terminal in new tab' }) - --- Toggle terminal (requires a plugin like toggleterm.nvim) -vim.keymap.set('n', 'tf', ':ToggleTerm', { desc = 'Toggle floating terminal' }) - --- relative line number -vim.opt.number = true -vim.opt.relativenumber = true - --- autoreload when external changes -vim.opt.autoread = true - --- paste does not yank in visual mode --- Make Visual mode paste not clobber the default register -vim.keymap.set('x', 'p', '"_dP', { noremap = true, silent = true }) - --- [[ 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, -}) - --- Safer defaults when reading Markdown (e.g. cloned READMEs): modelines in .md are rare and --- can be abused; preview stays in-editor via render-markdown.nvim (no browser / Electron). -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('kickstart-markdown-safe-read', { clear = true }), - pattern = 'markdown', - callback = function() - vim.opt_local.modeline = false - end, -}) - -local git_links = require 'custom.git_links' -vim.keymap.set({ 'n', 'v' }, 'go', git_links.open_github, { desc = 'Open in GitHub' }) - --- [[ 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 ]] --- --- To check the current status of your plugins, run --- :Lazy --- --- You can press `?` in this menu for help. Use `:q` to close the window --- --- To update plugins you can run --- :Lazy 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 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 = '+' }, ---@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 - }, - 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 - - -- Detect branch once per buffer attach - local primary_branch = 'main' - local handle = io.popen 'git branch --list main master' - if handle then - local result = handle:read '*a' - handle:close() - if not string.find(result, 'main') and string.find(result, 'master') then - primary_branch = 'master' - end - 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' }) - - 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 - 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('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', 'hB', gitsigns.blame, { desc = 'git [B]lame toggle' }) - - -- Diff Mappings - 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', 'hm', function() - gitsigns.diffthis(primary_branch) - end, { desc = 'git diff against [m]ain/master' }) - - -- Toggles - map('n', 'ht', gitsigns.toggle_current_line_blame, { desc = '[t]oggle git show blame line' }) - map('n', 'hv', gitsigns.preview_hunk_inline, { desc = 'toggle git show deleted ([v]iew)' }) - end, - }, - }, - -- 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 - - -- In-buffer Markdown viewing (no external preview server). LaTeX is off so formulas do not - -- spawn optional converters (utftex / latex2text). See :RenderMarkdown toggle - { - 'MeanderingProgrammer/render-markdown.nvim', - dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, - ft = { 'markdown', 'markdown.mdx' }, - opts = { - latex = { enabled = false }, - completions = { lsp = { enabled = true }, blink = { enabled = true } }, - }, - }, - - { -- 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', 'sD', function() - local current_dir = vim.fn.expand '%:p:h' -- Gets the absolute path to the current file's folder - require('telescope.builtin').diagnostics { - cwd = current_dir, - -- This ensures it searches within the directory, not just the file - root_dir = current_dir, - } - end, { desc = '[S]earch [D]iagnostics in current directory' }) - 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' }) - - -- vim.keymap.set('n', 'g', '', { desc = '[Git]' }) - -- vim.keymap.set('n', 'gl', builtin.git_bcommits, { desc = '[Git] Buffer Commits' }) - -- vim.keymap.set('n', 'gr', builtin.git_bcommits_range, { desc = '[Git] Buffer Commits Range' }) - -- vim.keymap.set('n', 'gb', builtin.git_branches, { desc = '[Git] Branches' }) - -- vim.keymap.set('n', 'gc', builtin.git_commits, { desc = '[Git] Commits' }) - -- vim.keymap.set('n', 'gf', builtin.git_files, { desc = '[Git] Files' }) - -- vim.keymap.set('n', 'gt', builtin.git_stash, { desc = '[Git] Stash' }) - -- vim.keymap.set('n', 'gs', builtin.git_status, { desc = '[Git] Status' }) - -- vim.keymap.set('n', 'gm', function() - -- builtin.git_commits { - -- git_command = { 'git', 'log', '--oneline', '--decorate', 'main..HEAD' }, - -- } - -- end, { desc = '[Git] Commits ahead of main' }) - - -- 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. - 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' }) - - vim.keymap.set('n', 'sag', function() - builtin.live_grep { - prompt_title = 'Live Grep (All Files)', - -- This function adds the flags to the underlying grep command - additional_args = function(args) - return { '--hidden', '--no-ignore', '--no-ignore-parent', '--glob=!**/.git/*' } - end, - } - end, { desc = '[S]earch [A]ll Files [G]rep)' }) - - vim.keymap.set('n', 'saf', function() - builtin.find_files { - prompt_title = 'Find All Files (Hidden + Ignored)', - hidden = true, -- Show hidden dotfiles - no_ignore = true, -- Ignore .gitignore rules - no_ignore_parent = true, -- Ignore .gitignore rules of all parents, too - file_ignore_patterns = { '.git/' }, -- <--- Explicitly remove the .git folder - } - end, { desc = '[S]earch [A]ll [F]iles' }) - end, - }, - -- LSP Plugins - { - -- Main LSP Configuration - 'neovim/nvim-lspconfig', - dependencies = { - -- Load before this plugin's config runs so get_lsp_capabilities() exists even when - -- LSP startup happens before VimEnter (e.g. `nvim file.py`). - { 'saghen/blink.cmp', version = '1.*' }, - -- 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') - - -- Defer requiring Telescope until keypress: on `nvim file.py`, LspAttach can run - -- before VimEnter, when lazy.nvim has not loaded telescope.nvim yet. - -- - -- Nvim 0.11+ sets *global* defaults grr/gri/grt/gO → vim.lsp.buf.* (quickfix / loclist). - -- Buffer-local maps override. Match kickstart.nvim: grr gri grd gO gW grt (see telescope - -- LspAttach in upstream). `grd` is not a core default — it was only in your fork/telescope. - map('grr', function() require('telescope.builtin').lsp_references() end, '[R]eferences') - map('gri', function() require('telescope.builtin').lsp_implementations() end, '[I]mplementation') - map('grd', function() require('telescope.builtin').lsp_definitions() end, '[G]oto [D]efinition') - map('gO', function() require('telescope.builtin').lsp_document_symbols() end, 'Open Document Symbols') - map('gW', function() require('telescope.builtin').lsp_dynamic_workspace_symbols() end, 'Open Workspace Symbols') - -- gopls may error on anonymous func types ("cannot find type name from type func(...)"): - -- put the cursor on a named identifier, or use grd on the symbol name — same LSP limit. - map('grt', function() require('telescope.builtin').lsp_type_definitions() end, '[G]oto [T]ype Definition') - - -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) - 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 - - local client = vim.lsp.get_client_by_id(event.data.client_id) - - -- ========================================================================= - -- NEW: The gopls Semantic Tokens Workaround - -- ========================================================================= - if client and client.name == 'gopls' and not client.server_capabilities.semanticTokensProvider then - local semantic = client.config.capabilities.textDocument.semanticTokens - if semantic then - client.server_capabilities.semanticTokensProvider = { - full = true, - legend = { - tokenTypes = semantic.tokenTypes, - tokenModifiers = semantic.tokenModifiers, - }, - range = true, - } - 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). - 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, - 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(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') - end - 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 }, - underline = true, - 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. - -- 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 - ---@type table - local servers = { - clangd = {}, - - -- ========================================================================= - -- UPDATED: The unified "God Mode" gopls config - -- ========================================================================= - gopls = { - settings = { - gopls = { - buildFlags = { - '-tags', - 'functional,integration,small,medium,large', - }, - - -- Completion settings - completeUnimported = true, - usePlaceholders = true, - deepCompletion = true, - matcher = 'Fuzzy', - - -- Hover and signature help - hoverKind = 'FullDocumentation', - linkTarget = 'pkg.go.dev', - linksInHover = true, - - -- Does this actually help? - expandWorkspaceToModule = true, - - -- Static analysis and diagnostics - staticcheck = true, -- THIS automatically runs the officially supported staticcheck suite - - analyses = { - -- Only natively supported go vet / gopls checks go here - asmdecl = true, - assign = true, - atomic = true, - atomicalign = true, - bools = true, - buildtag = true, - cgocall = true, - composites = true, - copylock = true, - defers = true, - directive = true, - errorsas = true, - framepointer = true, - httpresponse = true, - ifaceassert = true, - loopclosure = true, - lostcancel = true, - nilfunc = true, - printf = true, - shift = true, - sigchanyzer = true, - slog = true, - stdmethods = true, - stringintconv = true, - structtag = true, - testinggoroutine = true, - tests = true, - timeformat = true, - unmarshal = true, - unreachable = true, - unsafeptr = true, - unusedresult = true, - deepequalerrors = true, - embed = true, - fillreturns = true, - infertypeargs = true, - nilness = true, - nonewvars = true, - noresultvalues = true, - shadow = true, - simplifycompositelit = true, - simplifyrange = true, - simplifyslice = true, - sortslice = true, - stubmethods = true, - undeclaredname = true, - unusedparams = true, - unusedvariable = true, - unusedwrite = true, - useany = true, - }, - - hints = { - assignVariableTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - constantValues = true, - functionTypeParameters = true, - parameterNames = true, - rangeVariableTypes = true, - }, - - codelenses = { - gc_details = true, - generate = true, - regenerate_cgo = true, - test = true, - tidy = true, - upgrade_dependency = true, - vendor = true, - vulncheck = true, - }, - - gofumpt = true, - directoryFilters = { '-vendor' }, - }, - }, - - on_attach = function(client, bufnr) - if client.name == 'gopls' then - vim.api.nvim_create_autocmd('BufWritePre', { - buffer = bufnr, - callback = function() - vim.lsp.buf.code_action { - context = { diagnostics = {}, only = { 'source.organizeImports' } }, - apply = true, - } - end, - }) - end - end, - }, - -- ========================================================================= - - 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 - -- - -- But for many setups, the LSP (`ts_ls`) will work just fine - ts_ls = { - settings = {}, - on_attach = function(client, bufnr) - client.server_capabilities.documentFormattingProvider = false - client.server_capabilities.documentRangeFormattingProvider = false - - -- Disable format on save for this buffer - vim.api.nvim_set_option_value('formatoptions', '', { buf = bufnr }) - vim.api.nvim_create_autocmd('BufWritePre', { - buffer = bufnr, - callback = function() - -- Do nothing, preventing format on save - end, - }) - end, - }, - - 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) - }, - }, - }, - } - -- - -- -- - -- -- FORCE GOPLS SETUP - -- -- - -- local gopls_config = servers.gopls - -- gopls_config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, gopls_config.capabilities or {}) - -- require('lspconfig').gopls.setup(gopls_config) - -- - - -- 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, { - 'stylua', -- Used to format Lua code - 'sql-formatter', - 'prettier', - 'staticcheck', - 'goimports', - 'gofumpt', - 'gomodifytags', - 'impl', - 'golangci-lint', - 'delve', - }) - - 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, - -- We are removing the handlers block here to prevent Mason - -- from silently skipping unmanaged/globally-installed binaries. - } - - -- Ensure lspconfig is loaded so defaults are populated in Nvim 0.11 - require 'lspconfig' - - -- Explicitly set up all servers defined in the servers table. - for server_name, server in pairs(servers) do - server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) - - if vim.fn.has 'nvim-0.11' == 1 then - -- Neovim 0.11+ native config API (prevents deprecation warning) - local def = vim.lsp.config[server_name] or {} - vim.lsp.config[server_name] = vim.tbl_deep_extend('force', def, server) - vim.lsp.enable(server_name) - else - -- Neovim 0.10 and earlier legacy API - require('lspconfig')[server_name].setup(server) - end - 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) - -- 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, - typescript = true, - typescriptreact = true, - javascript = true, - javascriptreact = true, - python = true, - sql = true, - json = true, - } - if disable_filetypes[vim.bo[bufnr].filetype] then - return nil - 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 = { - lua = { 'stylua' }, - sql = { 'sql_formatter' }, - json = { 'prettier' }, - -- 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 }, - }, - formatters = { - ['sql_formatter'] = { - prepend_args = { '-l', 'postgresql', '-c', '{"useTabs": 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 :h blink-cmp-config-keymap for defining your own keymap - preset = 'super-tab', - - -- 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 :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. - -- 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, - }, - - { -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - lazy = false, - 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', - 'go', - 'gomod', - 'gowork', - 'gosum', - 'rust', - 'python', - 'json', - 'toml', - 'css', - 'helm', - 'dockerfile', - 'bash', - 'yaml', - 'sql', - 'hcl', - 'terraform', - }, - -- 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 - }, - { - 'towolf/vim-helm', - event = 'BufReadPre', - config = function() - -- This plugin automatically detects helm files (including .tpl) - -- and sets the filetype to "helm" instead of "yaml" - end, - }, - { - 'fredrikaverpil/neotest-golang', - }, - { - 'nvim-mini/mini.icons', - opts = { - file = { - ['.go-version'] = { glyph = '', hl = 'MiniIconsBlue' }, - }, - filetype = { - gotmpl = { glyph = '󰟓', hl = 'MiniIconsGrey' }, - }, - }, - }, - - -- 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', - vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'NeoTree Toggle' }), - vim.keymap.set('n', 'z', 'Neotree reveal', { desc = 'NeoTree Reveal' }), - require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps - require 'custom.plugins', - - -- 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 = '💤 ', - }, - }, -}) - --- The line beneath this is called `modeline`. See `:help modeline` --- vim: ts=2 sts=2 sw=2 et +require 'kickstart' From 6d7ac09a9e2b7523d895b136a386149a6ea862e1 Mon Sep 17 00:00:00 2001 From: jordanyono Date: Mon, 4 May 2026 22:38:02 -0400 Subject: [PATCH 52/52] thing --- init.lua | 17 ++++-- lua/custom/git_links.lua | 15 +++++ lua/custom/plugins/init.lua | 16 ++++- lua/kickstart/autocmds.lua | 13 ---- lua/kickstart/init.lua | 10 ---- lua/kickstart/plugins/autopairs.lua | 10 ---- lua/kickstart/plugins/guess_indent.lua | 4 -- lua/kickstart/plugins/indent_line.lua | 13 ---- lua/kickstart/plugins/mini_icons.lua | 14 ----- lua/kickstart/plugins/neotest_golang.lua | 6 -- lua/kickstart/plugins/render_markdown.lua | 12 ---- lua/kickstart/plugins/spec.lua | 43 -------------- lua/kickstart/plugins/todo_comments.lua | 13 ---- lua/kickstart/plugins/vim_helm.lua | 11 ---- lua/plugins/kickstart/autocmds.lua | 28 +++++++++ lua/{ => plugins}/kickstart/diagnostics.lua | 15 +++++ lua/{ => plugins}/kickstart/health.lua | 19 ++++-- lua/plugins/kickstart/init.lua | 27 +++++++++ lua/{ => plugins}/kickstart/keymaps.lua | 16 +++++ lua/{ => plugins}/kickstart/lazy.lua | 17 +++++- lua/{ => plugins}/kickstart/options.lua | 15 ++++- lua/plugins/kickstart/plugins/autopairs.lua | 22 +++++++ lua/{ => plugins}/kickstart/plugins/blink.lua | 16 +++++ .../kickstart/plugins/conform.lua | 15 +++++ lua/{ => plugins}/kickstart/plugins/debug.lua | 21 ++++--- .../kickstart/plugins/gitsigns.lua | 15 +++++ .../kickstart/plugins/guess_indent.lua | 19 ++++++ lua/plugins/kickstart/plugins/indent_line.lua | 26 ++++++++ lua/{ => plugins}/kickstart/plugins/lint.lua | 15 ++++- lua/{ => plugins}/kickstart/plugins/lsp.lua | 16 +++++ lua/{ => plugins}/kickstart/plugins/mini.lua | 15 +++++ lua/plugins/kickstart/plugins/mini_icons.lua | 29 +++++++++ .../kickstart/plugins/neo-tree.lua | 15 ++++- .../kickstart/plugins/neotest_golang.lua | 21 +++++++ .../kickstart/plugins/render_markdown.lua | 27 +++++++++ lua/plugins/kickstart/plugins/spec.lua | 59 +++++++++++++++++++ .../kickstart/plugins/telescope.lua | 15 +++++ .../kickstart/plugins/todo_comments.lua | 27 +++++++++ .../kickstart/plugins/tokyonight.lua | 15 +++++ .../kickstart/plugins/treesitter.lua | 15 +++++ lua/plugins/kickstart/plugins/vim_helm.lua | 25 ++++++++ .../kickstart/plugins/which_key.lua | 15 +++++ 42 files changed, 606 insertions(+), 171 deletions(-) delete mode 100644 lua/kickstart/autocmds.lua delete mode 100644 lua/kickstart/init.lua delete mode 100644 lua/kickstart/plugins/autopairs.lua delete mode 100644 lua/kickstart/plugins/guess_indent.lua delete mode 100644 lua/kickstart/plugins/indent_line.lua delete mode 100644 lua/kickstart/plugins/mini_icons.lua delete mode 100644 lua/kickstart/plugins/neotest_golang.lua delete mode 100644 lua/kickstart/plugins/render_markdown.lua delete mode 100644 lua/kickstart/plugins/spec.lua delete mode 100644 lua/kickstart/plugins/todo_comments.lua delete mode 100644 lua/kickstart/plugins/vim_helm.lua create mode 100644 lua/plugins/kickstart/autocmds.lua rename lua/{ => plugins}/kickstart/diagnostics.lua (63%) rename lua/{ => plugins}/kickstart/health.lua (74%) create mode 100644 lua/plugins/kickstart/init.lua rename lua/{ => plugins}/kickstart/keymaps.lua (71%) rename lua/{ => plugins}/kickstart/lazy.lua (59%) rename lua/{ => plugins}/kickstart/options.lua (56%) create mode 100644 lua/plugins/kickstart/plugins/autopairs.lua rename lua/{ => plugins}/kickstart/plugins/blink.lua (87%) rename lua/{ => plugins}/kickstart/plugins/conform.lua (80%) rename lua/{ => plugins}/kickstart/plugins/debug.lua (90%) rename lua/{ => plugins}/kickstart/plugins/gitsigns.lua (87%) create mode 100644 lua/plugins/kickstart/plugins/guess_indent.lua create mode 100644 lua/plugins/kickstart/plugins/indent_line.lua rename lua/{ => plugins}/kickstart/plugins/lint.lua (82%) rename lua/{ => plugins}/kickstart/plugins/lsp.lua (96%) rename lua/{ => plugins}/kickstart/plugins/mini.lua (77%) create mode 100644 lua/plugins/kickstart/plugins/mini_icons.lua rename lua/{ => plugins}/kickstart/plugins/neo-tree.lua (57%) create mode 100644 lua/plugins/kickstart/plugins/neotest_golang.lua create mode 100644 lua/plugins/kickstart/plugins/render_markdown.lua create mode 100644 lua/plugins/kickstart/plugins/spec.lua rename lua/{ => plugins}/kickstart/plugins/telescope.lua (93%) create mode 100644 lua/plugins/kickstart/plugins/todo_comments.lua rename lua/{ => plugins}/kickstart/plugins/tokyonight.lua (67%) rename lua/{ => plugins}/kickstart/plugins/treesitter.lua (77%) create mode 100644 lua/plugins/kickstart/plugins/vim_helm.lua rename lua/{ => plugins}/kickstart/plugins/which_key.lua (60%) diff --git a/init.lua b/init.lua index 099e5c7a34e..74a1a4ca5a4 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,16 @@ --[[ - Neovim entrypoint: `lua/kickstart/init.lua` sets options, keymaps, autocommands, - diagnostics, then bootstraps lazy.nvim and loads `kickstart.plugins.spec`. - Kickstart’s long banner lived here originally; see upstream kickstart.nvim README if you want it back. + Path: init.lua (Neovim config root) + Module: none — Neovim executes this file before any Lua `require`. + + Purpose + Single entrypoint for your configuration. Everything else lives under + `lua/` so this file stays small and easy to skim. + + Rationale + A minimal root `init.lua` avoids duplicating logic that belongs in modular + Lua modules and matches common Neovim + lazy.nvim layouts. + + See `:help config` and `:help lua-require`. ]] -require 'kickstart' +require 'plugins.kickstart' diff --git a/lua/custom/git_links.lua b/lua/custom/git_links.lua index 001346c4086..88155b03ba8 100644 --- a/lua/custom/git_links.lua +++ b/lua/custom/git_links.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/custom/git_links.lua + Module: custom.git_links + + Purpose + Opens the current buffer’s file on GitHub (or compatible origin) in the + browser, including a line or range anchor from Normal or Visual mode. + + Rationale + Small, focused utility used by `plugins.kickstart.keymaps` (`go`). + Kept under `custom/` so it stays clearly “yours” vs. generated plugin specs. + + Dependencies: git(1), xdg-open (Linux); file must be tracked by git. +]] + local M = {} M.open_github = function() diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 69190bb3fde..50c494f5fbf 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,4 +1,18 @@ --- Add plugins here (neo-tree lives in `lua/kickstart/plugins/neo-tree.lua`). +--[[ + Path: lua/custom/plugins/init.lua + Module: custom.plugins + + Purpose + Lazy.nvim specs for plugins that are not part of the main `plugins.kickstart` + tree (e.g. HTTP client, experimental additions). + + Rationale + `plugins.kickstart.plugins.spec` appends this module last so your personal + plugins stay merge-friendly and easy to find. Neo-tree and core stack live + under `plugins.kickstart.plugins` instead. + + See `:help lazy.nvim-plugin-spec`. +]] ---@module 'lazy' ---@type LazySpec diff --git a/lua/kickstart/autocmds.lua b/lua/kickstart/autocmds.lua deleted file mode 100644 index 78f366b4042..00000000000 --- a/lua/kickstart/autocmds.lua +++ /dev/null @@ -1,13 +0,0 @@ -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, -}) - -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('kickstart-markdown-safe-read', { clear = true }), - pattern = 'markdown', - callback = function() - vim.opt_local.modeline = false - end, -}) diff --git a/lua/kickstart/init.lua b/lua/kickstart/init.lua deleted file mode 100644 index d8b4c790d42..00000000000 --- a/lua/kickstart/init.lua +++ /dev/null @@ -1,10 +0,0 @@ -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' - -vim.g.have_nerd_font = true - -require 'kickstart.options' -require 'kickstart.keymaps' -require 'kickstart.autocmds' -require 'kickstart.diagnostics' -require 'kickstart.lazy' diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua deleted file mode 100644 index 351dad86cd5..00000000000 --- a/lua/kickstart/plugins/autopairs.lua +++ /dev/null @@ -1,10 +0,0 @@ --- autopairs --- https://github.com/windwp/nvim-autopairs - ----@module 'lazy' ----@type LazySpec -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - opts = {}, -} diff --git a/lua/kickstart/plugins/guess_indent.lua b/lua/kickstart/plugins/guess_indent.lua deleted file mode 100644 index 80ddf99b77b..00000000000 --- a/lua/kickstart/plugins/guess_indent.lua +++ /dev/null @@ -1,4 +0,0 @@ ----@type LazySpec -return { - { 'NMAC427/guess-indent.nvim', opts = {} }, -} diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua deleted file mode 100644 index 946ac7932ab..00000000000 --- a/lua/kickstart/plugins/indent_line.lua +++ /dev/null @@ -1,13 +0,0 @@ --- 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 = {}, -} diff --git a/lua/kickstart/plugins/mini_icons.lua b/lua/kickstart/plugins/mini_icons.lua deleted file mode 100644 index 3e6c96a0699..00000000000 --- a/lua/kickstart/plugins/mini_icons.lua +++ /dev/null @@ -1,14 +0,0 @@ ----@type LazySpec -return { -{ - 'nvim-mini/mini.icons', - opts = { - file = { - ['.go-version'] = { glyph = '', hl = 'MiniIconsBlue' }, - }, - filetype = { - gotmpl = { glyph = '󰟓', hl = 'MiniIconsGrey' }, - }, - }, -}, -} diff --git a/lua/kickstart/plugins/neotest_golang.lua b/lua/kickstart/plugins/neotest_golang.lua deleted file mode 100644 index 043d0d372af..00000000000 --- a/lua/kickstart/plugins/neotest_golang.lua +++ /dev/null @@ -1,6 +0,0 @@ ----@type LazySpec -return { -{ - 'fredrikaverpil/neotest-golang', -}, -} diff --git a/lua/kickstart/plugins/render_markdown.lua b/lua/kickstart/plugins/render_markdown.lua deleted file mode 100644 index 53fb986c60d..00000000000 --- a/lua/kickstart/plugins/render_markdown.lua +++ /dev/null @@ -1,12 +0,0 @@ ----@type LazySpec -return { -{ - 'MeanderingProgrammer/render-markdown.nvim', - dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, - ft = { 'markdown', 'markdown.mdx' }, - opts = { - latex = { enabled = false }, - completions = { lsp = { enabled = true }, blink = { enabled = true } }, - }, -}, -} diff --git a/lua/kickstart/plugins/spec.lua b/lua/kickstart/plugins/spec.lua deleted file mode 100644 index 71cfad65562..00000000000 --- a/lua/kickstart/plugins/spec.lua +++ /dev/null @@ -1,43 +0,0 @@ ----@param out table ----@param chunk LazySpec|LazySpec[] -local function append_specs(out, chunk) - if type(chunk[1]) == 'string' then - out[#out + 1] = chunk - return - end - for i = 1, #chunk do - out[#out + 1] = chunk[i] - end -end - ----@type LazySpec -local specs = {} -local mods = { - 'kickstart.plugins.guess_indent', - 'kickstart.plugins.gitsigns', - 'kickstart.plugins.which_key', - 'kickstart.plugins.render_markdown', - 'kickstart.plugins.telescope', - 'kickstart.plugins.lsp', - 'kickstart.plugins.conform', - 'kickstart.plugins.blink', - 'kickstart.plugins.tokyonight', - 'kickstart.plugins.todo_comments', - 'kickstart.plugins.mini', - 'kickstart.plugins.treesitter', - 'kickstart.plugins.vim_helm', - 'kickstart.plugins.neotest_golang', - 'kickstart.plugins.mini_icons', - 'kickstart.plugins.debug', - 'kickstart.plugins.indent_line', - 'kickstart.plugins.lint', - 'kickstart.plugins.autopairs', - 'kickstart.plugins.neo-tree', - 'custom.plugins', -} - -for _, mod in ipairs(mods) do - append_specs(specs, require(mod)) -end - -return specs diff --git a/lua/kickstart/plugins/todo_comments.lua b/lua/kickstart/plugins/todo_comments.lua deleted file mode 100644 index 93c2395ca7a..00000000000 --- a/lua/kickstart/plugins/todo_comments.lua +++ /dev/null @@ -1,13 +0,0 @@ ----@type LazySpec -return { --- 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 }, -}, -} diff --git a/lua/kickstart/plugins/vim_helm.lua b/lua/kickstart/plugins/vim_helm.lua deleted file mode 100644 index 8c3baea9dec..00000000000 --- a/lua/kickstart/plugins/vim_helm.lua +++ /dev/null @@ -1,11 +0,0 @@ ----@type LazySpec -return { -{ - 'towolf/vim-helm', - event = 'BufReadPre', - config = function() - -- This plugin automatically detects helm files (including .tpl) - -- and sets the filetype to "helm" instead of "yaml" - end, -}, -} diff --git a/lua/plugins/kickstart/autocmds.lua b/lua/plugins/kickstart/autocmds.lua new file mode 100644 index 00000000000..fd3b2f214fd --- /dev/null +++ b/lua/plugins/kickstart/autocmds.lua @@ -0,0 +1,28 @@ +--[[ + Path: lua/plugins/kickstart/autocmds.lua + Module: plugins.kickstart.autocmds + + Purpose + Small, global autocommand hooks: yank highlight feedback and safer defaults + for Markdown buffers (modelines off in untrusted README-style files). + + Rationale + Autocommands belong next to options/keymaps so “editor shell” behavior is + grouped separately from per-plugin `config = function()` blocks. + + See `:help autocmd`, `:help vim.hl.on_yank()`, `:help 'modeline'`. +]] + +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, +}) + +vim.api.nvim_create_autocmd('FileType', { + group = vim.api.nvim_create_augroup('kickstart-markdown-safe-read', { clear = true }), + pattern = 'markdown', + callback = function() + vim.opt_local.modeline = false + end, +}) diff --git a/lua/kickstart/diagnostics.lua b/lua/plugins/kickstart/diagnostics.lua similarity index 63% rename from lua/kickstart/diagnostics.lua rename to lua/plugins/kickstart/diagnostics.lua index daceaf49a29..f9f21ee0a4c 100644 --- a/lua/kickstart/diagnostics.lua +++ b/lua/plugins/kickstart/diagnostics.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/plugins/kickstart/diagnostics.lua + Module: plugins.kickstart.diagnostics + + Purpose + One global `vim.diagnostic.config` for how LSP diagnostics render: signs, + virtual text, floating previews, underline, and sort order. + + Rationale + A single module avoids conflicting `vim.diagnostic.config` calls (e.g. one + at startup and another inside LSP setup) overwriting each other. + + See `:help vim.diagnostic.config()`, `:help diagnostic-signs`. +]] + vim.diagnostic.config { severity_sort = true, float = { border = 'rounded', source = 'if_many' }, diff --git a/lua/kickstart/health.lua b/lua/plugins/kickstart/health.lua similarity index 74% rename from lua/kickstart/health.lua rename to lua/plugins/kickstart/health.lua index ca684516003..01fa319df4f 100644 --- a/lua/kickstart/health.lua +++ b/lua/plugins/kickstart/health.lua @@ -1,9 +1,17 @@ --[[ --- --- This file is not required for your own configuration, --- but helps people determine if their system is setup correctly. --- ---]] + Path: lua/plugins/kickstart/health.lua + Module: plugins.kickstart.health + + Purpose + Optional `:checkhealth` provider: Neovim version gate, common CLI tools + (git, make, unzip, rg), and contextual notes for Mason-related warnings. + + Rationale + Health checks catch environment issues before debugging “mystery” plugin + failures. Safe to ignore if you do not run `:checkhealth`; harmless if loaded. + + See `:help health-dev`, `:checkhealth`. +]] local check_version = function() local verstr = tostring(vim.version()) @@ -20,7 +28,6 @@ local check_version = function() end local check_external_reqs = function() - -- Basic utils: `git`, `make`, `unzip` for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do local is_executable = vim.fn.executable(exe) == 1 if is_executable then diff --git a/lua/plugins/kickstart/init.lua b/lua/plugins/kickstart/init.lua new file mode 100644 index 00000000000..27ff215cf6f --- /dev/null +++ b/lua/plugins/kickstart/init.lua @@ -0,0 +1,27 @@ +--[[ + Path: lua/plugins/kickstart/init.lua + Module: plugins.kickstart + + Purpose + Orchestrates core editor setup: globals, options, keymaps, autocommands, + diagnostics, then installs and loads third-party plugins via lazy.nvim. + + Load order + 1. Leader keys and UI flags must be set before lazy.nvim (plugin keymaps). + 2. Options, keymaps, autocommands, and diagnostics run before plugins so + baseline behavior exists even if a plugin fails to load. + 3. `lazy.lua` runs last and pulls in the full Lazy plugin spec list. + + See `:help mapleader`, `:help vim.g`, `:help lazy.nvim.txt`. +]] + +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +vim.g.have_nerd_font = true + +require 'plugins.kickstart.options' +require 'plugins.kickstart.keymaps' +require 'plugins.kickstart.autocmds' +require 'plugins.kickstart.diagnostics' +require 'plugins.kickstart.lazy' diff --git a/lua/kickstart/keymaps.lua b/lua/plugins/kickstart/keymaps.lua similarity index 71% rename from lua/kickstart/keymaps.lua rename to lua/plugins/kickstart/keymaps.lua index ec39d10b3c7..5c7fa4e75ed 100644 --- a/lua/kickstart/keymaps.lua +++ b/lua/plugins/kickstart/keymaps.lua @@ -1,3 +1,19 @@ +--[[ + Path: lua/plugins/kickstart/keymaps.lua + Module: plugins.kickstart.keymaps + + Purpose + Non-plugin (or minimally coupled) normal-mode maps: search, diagnostics + quickfix, terminal escape, window navigation, GitHub “open in browser,” + Neo-tree toggles, and visual paste without clobbering a register. + + Rationale + Keeping these maps here avoids scattering `vim.keymap.set` across plugin + config files and ensures they exist even before lazy.nvim finishes loading. + + See `:help vim.keymap.set()`, `:help diagnostic-loclist`. +]] + vim.keymap.set('n', '', 'nohlsearch') vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) diff --git a/lua/kickstart/lazy.lua b/lua/plugins/kickstart/lazy.lua similarity index 59% rename from lua/kickstart/lazy.lua rename to lua/plugins/kickstart/lazy.lua index 90213da2357..ae2d9fec902 100644 --- a/lua/kickstart/lazy.lua +++ b/lua/plugins/kickstart/lazy.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/plugins/kickstart/lazy.lua + Module: plugins.kickstart.lazy + + Purpose + Bootstraps folke/lazy.nvim if missing, prepends it to runtimepath, and calls + `lazy.setup()` with the aggregated plugin specification plus UI icon prefs. + + Rationale + lazy.nvim must be on `runtimepath` before `require('lazy')`. Keeping clone + + setup here isolates plugin-manager mechanics from editor options/keymaps. + + See `:help lazy.nvim.txt`, `:help rtp`. +]] + 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' @@ -9,7 +24,7 @@ end local rtp = vim.opt.rtp rtp:prepend(lazypath) -require('lazy').setup(require 'kickstart.plugins.spec', { +require('lazy').setup(require 'plugins.kickstart.plugins.spec', { ui = { icons = vim.g.have_nerd_font and {} or { cmd = '⌘', diff --git a/lua/kickstart/options.lua b/lua/plugins/kickstart/options.lua similarity index 56% rename from lua/kickstart/options.lua rename to lua/plugins/kickstart/options.lua index 748a7d91762..e0b5ea83993 100644 --- a/lua/kickstart/options.lua +++ b/lua/plugins/kickstart/options.lua @@ -1,4 +1,17 @@ --- Options: see `:help vim.o` and `:help option-list` +--[[ + Path: lua/plugins/kickstart/options.lua + Module: plugins.kickstart.options + + Purpose + Sets buffer-agnostic Neovim options (`vim.o` / `vim.opt`): editing feel, + UI chrome, search, splits, and persistence (e.g. undofile). + + Rationale + Centralizing options keeps behavior predictable and documents defaults in + one place. Clipboard is scheduled after UI enter to avoid slowing startup. + + See `:help vim.o`, `:help option-list`, `:help 'clipboard'`. +]] vim.o.number = true diff --git a/lua/plugins/kickstart/plugins/autopairs.lua b/lua/plugins/kickstart/plugins/autopairs.lua new file mode 100644 index 00000000000..35f759c2920 --- /dev/null +++ b/lua/plugins/kickstart/plugins/autopairs.lua @@ -0,0 +1,22 @@ +--[[ + Path: lua/plugins/kickstart/plugins/autopairs.lua + Module: plugins.kickstart.plugins.autopairs + + Purpose + Lazy spec for nvim-autopairs: inserts/closes paired brackets and quotes in + Insert mode; integrates cleanly with completion when configured. + + Rationale + Loaded on `InsertEnter` so startup stays fast. Empty `opts` uses plugin + defaults; customize here if you need rule exceptions or cmp integration. + + See https://github.com/windwp/nvim-autopairs +]] + +---@module 'lazy' +---@type LazySpec +return { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + opts = {}, +} diff --git a/lua/kickstart/plugins/blink.lua b/lua/plugins/kickstart/plugins/blink.lua similarity index 87% rename from lua/kickstart/plugins/blink.lua rename to lua/plugins/kickstart/plugins/blink.lua index 46b7466eaec..d3b6a1b087f 100644 --- a/lua/kickstart/plugins/blink.lua +++ b/lua/plugins/kickstart/plugins/blink.lua @@ -1,3 +1,19 @@ +--[[ + Path: lua/plugins/kickstart/plugins/blink.lua + Module: plugins.kickstart.plugins.blink + + Purpose + Lazy spec for saghen/blink.cmp: completion menu, LSP source, snippets via + LuaSnip, signature help, and keymap preset (`super-tab`). + + Rationale + Standalone entry complements the `blink.cmp` dependency pinned under + `lsp.lua` so capabilities exist before servers start; lazy merges duplicate + plugin IDs by version. + + See `:help blink.cmp`. +]] + ---@type LazySpec return { { -- Autocompletion diff --git a/lua/kickstart/plugins/conform.lua b/lua/plugins/kickstart/plugins/conform.lua similarity index 80% rename from lua/kickstart/plugins/conform.lua rename to lua/plugins/kickstart/plugins/conform.lua index 84b0ef56a21..a3ef7e4c635 100644 --- a/lua/kickstart/plugins/conform.lua +++ b/lua/plugins/kickstart/plugins/conform.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/plugins/kickstart/plugins/conform.lua + Module: plugins.kickstart.plugins.conform + + Purpose + Lazy spec for conform.nvim: formatter orchestration (`f`), per-FT + formatter lists (stylua, sql_formatter, prettier), and format-on-save policy. + + Rationale + Keeps formatting separate from LSP where you explicitly disable or gate LSP + format fallback per filetype. + + See `:help conform.nvim`. +]] + ---@type LazySpec return { { -- Autoformat diff --git a/lua/kickstart/plugins/debug.lua b/lua/plugins/kickstart/plugins/debug.lua similarity index 90% rename from lua/kickstart/plugins/debug.lua rename to lua/plugins/kickstart/plugins/debug.lua index b33b557569a..403c87598b9 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/plugins/kickstart/plugins/debug.lua @@ -1,10 +1,17 @@ --- debug.lua --- --- Shows how to use the DAP plugin to debug your code. --- --- Primarily focused on configuring the debugger for Go, but can --- be extended to other languages as well. That's why it's called --- kickstart.nvim and not kitchen-sink.nvim ;) +--[[ + Path: lua/plugins/kickstart/plugins/debug.lua + Module: plugins.kickstart.plugins.debug + + Purpose + Lazy spec for nvim-dap + nvim-dap-ui + mason-nvim-dap + nvim-dap-go: debug + sessions, UI controls, breakpoint signs, and Go/Delve configurations. + + Rationale + Debugging is optional but heavy; isolating DAP keeps optional tooling out of + LSP startup. Extend `dap.configurations` for other languages as needed. + + See `:help dap.txt`, plugin READMEs. +]] ---@module 'lazy' ---@type LazySpec diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/plugins/kickstart/plugins/gitsigns.lua similarity index 87% rename from lua/kickstart/plugins/gitsigns.lua rename to lua/plugins/kickstart/plugins/gitsigns.lua index e83ce140d37..53b55e05019 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/plugins/kickstart/plugins/gitsigns.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/plugins/kickstart/plugins/gitsigns.lua + Module: plugins.kickstart.plugins.gitsigns + + Purpose + Lazy spec for lewis6991/gitsigns.nvim: gutter hunks, stage/reset, blame, + diff against index / HEAD / default branch, and buffer-local keymaps. + + Rationale + Single source of truth for Git-in-editor UX; pairs with which-key groups + under `h` and avoids duplicating gitsigns setup in `init.lua`. + + See `:help gitsigns`. +]] + ---@type LazySpec return { { -- Adds git related signs to the gutter, as well as utilities for managing changes diff --git a/lua/plugins/kickstart/plugins/guess_indent.lua b/lua/plugins/kickstart/plugins/guess_indent.lua new file mode 100644 index 00000000000..813febcb032 --- /dev/null +++ b/lua/plugins/kickstart/plugins/guess_indent.lua @@ -0,0 +1,19 @@ +--[[ + Path: lua/plugins/kickstart/plugins/guess_indent.lua + Module: plugins.kickstart.plugins.guess_indent + + Purpose + Lazy spec for guess-indent.nvim: detects indentation style per buffer so new + lines match tabs vs. spaces without manual `:set sw=`. + + Rationale + Lightweight, runs early in the spec list; no keymaps. Keeps indent behavior + consistent before Treesitter or LSP attach. + + See plugin README; `:help 'shiftwidth'`. +]] + +---@type LazySpec +return { + { 'NMAC427/guess-indent.nvim', opts = {} }, +} diff --git a/lua/plugins/kickstart/plugins/indent_line.lua b/lua/plugins/kickstart/plugins/indent_line.lua new file mode 100644 index 00000000000..38b170006a0 --- /dev/null +++ b/lua/plugins/kickstart/plugins/indent_line.lua @@ -0,0 +1,26 @@ +--[[ + Path: lua/plugins/kickstart/plugins/indent_line.lua + Module: plugins.kickstart.plugins.indent_line + + Purpose + Lazy spec for indent-blankline.nvim (`ibl`): optional vertical guides aligned + with indentation levels for readability in deeply nested code. + + Rationale + Purely visual; lazy-loads via `main = 'ibl'`. Defaults are minimal; extend + `opts` if you want scope rules or excluded filetypes. + + See `:help ibl.txt`. +]] + +---@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 = {}, +} diff --git a/lua/kickstart/plugins/lint.lua b/lua/plugins/kickstart/plugins/lint.lua similarity index 82% rename from lua/kickstart/plugins/lint.lua rename to lua/plugins/kickstart/plugins/lint.lua index 556f3178811..4c5d5b04f6f 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/plugins/kickstart/plugins/lint.lua @@ -1,4 +1,17 @@ --- Linting +--[[ + Path: lua/plugins/kickstart/plugins/lint.lua + Module: plugins.kickstart.plugins.lint + + Purpose + Lazy spec for nvim-lint: asynchronous linters per filetype (here Markdown + via markdownlint) triggered on buffer enter / write / leaving Insert mode. + + Rationale + Complements LSP diagnostics where you want CLI linters or faster feedback. + Extend `linters_by_ft` as you add tools to Mason or the host system. + + See `:help nvim-lint.txt`. +]] ---@module 'lazy' ---@type LazySpec diff --git a/lua/kickstart/plugins/lsp.lua b/lua/plugins/kickstart/plugins/lsp.lua similarity index 96% rename from lua/kickstart/plugins/lsp.lua rename to lua/plugins/kickstart/plugins/lsp.lua index ce5e251f55f..94c9bd6808e 100644 --- a/lua/kickstart/plugins/lsp.lua +++ b/lua/plugins/kickstart/plugins/lsp.lua @@ -1,3 +1,19 @@ +--[[ + Path: lua/plugins/kickstart/plugins/lsp.lua + Module: plugins.kickstart.plugins.lsp + + Purpose + Lazy spec for nvim-lspconfig + Mason + blink.cmp integration: LspAttach + keymaps, server table (clangd, gopls, pyright, rust, ts_ls, lua_ls, etc.), + Mason tool installer, and 0.11 `vim.lsp.config` / `vim.lsp.enable` wiring. + + Rationale + Concentrates all LSP lifecycle logic in one place. Blink is both a + dependency (capabilities) and a top-level plugin spec in `blink.lua`. + + See `:help lsp`, `:help mason.nvim`, `:help blink.cmp`. +]] + ---@type LazySpec return { { diff --git a/lua/kickstart/plugins/mini.lua b/lua/plugins/kickstart/plugins/mini.lua similarity index 77% rename from lua/kickstart/plugins/mini.lua rename to lua/plugins/kickstart/plugins/mini.lua index 9be7ada7f61..cdbf970b7e5 100644 --- a/lua/kickstart/plugins/mini.lua +++ b/lua/plugins/kickstart/plugins/mini.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/plugins/kickstart/plugins/mini.lua + Module: plugins.kickstart.plugins.mini + + Purpose + Lazy spec for nvim-mini/mini.nvim: loads `mini.ai`, `mini.surround`, and + `mini.statusline` with nerd-font aware icons and a compact location section. + + Rationale + Bundles small quality-of-life modules under one plugin id to reduce Lazy + node count; adjust `mini.ai` mappings if they collide with Treesitter. + + See `:help mini.nvim`. +]] + ---@type LazySpec return { { -- Collection of various small independent plugins/modules diff --git a/lua/plugins/kickstart/plugins/mini_icons.lua b/lua/plugins/kickstart/plugins/mini_icons.lua new file mode 100644 index 00000000000..c70cb3e1226 --- /dev/null +++ b/lua/plugins/kickstart/plugins/mini_icons.lua @@ -0,0 +1,29 @@ +--[[ + Path: lua/plugins/kickstart/plugins/mini_icons.lua + Module: plugins.kickstart.plugins.mini_icons + + Purpose + Lazy spec for mini.icons: consistent glyphs/highlights for special filenames + (e.g. `.go-version`) and filetypes like `gotmpl`. + + Rationale + Complements web-devicons and Treesitter; keeps icon tweaks in one small + table instead of scattering `nvim_set_hl` calls. + + See `:help mini.icons`. +]] + +---@type LazySpec +return { +{ + 'nvim-mini/mini.icons', + opts = { + file = { + ['.go-version'] = { glyph = '', hl = 'MiniIconsBlue' }, + }, + filetype = { + gotmpl = { glyph = '󰟓', hl = 'MiniIconsGrey' }, + }, + }, +}, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/plugins/kickstart/plugins/neo-tree.lua similarity index 57% rename from lua/kickstart/plugins/neo-tree.lua rename to lua/plugins/kickstart/plugins/neo-tree.lua index 64f1ebb9a44..2b0ae0c0311 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/plugins/kickstart/plugins/neo-tree.lua @@ -1,4 +1,17 @@ --- Neo-tree: https://github.com/nvim-neo-tree/neo-tree.nvim +--[[ + Path: lua/plugins/kickstart/plugins/neo-tree.lua + Module: plugins.kickstart.plugins.neo-tree + + Purpose + Lazy spec for nvim-neo-tree/neo-tree.nvim: filesystem sidebar, reveal/toggle + keymaps, and tuned `filesystem` options (hidden files, libuv watcher, root). + + Rationale + Centralizes file-tree UX; `x` / `z` maps live in keymaps.lua. + Kept separate from `custom.plugins` so “core” navigation stays discoverable. + + See https://github.com/nvim-neo-tree/neo-tree.nvim +]] ---@module 'lazy' ---@type LazySpec diff --git a/lua/plugins/kickstart/plugins/neotest_golang.lua b/lua/plugins/kickstart/plugins/neotest_golang.lua new file mode 100644 index 00000000000..23db821f2c2 --- /dev/null +++ b/lua/plugins/kickstart/plugins/neotest_golang.lua @@ -0,0 +1,21 @@ +--[[ + Path: lua/plugins/kickstart/plugins/neotest_golang.lua + Module: plugins.kickstart.plugins.neotest_golang + + Purpose + Lazy spec for neotest-golang: Neotest adapter for Go tests (table-driven, + subtests) when you wire Neotest core elsewhere. + + Rationale + Declared as a standalone plugin entry so enabling `nvim-neotest/neotest` + later only requires adding the core plugin + runners; this stays inert until then. + + See https://github.com/nvim-neotest/neotest and adapter README. +]] + +---@type LazySpec +return { +{ + 'fredrikaverpil/neotest-golang', +}, +} diff --git a/lua/plugins/kickstart/plugins/render_markdown.lua b/lua/plugins/kickstart/plugins/render_markdown.lua new file mode 100644 index 00000000000..352b5cf6871 --- /dev/null +++ b/lua/plugins/kickstart/plugins/render_markdown.lua @@ -0,0 +1,27 @@ +--[[ + Path: lua/plugins/kickstart/plugins/render_markdown.lua + Module: plugins.kickstart.plugins.render_markdown + + Purpose + Lazy spec for render-markdown.nvim: in-buffer Markdown preview (no external + server), with LaTeX disabled and LSP/blink completion hooks enabled. + + Rationale + Filetype-limited load keeps startup lean; pairs with Treesitter + mini.nvim + as declared dependencies. + + See plugin README; `:help render-markdown.nvim` if bundled. +]] + +---@type LazySpec +return { +{ + 'MeanderingProgrammer/render-markdown.nvim', + dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, + ft = { 'markdown', 'markdown.mdx' }, + opts = { + latex = { enabled = false }, + completions = { lsp = { enabled = true }, blink = { enabled = true } }, + }, +}, +} diff --git a/lua/plugins/kickstart/plugins/spec.lua b/lua/plugins/kickstart/plugins/spec.lua new file mode 100644 index 00000000000..810be8e7e89 --- /dev/null +++ b/lua/plugins/kickstart/plugins/spec.lua @@ -0,0 +1,59 @@ +--[[ + Path: lua/plugins/kickstart/plugins/spec.lua + Module: plugins.kickstart.plugins.spec + + Purpose + Builds the complete lazy.nvim plugin list: requires each per-plugin module, + normalizes return shapes (single spec vs. `{ spec }`), and returns one flat + `LazySpec` array for `lazy.setup()`. + + Rationale + Splitting each plugin into its own file keeps diffs small and matches how + lazy.nvim expects multiple tables to be merged at setup time. + + See `:help lazy.nvim-plugin-spec`, `:help LazySpec`. +]] + +---@param out table +---@param chunk LazySpec|LazySpec[] +local function append_specs(out, chunk) + if type(chunk[1]) == 'string' then + out[#out + 1] = chunk + return + end + for i = 1, #chunk do + out[#out + 1] = chunk[i] + end +end + +---@type LazySpec +local specs = {} +local mods = { + 'plugins.kickstart.plugins.guess_indent', + 'plugins.kickstart.plugins.gitsigns', + 'plugins.kickstart.plugins.which_key', + 'plugins.kickstart.plugins.render_markdown', + 'plugins.kickstart.plugins.telescope', + 'plugins.kickstart.plugins.lsp', + 'plugins.kickstart.plugins.conform', + 'plugins.kickstart.plugins.blink', + 'plugins.kickstart.plugins.tokyonight', + 'plugins.kickstart.plugins.todo_comments', + 'plugins.kickstart.plugins.mini', + 'plugins.kickstart.plugins.treesitter', + 'plugins.kickstart.plugins.vim_helm', + 'plugins.kickstart.plugins.neotest_golang', + 'plugins.kickstart.plugins.mini_icons', + 'plugins.kickstart.plugins.debug', + 'plugins.kickstart.plugins.indent_line', + 'plugins.kickstart.plugins.lint', + 'plugins.kickstart.plugins.autopairs', + 'plugins.kickstart.plugins.neo-tree', + 'custom.plugins', +} + +for _, mod in ipairs(mods) do + append_specs(specs, require(mod)) +end + +return specs diff --git a/lua/kickstart/plugins/telescope.lua b/lua/plugins/kickstart/plugins/telescope.lua similarity index 93% rename from lua/kickstart/plugins/telescope.lua rename to lua/plugins/kickstart/plugins/telescope.lua index 6071d6d3d5b..8bcc684bb5a 100644 --- a/lua/kickstart/plugins/telescope.lua +++ b/lua/plugins/kickstart/plugins/telescope.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/plugins/kickstart/plugins/telescope.lua + Module: plugins.kickstart.plugins.telescope + + Purpose + Lazy spec for telescope.nvim: fuzzy finder for files, grep, diagnostics, + git, help, and LSP pickers; includes fzf-native and ui-select extensions. + + Rationale + Large `config` function registers `s*` maps and theme extensions. + Deferred `require('telescope.builtin')` from LSP attach remains valid. + + See `:help telescope`, `:help telescope.setup()`. +]] + ---@type LazySpec return { { -- Fuzzy Finder (files, lsp, etc) diff --git a/lua/plugins/kickstart/plugins/todo_comments.lua b/lua/plugins/kickstart/plugins/todo_comments.lua new file mode 100644 index 00000000000..9e75d49ac3b --- /dev/null +++ b/lua/plugins/kickstart/plugins/todo_comments.lua @@ -0,0 +1,27 @@ +--[[ + Path: lua/plugins/kickstart/plugins/todo_comments.lua + Module: plugins.kickstart.plugins.todo_comments + + Purpose + Lazy spec for todo-comments.nvim: highlights TODO/FIXME/HACK-style comment + tokens and can integrate with Telescope (optional). + + Rationale + Purely visual aid for scanning large codebases; `signs = false` avoids + gutter clutter if you prefer highlight-only. + + See https://github.com/folke/todo-comments.nvim +]] + +---@type LazySpec +return { +{ + '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 }, +}, +} diff --git a/lua/kickstart/plugins/tokyonight.lua b/lua/plugins/kickstart/plugins/tokyonight.lua similarity index 67% rename from lua/kickstart/plugins/tokyonight.lua rename to lua/plugins/kickstart/plugins/tokyonight.lua index 65b6e41ee11..c63e7642392 100644 --- a/lua/kickstart/plugins/tokyonight.lua +++ b/lua/plugins/kickstart/plugins/tokyonight.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/plugins/kickstart/plugins/tokyonight.lua + Module: plugins.kickstart.plugins.tokyonight + + Purpose + Lazy spec for tokyonight.nvim: colorscheme plugin with high priority so it + loads before most UI; disables italic comments then sets `colorscheme`. + + Rationale + Centralizes theme choice. Swap plugin name + `vim.cmd.colorscheme` here if + you change distributions. + + See `:help colorscheme`, plugin README. +]] + ---@type LazySpec return { { -- You can easily change to a different colorscheme. diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/plugins/kickstart/plugins/treesitter.lua similarity index 77% rename from lua/kickstart/plugins/treesitter.lua rename to lua/plugins/kickstart/plugins/treesitter.lua index 58a764d5a10..fecd25065f8 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/plugins/kickstart/plugins/treesitter.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/plugins/kickstart/plugins/treesitter.lua + Module: plugins.kickstart.plugins.treesitter + + Purpose + Lazy spec for nvim-treesitter: parser install list, `TSUpdate` build step, + highlight/indent toggles, and `lazy = false` so buffers get treesitter early. + + Rationale + Syntax/folds/indent for supported languages; `auto_install` pulls missing + parsers on demand. Ruby keeps vim regex highlighting per upstream note. + + See `:help nvim-treesitter`. +]] + ---@type LazySpec return { { -- Highlight, edit, and navigate code diff --git a/lua/plugins/kickstart/plugins/vim_helm.lua b/lua/plugins/kickstart/plugins/vim_helm.lua new file mode 100644 index 00000000000..ed8f5402326 --- /dev/null +++ b/lua/plugins/kickstart/plugins/vim_helm.lua @@ -0,0 +1,25 @@ +--[[ + Path: lua/plugins/kickstart/plugins/vim_helm.lua + Module: plugins.kickstart.plugins.vim_helm + + Purpose + Lazy spec for towolf/vim-helm: sets `filetype=helm` on Helm templates so + Treesitter/YAML tooling attach to the correct grammar instead of plain YAML. + + Rationale + Small filetype shim; loaded on `BufReadPre` before heavy YAML LSP hooks run. + + See Helm tooling docs; plugin README. +]] + +---@type LazySpec +return { +{ + 'towolf/vim-helm', + event = 'BufReadPre', + config = function() + -- This plugin automatically detects helm files (including .tpl) + -- and sets the filetype to "helm" instead of "yaml" + end, +}, +} diff --git a/lua/kickstart/plugins/which_key.lua b/lua/plugins/kickstart/plugins/which_key.lua similarity index 60% rename from lua/kickstart/plugins/which_key.lua rename to lua/plugins/kickstart/plugins/which_key.lua index cae42bb1adf..38c4364004c 100644 --- a/lua/kickstart/plugins/which_key.lua +++ b/lua/plugins/kickstart/plugins/which_key.lua @@ -1,3 +1,18 @@ +--[[ + Path: lua/plugins/kickstart/plugins/which_key.lua + Module: plugins.kickstart.plugins.which_key + + Purpose + Lazy spec for which-key.nvim: discoverable pop-up of pending key sequences + and group labels for `` chains (search, toggle, git hunks, LSP). + + Rationale + Loaded on `VimEnter` so it does not delay first screen paint. `spec` entries + document chains used elsewhere (Telescope, gitsigns, LSP maps). + + See `:help which-key.nvim.txt`. +]] + ---@type LazySpec return { { -- Useful plugin to show you pending keybinds.