From e8cd1ee3163e5f16835382cd11fd01f349b01d01 Mon Sep 17 00:00:00 2001 From: Michael Paulson Date: Fri, 1 Dec 2023 14:15:38 -0700 Subject: [PATCH] fix: settings section --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index e3ba809..964ea7b 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,27 @@ There is quite a bit of behavior you can configure via `harpoon:setup()` ### Settings Settings can alter the experience of harpoon +**Definition** +```lua +---@class HarpoonSettings +---@field save_on_toggle boolean defaults to true +---@field key (fun(): string) + +``` + +**Descriptions** +* `save_on_toggle`: any time the ui menu is closed then we will sync the state back to the backing list +* `key` how the out list key is looked up. This can be useful when using worktrees and using git remote instead of file path + +**Defaults** +```lua +settings = { + save_on_toggle = false, + key = function() + return vim.loop.cwd() + end, +}, +``` ## ⇁ Social For questions about Harpoon, there's a #harpoon channel on [the Primeagen's Discord](https://discord.gg/theprimeagen) server.