From 5ed5c57a4a603242b4702aa965369f3462f3148a Mon Sep 17 00:00:00 2001 From: Jose Carvajal Date: Mon, 9 Jun 2025 15:42:31 -0600 Subject: [PATCH] Add undotree plugin; updated harpoon setup but stil some issues with commands clashing with my terminal kitty --- lazy-lock.json | 1 + lua/custom/plugins/harpoon.lua | 35 ++++++++++++++++++++++++++++++ lua/kickstart/plugins/fzf-lua.lua | 18 +++++++-------- lua/kickstart/plugins/undotree.lua | 7 ++++++ lua/lazy-plugins.lua | 1 + 5 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 lua/kickstart/plugins/undotree.lua diff --git a/lazy-lock.json b/lazy-lock.json index 511f393b..400a9cb4 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -29,5 +29,6 @@ "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua index ed50fd6e..61812c37 100644 --- a/lua/custom/plugins/harpoon.lua +++ b/lua/custom/plugins/harpoon.lua @@ -2,4 +2,39 @@ return { 'ThePrimeagen/harpoon', branch = 'harpoon2', dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local harpoon = require 'harpoon' + + -- REQUIRED + harpoon:setup() + -- REQUIRED + + vim.keymap.set('n', 'a', function() + harpoon:list():add() + end, { desc = 'Harppon [A]dd File' }) + vim.keymap.set('n', '', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, { desc = 'Harpoon Menu' }) + + -- vim.keymap.set('n', '', function() + -- harpoon:list():select(1) + -- end, { desc = 'Harpoon File 1' }) + -- vim.keymap.set('n', '', function() + -- harpoon:list():select(2) + -- end, { desc = 'Harpoon File 2' }) + -- vim.keymap.set('n', '', function() + -- harpoon:list():select(3) + -- end, { desc = 'Harpoon File 3' }) + -- vim.keymap.set('n', '', function() + -- harpoon:list():select(4) + -- end, { desc = 'Harpoon File 4' }) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set('n', '', function() + harpoon:list():prev() + end, { desc = 'Harpoon [S]ee [P]revious' }) + vim.keymap.set('n', '', function() + harpoon:list():next() + end, { desc = 'Harpoon [S]ee [N]ext' }) + end, } diff --git a/lua/kickstart/plugins/fzf-lua.lua b/lua/kickstart/plugins/fzf-lua.lua index cc2f4db4..7a8cae80 100644 --- a/lua/kickstart/plugins/fzf-lua.lua +++ b/lua/kickstart/plugins/fzf-lua.lua @@ -4,21 +4,19 @@ return { dependencies = { 'nvim-tree/nvim-web-devicons' }, -- or if using mini.icons/mini.nvim -- dependencies = { "echasnovski/mini.icons" }, - opts = {}, + opts = { + defaults = { + git_icons = false, + file_icons = false, + color_icons = false, + }, + }, config = function() - require('fzf-lua').setup { - defaults = { - git_icons = false, - file_icons = false, - color_icons = false, - }, - } - local builtin = require 'fzf-lua' vim.keymap.set('n', 'sh', builtin.helptags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', builtin.files, { desc = '[S]earch [F]iles' }) - vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect FzfLua' }) + vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]ee FzfLua' }) vim.keymap.set('n', 'sw', builtin.grep_cword, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sW', builtin.grep_cWORD, { desc = '[S]earch current [W]ORD' }) vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by Live[G]rep' }) diff --git a/lua/kickstart/plugins/undotree.lua b/lua/kickstart/plugins/undotree.lua new file mode 100644 index 00000000..8212da41 --- /dev/null +++ b/lua/kickstart/plugins/undotree.lua @@ -0,0 +1,7 @@ +return { + 'mbbill/undotree', + opts = {}, + config = function() + vim.keymap.set('n', '', vim.cmd.UndotreeToggle) + end, +} diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index ac3e8828..63f82b36 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -32,6 +32,7 @@ require('lazy').setup({ require 'kickstart/plugins/todo-comments', require 'kickstart/plugins/mini', require 'kickstart/plugins/treesitter', + require 'kickstart/plugins/undotree', -- 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