From f2dd3538ce88f312d480678cc204a97eccc11ca1 Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 2 Jul 2025 15:27:38 +0200 Subject: [PATCH] Harpoon, fugitive and supermaven --- init.lua | 12 +++---- lazy-lock.json | 3 ++ lua/custom/plugins/init.lua | 64 ++++++++++++++++++++++++++++++++++++- 3 files changed, 72 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index 2947e600..7708c240 100644 --- a/init.lua +++ b/init.lua @@ -96,15 +96,15 @@ vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = tr vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -- Nicer tab handling in visual mode -vim.keymap.set("v", "<", "", ">gv") +vim.keymap.set('v', '<', '', '>gv') -- Nicer movement in visual mode -vim.keymap.set("v", "J", ":m '>+1gv=gv") -vim.keymap.set("v", "K", ":m '<-2gv=gv") +vim.keymap.set('v', 'J', ":m '>+1gv=gv") +vim.keymap.set('v', 'K', ":m '<-2gv=gv") -- Additional map for neotree -vim.keymap.set("n", "te", "Neotree toggle") +vim.keymap.set('n', 'te', 'Neotree toggle') -- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = true @@ -1000,7 +1000,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lazy-lock.json b/lazy-lock.json index 77aadf6b..511b5ad7 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -5,6 +5,7 @@ "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "gitsigns.nvim": { "branch": "main", "commit": "588264bee92993df92535b6742576f5655c91b1c" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" }, @@ -18,10 +19,12 @@ "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, + "vim-fugitive": { "branch": "master", "commit": "593f831d6f6d779cbabb70a4d1e6b1b1936a88af" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..871c8d3d 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,66 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + -- Git integration in nvim + 'tpope/vim-fugitive', + + -- Supermaven integration + { + 'supermaven-inc/supermaven-nvim', + config = function() + require('supermaven-nvim').setup { + keymaps = { + accept_word = '', + accept_suggestion = '', + }, + } + end, + }, + + -- Harpoon, for quick file navigation + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local harpoon = require 'harpoon' + harpoon:setup() + + vim.keymap.set('n', '', function() + harpoon:list():add() + end) + + vim.keymap.set('n', 'H', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + + vim.keymap.set('n', '1', function() + harpoon:list():select(1) + end) + + vim.keymap.set('n', '2', function() + harpoon:list():select(2) + end) + + vim.keymap.set('n', '3', function() + harpoon:list():select(3) + end) + + vim.keymap.set('n', '4', function() + harpoon:list():select(4) + end) + + vim.keymap.set('n', '5', function() + harpoon:list():select(5) + end) + + -- Go back to the previous buffer + vim.keymap.set('n', '`', 'b#') + + local harpoon_extensions = require 'harpoon.extensions' + harpoon:extend(harpoon_extensions.builtins.highlight_current_file()) + end, + }, +} +-- vim: ts=2 sts=2 sw=2 et