From 34dfe4f69c18f8893082392fa7628a92020977f3 Mon Sep 17 00:00:00 2001 From: jaredgoldman Date: Sun, 7 Apr 2024 17:27:43 -0400 Subject: [PATCH] feat: add harpoon --- init.lua | 9 +++++---- lazy-lock.json | 2 ++ lua/config/fterm.lua | 10 +++++++++- lua/config/harpoon.lua | 8 ++++++++ lua/keymaps.lua | 41 ++++++++++++++++++++++------------------- lua/plugins.lua | 8 +++++++- requirements.md | 7 +++++-- 7 files changed, 58 insertions(+), 27 deletions(-) create mode 100644 lua/config/harpoon.lua diff --git a/init.lua b/init.lua index b4ab18a..f566feb 100644 --- a/init.lua +++ b/init.lua @@ -1,13 +1,14 @@ +require("colorscheme") require("options") require("plugins") -require("config.telescope") -require("keymaps") require("lsp") -require("colorscheme") +require("config.telescope") +require("config.comment") require("config.mason") require("config.nvim-tree") -require("config.comment") require("config.themery") require("config.theme") require("config.lualine") require("config.fterm") +require("config.harpoon") +require("keymaps") diff --git a/lazy-lock.json b/lazy-lock.json index ed552f0..0d840c3 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,6 +6,8 @@ "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "copilot.vim": { "branch": "release", "commit": "49e0348bfb913fae63ca5ddb987a8bccd193da86" }, + "harpoon": { "branch": "harpoon2", "commit": "da326d0438ac68dee9b6b62a734be940a8bd8405" }, "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, diff --git a/lua/config/fterm.lua b/lua/config/fterm.lua index b9ab0dd..373dfb9 100644 --- a/lua/config/fterm.lua +++ b/lua/config/fterm.lua @@ -1,3 +1,11 @@ -require("FTerm").setup({ +local api = vim.api +local fterm = require("FTerm") + +fterm.setup({ blend = 25 }) + +-- Commands +api.nvim_create_user_command('FTermToggle', fterm.toggle, { bang = true }) +api.nvim_create_user_command('FTermClose', fterm.close, { bang = true }) + diff --git a/lua/config/harpoon.lua b/lua/config/harpoon.lua new file mode 100644 index 0000000..f4e1069 --- /dev/null +++ b/lua/config/harpoon.lua @@ -0,0 +1,8 @@ +local api = vim.api +local harpoon = require("harpoon") +harpoon.setup({}) + +api.nvim_create_user_command('HarpoonAdd', function() harpoon:list():add() end, { bang = true }) +api.nvim_create_user_command('HarpoonUI', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { bang = true }) +api.nvim_create_user_command('HarpoonTogglePrev', function() harpoon:list():prev() end, { bang = true }) +api.nvim_create_user_command('HarpoonToggleNext', function() harpoon:list():next() end, { bang = true }) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 06cdb37..205cce0 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -10,31 +10,34 @@ api.nvim_create_user_command('FTermClose', fterm.close, { bang = true }) local mappings = { n = { -- highlighting - ["nh"] = ":nohl", + ["nh"] = ":nohl", -- move between buffers - [""] = "h", - [""] = "j", - [""] = "k", - [""] = "l", + [""] = "h", + [""] = "j", + [""] = "k", + [""] = "l", -- open and close buggers - ["sv"] = "s", - ["sh"] = "v", - ["se"] = "=", - ["sx"] = ":close", + ["sv"] = "s", + ["sh"] = "v", + ["se"] = "=", + ["sx"] = ":close", -- nvim-tree - ["e"] = ":NvimTreeToggle", - ["cf"] = ":NvimTreeCollapse", + ["e"] = ":NvimTreeToggle", + ["cf"] = ":NvimTreeCollapse", -- LSP - ["ls"] = ":lspstop", - ["lo"] = ":lspstart", + ["ls"] = ":lspstop", + ["lo"] = ":lspstart", -- Telescope - ["ff"] = "Telescope find_files", - ["fw"] = "Telescope live_grep", - ["fc"] = "Telescope grep_string", - ["th"] = "Themery", - ["sm"] = ":MaximizerToggle", + ["ff"] = "Telescope find_files", + ["fw"] = "Telescope live_grep", + ["fc"] = "Telescope grep_string", + ["th"] = "Themery", + ["sm"] = ":MaximizerToggle", -- FTerm - ["h"] = "FTermToggle" + ["h"] = "FTermToggle", + -- Harpoon + ["a"] = "HarpoonAdd", + [""] = "HarpoonUI" }, x = { [""] = ":move '>+1gv-gv", diff --git a/lua/plugins.lua b/lua/plugins.lua index b35d3f9..d8e354a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -58,5 +58,11 @@ require("lazy").setup({ dependencies = { 'nvim-tree/nvim-web-devicons' } }, 'numToStr/FTerm.nvim', - 'github/copilot.vim' + 'github/copilot.vim', + "nvim-lua/plenary.nvim", + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + requires = { { "nvim-lua/plenary.nvim" } } + } }) diff --git a/requirements.md b/requirements.md index 7af35ea..8e297b7 100644 --- a/requirements.md +++ b/requirements.md @@ -4,6 +4,9 @@ - telescope x - theming x - tabfluline x -- terminal + - rice +- terminal x - harpoon -- extended history +- extended history x +- auto-pairs +- lua vim linting