From fc0af8f28cdf92faa1e9112ecf473a3d1ba174f8 Mon Sep 17 00:00:00 2001 From: Joshua Blanch Date: Mon, 17 Nov 2025 21:16:23 +0000 Subject: [PATCH 1/4] replacing telescope with snacks.nvim Signed-off-by: Joshua Blanch --- init.lua | 157 +++++++++++++++++++++++------------- lua/custom/plugins/init.lua | 46 +++++------ 2 files changed, 123 insertions(+), 80 deletions(-) diff --git a/init.lua b/init.lua index 55ec1f26ae5..b2937b83e4f 100644 --- a/init.lua +++ b/init.lua @@ -222,70 +222,118 @@ require('lazy').setup({ }, }, + -- { + -- 'nvim-telescope/telescope.nvim', + -- event = 'VimEnter', + -- branch = '0.1.x', + -- dependencies = { + -- 'nvim-lua/plenary.nvim', + -- { + -- 'nvim-telescope/telescope-fzf-native.nvim', + -- + -- build = 'make', + -- + -- cond = function() + -- return vim.fn.executable 'make' == 1 + -- end, + -- }, + -- { 'nvim-telescope/telescope-ui-select.nvim' }, + -- + -- { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + -- }, + -- config = function() + -- require('telescope').setup { + -- extensions = { + -- ['ui-select'] = { + -- require('telescope.themes').get_dropdown(), + -- }, + -- }, + -- } + -- + -- pcall(require('telescope').load_extension, 'fzf') + -- pcall(require('telescope').load_extension, 'ui-select') + -- + -- local builtin = require 'snacks.picker' + -- 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', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) + -- vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + -- vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) + -- vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) + -- vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + -- vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + -- vim.keymap.set('n', 'sc', builtin.lsp_document_symbols, { desc = '[S]earch do[c]ument symbols' }) + -- + -- vim.keymap.set('n', '/', function() + -- builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + -- winblend = 10, + -- previewer = false, + -- }) + -- end, { desc = '[/] Fuzzily search in current buffer' }) + -- + -- vim.keymap.set('n', 's/', function() + -- builtin.live_grep { + -- grep_open_files = true, + -- prompt_title = 'Live Grep in Open Files', + -- } + -- end, { desc = '[S]earch [/] in Open Files' }) + -- + -- vim.keymap.set('n', 'sn', function() + -- builtin.find_files { cwd = vim.fn.stdpath 'config' } + -- end, { desc = '[S]earch [N]eovim files' }) + -- end, + -- }, { - 'nvim-telescope/telescope.nvim', - event = 'VimEnter', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - { - 'nvim-telescope/telescope-fzf-native.nvim', - - build = 'make', - - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - { 'nvim-telescope/telescope-ui-select.nvim' }, - - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + bigfile = { enabled = true }, + dashboard = { enabled = true }, + explorer = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + picker = { enabled = true }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = false }, + statuscolumn = { enabled = true }, + words = { enabled = true }, }, config = function() - require('telescope').setup { - extensions = { - ['ui-select'] = { - require('telescope.themes').get_dropdown(), - }, - }, - } - - pcall(require('telescope').load_extension, 'fzf') - pcall(require('telescope').load_extension, 'ui-select') - - local builtin = require 'telescope.builtin' - vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) + local builtin = require 'snacks.picker' + vim.keymap.set('n', 'sh', builtin.help, { 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', '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', 'sf', builtin.files, { desc = '[S]earch [F]iles' }) + vim.keymap.set('n', 'ss', builtin.pickers, { desc = '[S]earch [S]elect Pickers' }) + vim.keymap.set('n', 'sw', builtin.grep_word, { desc = '[S]earch current [W]ord' }) + vim.keymap.set('n', 'sg', builtin.grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) - vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', 's.', builtin.recent, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - vim.keymap.set('n', 'sc', builtin.lsp_document_symbols, { desc = '[S]earch do[c]ument symbols' }) + vim.keymap.set('n', 'sc', builtin.lsp_symbols, { desc = '[S]earch do[c]ument symbols' }) vim.keymap.set('n', '/', function() - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) + builtin.lines() end, { desc = '[/] Fuzzily search in current buffer' }) vim.keymap.set('n', 's/', function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } + builtin.grep_buffers() end, { desc = '[S]earch [/] in Open Files' }) vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } + builtin.files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) end, }, - { 'folke/lazydev.nvim', ft = 'lua', @@ -316,17 +364,12 @@ require('lazy').setup({ vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end - map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - - map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - map('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - - map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - - map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + map('gd', require('snacks.picker').lsp_definitions, '[G]oto [D]efinition') + map('gr', require('snacks.picker').lsp_references, '[G]oto [R]eferences') + map('gI', require('snacks.picker').lsp_implementations, '[G]oto [I]mplementation') + map('D', require('snacks.picker').lsp_type_definitions, 'Type [D]efinition') + map('ds', require('snacks.picker').lsp_symbols, '[D]ocument [S]ymbols') + map('ws', require('snacks.picker').lsp_workspace_symbols, '[W]orkspace [S]ymbols') map('rn', vim.lsp.buf.rename, '[R]e[n]ame') diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index e373873dc73..a40882cdf8f 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -216,29 +216,29 @@ return { }, }, }, - { - "folke/snacks.nvim", - priority = 1000, - lazy = false, - ---@type snacks.Config - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - bigfile = { enabled = true }, - dashboard = { enabled = true }, - explorer = { enabled = true }, - indent = { enabled = true }, - input = { enabled = false }, - picker = { enabled = true }, - notifier = { enabled = true }, - quickfile = { enabled = true }, - scope = { enabled = true }, - scroll = { enabled = false }, - statuscolumn = { enabled = true }, - words = { enabled = false }, - }, - }, + -- { + -- "folke/snacks.nvim", + -- priority = 1000, + -- lazy = false, + -- ---@type snacks.Config + -- opts = { + -- -- your configuration comes here + -- -- or leave it empty to use the default settings + -- -- refer to the configuration section below + -- bigfile = { enabled = true }, + -- dashboard = { enabled = true }, + -- explorer = { enabled = true }, + -- indent = { enabled = true }, + -- input = { enabled = true }, + -- picker = { enabled = true }, + -- notifier = { enabled = true }, + -- quickfile = { enabled = true }, + -- scope = { enabled = true }, + -- scroll = { enabled = false }, + -- statuscolumn = { enabled = true }, + -- words = { enabled = true }, + -- }, + -- }, { "sindrets/diffview.nvim", enhanced_diff_hl = true, -- Enable enhanced diff highlighting From 70dddf9083007a367aec28a96434366c4c8a393b Mon Sep 17 00:00:00 2001 From: Joshua Blanch Date: Mon, 17 Nov 2025 21:39:35 +0000 Subject: [PATCH 2/4] remove linenumber on ufo fold --- init.lua | 5 ++- lazy-lock.json | 61 ++++++++++++++++++------------------- lua/custom/plugins/init.lua | 18 ++++++----- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/init.lua b/init.lua index b2937b83e4f..5d55a8d36d3 100644 --- a/init.lua +++ b/init.lua @@ -626,7 +626,10 @@ require('lazy').setup({ }, }, { - 'nvim-treesitter/nvim-treesitter-context' + 'nvim-treesitter/nvim-treesitter-context', + opts = { + max_lines = 3, + }, }, { import = 'custom.plugins' }, diff --git a/lazy-lock.json b/lazy-lock.json index 3ed440298fc..d5566a092fd 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,47 +1,44 @@ { "LuaSnip": { "branch": "master", "commit": "5271933f7cea9f6b1c7de953379469010ed4553a" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, - "catppuccin": { "branch": "main", "commit": "fa42eb5e26819ef58884257d5ae95dd0552b9a66" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "catppuccin": { "branch": "main", "commit": "da33755d00e09bff2473978910168ff9ea5dc453" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "everforest": { "branch": "master", "commit": "c4bb2ae687ae21938775f436cf213492702a0cf3" }, - "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitlinker.nvim": { "branch": "master", "commit": "23982c86f50a9c3f4bc531d41b7a4a68ddd12355" }, + "everforest": { "branch": "master", "commit": "484dd560dccb2d2842685c441ad2b54a54ffef1b" }, + "fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" }, + "gitlinker.nvim": { "branch": "master", "commit": "63cfbb7ba0465fa4a599f57c08c888abb188a595" }, "gitsigns.nvim": { "branch": "main", "commit": "9b36d497495436c135659902054ee637e0ba6021" }, - "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "bef29b653ba71d442816bf56286c2a686210be04" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, - "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, - "mini.nvim": { "branch": "main", "commit": "35e1767f4cd7dde51256eabae7349a5283a43cba" }, + "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, + "luvit-meta": { "branch": "main", "commit": "0ea4ff636c5bb559ffa78108561d0976f4de9682" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, + "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, + "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, + "mini.nvim": { "branch": "main", "commit": "b409fd1d8b9ea7ec7c0923eb2562b52ed5d1ab0a" }, "nightfox": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" }, - "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-lspconfig": { "branch": "master", "commit": "a182334ba933e58240c2c45e6ae2d9c7ae313e00" }, + "nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" }, + "nvim-lspconfig": { "branch": "master", "commit": "d4f77e7a9a4b910622a0bc225e482c4c808e4099" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter-context": { "branch": "master", "commit": "660861b1849256398f70450afdf93908d28dc945" }, - "nvim-ufo": { "branch": "main", "commit": "3c7a3570e9c9dc198a2ad4491b0b0e51c4d4ba08" }, - "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, - "octo.nvim": { "branch": "master", "commit": "fded71669b61c6ccae9d8ade30f667c3c4962b48" }, - "oil.nvim": { "branch": "master", "commit": "08c2bce8b00fd780fb7999dbffdf7cd174e896fb" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" }, + "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, + "octo.nvim": { "branch": "master", "commit": "0dec935fc27189bbf2cb482bd3274d962c319177" }, + "oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "python-type-stubs": { "branch": "main", "commit": "692c37c3969d22612b295ddf7e7af5907204a386" }, - "roslyn.nvim": { "branch": "main", "commit": "7ba2dd0a5628c5ad3d8cc5a22e66ece3efc371bc" }, - "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "47a50525c251fe1195fc59443504f11fba2d5d3c" }, - "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, - "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "roslyn.nvim": { "branch": "main", "commit": "e2901d86d7c1702b88c02b9616802845dc6d49f8" }, + "snacks.nvim": { "branch": "main", "commit": "836e07336ba523d4da480cd66f0241815393e98e" }, + "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "71f998696a4d63a1fa42a6c70d5931a2001e485b" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" } } diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index a40882cdf8f..ff56ad6a894 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -131,6 +131,8 @@ return { vim.o.foldlevel = 99 vim.o.foldlevelstart = 99 vim.o.foldenable = true + -- vim.o.foldcolumn = 'auto:8' + vim.o.foldcolumn = "0" -- Keymaps for opening/closing all folds vim.keymap.set('n', 'zR', require('ufo').openAllFolds) @@ -142,13 +144,13 @@ return { return { 'treesitter', 'indent' } end, -- Optional: Configure preview for folds - preview = { - win_config = { - border = { '', '─', '', '', '', '─', '', '' }, - winhighlight = 'Normal:Folded', - winblend = 0 - } - } + -- preview = { + -- win_config = { + -- border = { '', '─', '', '', '', '─', '', '' }, + -- winhighlight = 'Normal:Folded', + -- winblend = 0 + -- } + -- } }) end }, @@ -292,7 +294,7 @@ return { enable_builtin = true, default_to_projects_v2 = true, default_merge_method = "squash", - picker = "telescope", + picker = "snacks.picker", }) end, }, From e3097b6c3b1821e01ceaa8311ac76e030ca7364a Mon Sep 17 00:00:00 2001 From: Joshua Blanch Date: Thu, 27 Nov 2025 21:02:57 +0000 Subject: [PATCH 3/4] fix theme --- init.lua | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 5d55a8d36d3..92e086186ae 100644 --- a/init.lua +++ b/init.lua @@ -14,7 +14,6 @@ vim.opt.softtabstop = 4 -- Backspace deletes 4 spaces vim.opt.expandtab = true -- Convert tabs to spaces -- let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -l -g ""' - -- Don't show the mode, since it's already in the status line vim.opt.showmode = false vim.api.nvim_set_keymap('n', 'F', 'lua vim.lsp.buf.format()', { noremap = true, silent = true }) @@ -320,6 +319,7 @@ require('lazy').setup({ vim.keymap.set('n', 's.', builtin.recent, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) vim.keymap.set('n', 'sc', builtin.lsp_symbols, { desc = '[S]earch do[c]ument symbols' }) + vim.keymap.set("n", "SC", builtin.colorschemes, { desc = "Select colorscheme" }) vim.keymap.set('n', '/', function() builtin.lines() @@ -574,24 +574,33 @@ require('lazy').setup({ { 'folke/tokyonight.nvim', priority = 1000, + -- init = function() + -- vim.cmd.colorscheme 'tokyonight-night' + -- + -- vim.cmd.hi 'Comment gui=none' + -- end, + }, + { + "rebelot/kanagawa.nvim", + name="kanagawa", init = function() - vim.cmd.colorscheme 'tokyonight-night' - + vim.cmd.colorscheme 'kanagawa' vim.cmd.hi 'Comment gui=none' end, }, + { "catppuccin/nvim", name = "catppuccin", priority = 1000 }, { "sainnhe/everforest", name = "everforest", priority = 1000 }, { "EdenEast/nightfox.nvim", name = "nightfox", priority = 999, - init = function() - -- vim.cmd.colorscheme 'dayfox' - - vim.cmd.hi 'Comment gui=none' - end, + -- init = function() + -- vim.cmd.colorscheme 'dayfox' + -- + -- vim.cmd.hi 'Comment gui=none' + -- end, }, { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, From 65088af5b2a16a9520f3a01bb84a5611c07ad34f Mon Sep 17 00:00:00 2001 From: Joshua Blanch Date: Sat, 29 Nov 2025 00:52:28 +0000 Subject: [PATCH 4/4] add dap debugger and neotree stuf --- init.lua | 40 +++++++++++- lazy-lock.json | 24 +++++-- lua/custom/plugins/init.lua | 4 ++ lua/kickstart/plugins/debug.lua | 107 +++++++++++++++++++++++++++++--- 4 files changed, 159 insertions(+), 16 deletions(-) diff --git a/init.lua b/init.lua index 92e086186ae..44fd08c36ac 100644 --- a/init.lua +++ b/init.lua @@ -73,6 +73,38 @@ if vim.env.TMUX ~= nil then } end +-- Debug command: :DebugAttach +-- Deferred to after dap plugin loads +vim.api.nvim_create_autocmd('User', { + pattern = 'VeryLazy', + callback = function() + vim.api.nvim_create_user_command('DebugAttach', function(opts) + local name = opts.args + local pid = vim.fn.system('pidof ' .. name):gsub('%s+', '') + if pid == '' then + vim.notify('Process not found: ' .. name, vim.log.levels.ERROR) + return + end + -- Get the executable path from /proc + local exe_path = vim.fn.resolve('/proc/' .. pid .. '/exe') + if exe_path == '' or exe_path:match('No such file') then + exe_path = vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end + require('dap').run({ + name = 'Attach to ' .. name, + type = 'cppdbg', + request = 'attach', + processId = tonumber(pid), + program = exe_path, + cwd = vim.fn.getcwd(), + MIMode = 'gdb', + miDebuggerPath = '/usr/bin/gdb', + }) + end, { nargs = 1 }) + end, +}) + + vim.opt.breakindent = true vim.opt.undofile = true @@ -211,12 +243,13 @@ require('lazy').setup({ spec = { { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, + { 'd', group = '[D]ebug' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, { 'w', group = '[W]orkspace' }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'm', group = '[M]arks/Bookmarks', mode = { 'n', 'v' } }, }, }, }, @@ -581,8 +614,8 @@ require('lazy').setup({ -- end, }, { - "rebelot/kanagawa.nvim", - name="kanagawa", + "rebelot/kanagawa.nvim", + name = "kanagawa", init = function() vim.cmd.colorscheme 'kanagawa' vim.cmd.hi 'Comment gui=none' @@ -641,6 +674,7 @@ require('lazy').setup({ }, }, + { import = 'kickstart.plugins' }, { import = 'custom.plugins' }, }, { ui = { diff --git a/lazy-lock.json b/lazy-lock.json index d5566a092fd..2d359e3c95c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,5 @@ { - "LuaSnip": { "branch": "master", "commit": "5271933f7cea9f6b1c7de953379469010ed4553a" }, + "LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "catppuccin": { "branch": "main", "commit": "da33755d00e09bff2473978910168ff9ea5dc453" }, "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, @@ -11,34 +11,46 @@ "gitlinker.nvim": { "branch": "master", "commit": "63cfbb7ba0465fa4a599f57c08c888abb188a595" }, "gitsigns.nvim": { "branch": "main", "commit": "9b36d497495436c135659902054ee637e0ba6021" }, "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "kanagawa": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" }, "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, "luvit-meta": { "branch": "main", "commit": "0ea4ff636c5bb559ffa78108561d0976f4de9682" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7d527c76c43f46294de9c19d39c5a86317809b4b" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, "mini.nvim": { "branch": "main", "commit": "b409fd1d8b9ea7ec7c0923eb2562b52ed5d1ab0a" }, + "neo-tree.nvim": { "branch": "main", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, "nightfox": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" }, "nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" }, - "nvim-lspconfig": { "branch": "master", "commit": "d4f77e7a9a4b910622a0bc225e482c4c808e4099" }, + "nvim-dap": { "branch": "master", "commit": "5860c7c501eb428d3137ee22c522828d20cca0b3" }, + "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, + "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, + "nvim-lint": { "branch": "master", "commit": "d1118791070d090777398792a73032a0ca5c79ff" }, + "nvim-lspconfig": { "branch": "master", "commit": "b7c48a7111534b66bee077da8035ac7208a294ff" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter-context": { "branch": "master", "commit": "660861b1849256398f70450afdf93908d28dc945" }, "nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" }, "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, - "octo.nvim": { "branch": "master", "commit": "0dec935fc27189bbf2cb482bd3274d962c319177" }, + "octo.nvim": { "branch": "master", "commit": "4ecfbfb9eba7ef4323d55d704ecdd2c6c9a3370b" }, "oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "python-type-stubs": { "branch": "main", "commit": "692c37c3969d22612b295ddf7e7af5907204a386" }, - "roslyn.nvim": { "branch": "main", "commit": "e2901d86d7c1702b88c02b9616802845dc6d49f8" }, - "snacks.nvim": { "branch": "main", "commit": "836e07336ba523d4da480cd66f0241815393e98e" }, + "roslyn.nvim": { "branch": "main", "commit": "88f837a658df7304ae47fdf251c9560ffbc6bf2b" }, + "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "71f998696a4d63a1fa42a6c70d5931a2001e485b" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "vscode-diff.nvim": { "branch": "main", "commit": "9831250fb85beb27df984bd985961f1a2ca23f81" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" } } diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index ff56ad6a894..54c1d3b5558 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -369,6 +369,10 @@ return { "/usr/local/roslyn/lib/net9.0/Microsoft.CodeAnalysis.LanguageServer.dll", }, }, + }, + { + "esmuellert/vscode-diff.nvim", + dependencies = { "MunifTanjim/nui.nvim" }, } } diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 196f2c6dbd6..82abaa51a5b 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -28,11 +28,12 @@ return { local dap = require 'dap' local dapui = require 'dapui' return { - -- Basic debugging keymaps, feel free to change to your liking! - { '', dap.continue, desc = 'Debug: Start/Continue' }, - { '', dap.step_into, desc = 'Debug: Step Into' }, - { '', dap.step_over, desc = 'Debug: Step Over' }, - { '', dap.step_out, desc = 'Debug: Step Out' }, + -- Basic debugging keymaps + { '6', dap.continue, desc = 'Debug: Continue' }, + { '7', dap.step_over, desc = 'Debug: Step Over (Next Line)' }, + { '8', dap.step_into, desc = 'Debug: Step Into' }, + { '9', dap.step_out, desc = 'Debug: Step Out' }, + { '0', dapui.toggle, desc = 'Debug: Toggle DAP UI' }, { 'b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, { 'B', @@ -41,8 +42,86 @@ return { end, desc = 'Debug: Set Breakpoint', }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { '', dapui.toggle, desc = 'Debug: See last session result.' }, + -- Attach to process by picking from list + { + 'dp', + function() + local handle = io.popen('ps -eo pid,comm --no-headers 2>/dev/null') + if not handle then + vim.notify('Failed to get process list', vim.log.levels.ERROR) + return + end + local result = handle:read('*a') + handle:close() + + local items = {} + for line in result:gmatch('[^\n]+') do + local pid, name = line:match('%s*(%d+)%s+(.+)') + if pid and name then + table.insert(items, { + text = pid .. ' - ' .. name, + pid = pid, + name = name, + }) + end + end + + Snacks.picker({ + title = 'Attach Debugger to Process', + items = items, + format = function(item) + return { { item.text } } + end, + confirm = function(picker, item) + picker:close() + if item then + -- Get the executable path from /proc + local exe_path = vim.fn.resolve('/proc/' .. item.pid .. '/exe') + if exe_path == '' or exe_path:match('No such file') then + exe_path = vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end + dap.run({ + name = 'Attach to ' .. item.name, + type = 'cppdbg', + request = 'attach', + processId = tonumber(item.pid), + program = exe_path, + cwd = vim.fn.getcwd(), + MIMode = 'gdb', + miDebuggerPath = '/usr/bin/gdb', + }) + end + end, + }) + end, + desc = 'Debug: [P]ick process to attach', + }, + -- Attach to process by entering PID + { + 'da', + function() + vim.ui.input({ prompt = 'Enter PID: ' }, function(pid) + if pid and pid ~= '' then + -- Get the executable path from /proc + local exe_path = vim.fn.resolve('/proc/' .. pid .. '/exe') + if exe_path == '' or exe_path:match('No such file') then + exe_path = vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end + dap.run({ + name = 'Attach to PID ' .. pid, + type = 'cppdbg', + request = 'attach', + processId = tonumber(pid), + program = exe_path, + cwd = vim.fn.getcwd(), + MIMode = 'gdb', + miDebuggerPath = '/usr/bin/gdb', + }) + end + end) + end, + desc = 'Debug: [A]ttach to PID', + }, unpack(keys), } end, @@ -64,6 +143,7 @@ return { ensure_installed = { -- Update this to ensure that you have the debuggers for the langs you want 'delve', + 'cppdbg', -- For C/C++ debugging with GDB < 14 }, } @@ -89,6 +169,19 @@ return { }, } + dap.adapters.gdb = { + type = 'executable', + command = 'gdb', + args = { '-i', 'dap' }, + } + + -- cppdbg adapter for GDB < 14 (uses vscode-cpptools) + dap.adapters.cppdbg = { + id = 'cppdbg', + type = 'executable', + command = vim.fn.stdpath('data') .. '/mason/bin/OpenDebugAD7', + } + dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close