From aa42105b2be4e701b04bdf67b5fd1746ebf0cd7b Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Fri, 8 Dec 2023 18:03:17 -0500 Subject: [PATCH] Add harpoon --- nix/base-system/flake.nix | 6 +++++- nix/base-system/harpoon-nvim.nix | 10 ++++++++++ nix/base-system/init.lua | 12 ++++++++++++ nix/darwin/flake.lock | 6 +++--- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 nix/base-system/harpoon-nvim.nix diff --git a/nix/base-system/flake.nix b/nix/base-system/flake.nix index 332334a..6a6e4a6 100644 --- a/nix/base-system/flake.nix +++ b/nix/base-system/flake.nix @@ -48,6 +48,10 @@ possession-nvim = pkgs.callPackage ./possession-nvim.nix { inherit (pkgs.vimUtils) buildVimPlugin; inherit (pkgs) fetchFromGitHub; + }; + harpoon-nvim = pkgs.callPackage ./harpoon-nvim.nix { + inherit (pkgs.vimUtils) buildVimPluginFrom2Nix; + inherit (pkgs) fetchFromGitHub; }; expected-parsers = (pkgs.lib.attrVals [ "tree-sitter-rust" @@ -131,7 +135,7 @@ EOF"; vim-dadbod vim-dadbod-ui vim-dadbod-completion - ]) ++ [ possession-nvim ]; + ]) ++ [ possession-nvim harpoon-nvim ]; }; }; diff --git a/nix/base-system/harpoon-nvim.nix b/nix/base-system/harpoon-nvim.nix new file mode 100644 index 0000000..e061fdf --- /dev/null +++ b/nix/base-system/harpoon-nvim.nix @@ -0,0 +1,10 @@ +{buildVimPluginFrom2Nix, fetchFromGitHub, ...}: +buildVimPluginFrom2Nix rec { + name = "harpoon"; + src = fetchFromGitHub { + owner = "ThePrimeagen"; + repo = name; + rev = "harpoon2"; + hash = "sha256-vFK9rxa1BoWSTi9zKTNKucUUD3piK8Yfq8DCVio26A4="; + }; +} diff --git a/nix/base-system/init.lua b/nix/base-system/init.lua index dfa9a22..35f7c3d 100644 --- a/nix/base-system/init.lua +++ b/nix/base-system/init.lua @@ -484,6 +484,18 @@ telescope.setup({ }, }) +local harpoon = require('harpoon') + +harpoon:setup() + +vim.keymap.set("n", "ha", function() harpoon:list():append() end) +vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + +--vim.keymap.set("n", "", function() harpoon:list():select(1) end) +--vim.keymap.set("n", "", function() harpoon:list():select(2) end) +--vim.keymap.set("n", "", function() harpoon:list():select(3) end) +--vim.keymap.set("n", "", function() harpoon:list():select(4) end) + vim.keymap.set("n", "pl", telescope.extensions.possession.list) vim.keymap.set("n", "nff", telescope_builtins.fd) vim.keymap.set("n", "rl", telescope_builtins.lsp_references) diff --git a/nix/darwin/flake.lock b/nix/darwin/flake.lock index 55fe460..948c3ba 100644 --- a/nix/darwin/flake.lock +++ b/nix/darwin/flake.lock @@ -36,12 +36,12 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-AbnaXSoMfu+ZAuilXQWdiwbmTcxzwO1DHbS3dSsQF6g=", - "path": "/nix/store/grgx777xbxak3qgxi8z6px8zczbkks2a-source/nix/base-system", + "narHash": "sha256-TCMfmw3dGAVMO2334x8dhbYn+I0UHJWx3s4joZglEgw=", + "path": "/nix/store/cfch4cncvmvf7lv4b4g835wk97q8ypl0-source/nix/base-system", "type": "path" }, "original": { - "path": "/nix/store/grgx777xbxak3qgxi8z6px8zczbkks2a-source/nix/base-system", + "path": "/nix/store/cfch4cncvmvf7lv4b4g835wk97q8ypl0-source/nix/base-system", "type": "path" } },