From 7f63328de1436139ed5aae2f297b59e528c8e1fd Mon Sep 17 00:00:00 2001 From: Theodor Bjorkman Date: Fri, 28 Feb 2025 19:10:53 +0100 Subject: [PATCH] Fixed PR comments Formatting and changelog --- docs/release-notes/rl-0.8.md | 4 ++ modules/plugins/utility/harpoon/config.nix | 10 ---- modules/plugins/utility/harpoon/default.nix | 2 +- modules/plugins/utility/harpoon/harpoon.nix | 52 +++++++++++---------- 4 files changed, 32 insertions(+), 36 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 0440f38f..1703d86d 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -192,3 +192,7 @@ - Add formatters for go: [gofmt](https://go.dev/blog/gofmt), [golines](https://github.com/segmentio/golines) and [gofumpt](https://github.com/mvdan/gofumpt) + +[UltraGhostie](https://github.com/UltraGhostie) + +- Add [harpoon](https://github.com/ThePrimeagen/harpoon) plugin for navigation diff --git a/modules/plugins/utility/harpoon/config.nix b/modules/plugins/utility/harpoon/config.nix index 871a338a..487e67e4 100644 --- a/modules/plugins/utility/harpoon/config.nix +++ b/modules/plugins/utility/harpoon/config.nix @@ -5,8 +5,6 @@ ... }: let inherit (lib.modules) mkIf; - inherit (lib.lists) optionals; - inherit (lib.strings) concatStrings; inherit (lib.nvim.binds) pushDownDefault mkKeymap; cfg = config.vim.navigation.harpoon; @@ -23,14 +21,6 @@ in { setupModule = "harpoon"; inherit (cfg) setupOpts; - before = '' - ''; - - after = '' - local harpoon = require("harpoon") - harpoon.setup({}) - ''; - cmd = ["Harpoon"]; keys = [ diff --git a/modules/plugins/utility/harpoon/default.nix b/modules/plugins/utility/harpoon/default.nix index 1299f6a5..21637c5b 100644 --- a/modules/plugins/utility/harpoon/default.nix +++ b/modules/plugins/utility/harpoon/default.nix @@ -1,4 +1,4 @@ -_: { +{ imports = [ ./harpoon.nix ./config.nix diff --git a/modules/plugins/utility/harpoon/harpoon.nix b/modules/plugins/utility/harpoon/harpoon.nix index 5f1e93e0..9e313611 100644 --- a/modules/plugins/utility/harpoon/harpoon.nix +++ b/modules/plugins/utility/harpoon/harpoon.nix @@ -4,29 +4,6 @@ inherit (lib.nvim.binds) mkMappingOption; inherit (lib.nvim.types) mkPluginSetupOption luaInline; inherit (lib.generators) mkLuaInline; - setupOptions = { - defaults = { - save_on_toggle = mkOption { - description = "any time the ui menu is closed then we will save the state back to the backing list, not to the fs"; - type = bool; - default = false; - }; - sync_on_ui_close = mkOption { - description = "any time the ui menu is closed then the state of the list will be sync'd back to the fs"; - type = bool; - default = false; - }; - key = mkOption { - description = "how the out list key is looked up. This can be useful when using worktrees and using git remote instead of file path"; - type = luaInline; - default = mkLuaInline '' - function() - return vim.loop.cwd() - end - ''; - }; - }; - }; in { options.vim.navigation.harpoon = { mappings = { @@ -38,8 +15,33 @@ in { file4 = mkMappingOption "Go to marked file 4 [Harpoon]" ""; }; - enable = mkEnableOption "Harpoon: quick bookmarks on keybinds"; + enable = mkEnableOption "Quick bookmarks on keybinds [Harpoon]"; - setupOpts = mkPluginSetupOption "Harpoon" setupOptions; + setupOpts = mkPluginSetupOption "Harpoon" { + defaults = { + save_on_toggle = mkOption { + type = bool; + default = false; + description = '' any time the ui menu is closed then we will save the + state back to the backing list, not to the fs''; + }; + sync_on_ui_close = mkOption { + type = bool; + default = false; + description = '' any time the ui menu is closed then the state of the + list will be sync'd back to the fs''; + }; + key = mkOption { + type = luaInline; + default = mkLuaInline '' + function() + return vim.loop.cwd() + end + ''; + description = '' how the out list key is looked up. This can be useful + when using worktrees and using git remote instead of file path''; + }; + }; + }; }; }