-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Comment functionality" in file list? #582
Comments
This probably doesn't make sense as a feature of harpoon. However, there are a couple ways you could modify your config to accomplish this. You could add a second list with an empty select function and a different keymap. Here are examples of both approaches: local Harpoon = require("harpoon")
Harpoon:setup({
settings = {
save_on_toggle = true,
sync_on_ui_close = true,
},
default = {
select = function(list_item, list, options)
if
list_item.value ~= nil
and string.sub(list_item.value, 1, 1) == "#"
then
return
end
require("harpoon.config")
.get_default_config().default
.select(list_item, list, options)
end,
},
notes = {
select = function() end,
},
})
vim.keymap.set("n", "<leader>h", function()
Harpoon.ui:toggle_quick_menu(Harpoon:list(), {
title = " Harpoon Marks ",
})
end)
vim.keymap.set("n", "<leader>n", function()
Harpoon.ui:toggle_quick_menu(Harpoon:list("notes"), {
title = " Harpoon Notes ",
})
end) I hope this helps! |
Interesting ideas, thank you for your input! Is the select function the same one that's called as when you do the "open Nth harpooned file" command? If it is, I might be able to write a "clever" function that tries picking the first file line after the selection if the selection is not a file. (Also, oops, wrong account) |
Dunno if this is totally dumb, but I thought I could at least drop the idea since I'm really enjoying Harpoon2 and realised this might be useful to others.
What issue are you having that you need harpoon to solve?
I would like to write notes in the harpoon file list to remember what I thought yesterday, when I'm checking what I had harpooned when I left. For this purpose, it would be nice if harpoon ignored file names that began with a specific (probably configurable) character, such as '#'.
Why doesn't the current config help?
Leaning on harpoon for regaining context when resuming work the following day.
What proposed api changes are you suggesting?
Adding a config parameter for a comment character (sort of how git allows you to change what it uses in the beginning of comment lines), in order to be able to add comments that don't affect the order of files when using the "open file N in the list" bindings.
The text was updated successfully, but these errors were encountered: