Closed jemag closed 7 months ago
Currently the
s
key toggles between adding and removing items from the list. The issue is that I often want to quickly add a bunch of different files without checking if they are already there and I end up removing them.I see that the
save
function already exists. However:
- is it safe to use that exposed function?
- it would be nice to provide an 'on_attach' function where we can set local bindings to the arrow buffer instead of global ones
You can use safely:
vim.keymap.set("n", "<C-s>", require("arrow.persist").toggle)
Is there a way to set the keybind only for the arrow
buffer though?
Basically I am trying to do either something like:
require("arrow").setup({
on_attach = function()
vim.keymap.set("n", "a", require("arrow.persist").save, { buffer = true})
end,
})
or maybe
vim.api.nvim_create_autocmd("FileType", {
pattern = "arrow",
callback = function()
vim.keymap.set("n", "a", require("arrow.persist").save, { buffer = true})
end,
})
Is there a way to set the keybind only for the
arrow
buffer though?Basically I am trying to do either something like:
require("arrow").setup({ on_attach = function() vim.keymap.set("n", "a", require("arrow.persist").save, { buffer = true}) end, })
or maybe
vim.api.nvim_create_autocmd("FileType", { pattern = "arrow", callback = function() vim.keymap.set("n", "a", require("arrow.persist").save, { buffer = true}) end, })
There is no way to just save, just toggle. I will add an option to do that later on the day
Created an option to save / remove without toggle:
https://github.com/otavioschwanck/arrow.nvim/commit/a302cebc0e52b2e7f5d2cb09066fcf839176dd06
Just add to setup:
separate_save_and_remove = true,
Currently the
s
key toggles between adding and removing items from the list. The issue is that I often want to quickly add a bunch of different files without checking if they are already there and I end up removing them.I see that the
save
https://github.com/otavioschwanck/arrow.nvim/blob/75c892c441cbd51b3b5bc4c527455801e0a7c174/lua/arrow/persist.lua#L41 function already exists. However: