feat: actions for sending oil entries to quickfix (#249)

* Implement actions for sending oil entries to quickfix/location-list

* Use vim.notify instead of vim.notify_once in util quickfix function

* Remove redundant files/directories options for sending to qf

always send just files

* set qflist/loclist with a single call

* Add type annotations and default values for send_to_quickfix

* In visual mode, send only selected items to qf
This commit is contained in:
Luka Potočnik 2023-12-08 06:01:13 +01:00 committed by GitHub
parent b3c24f4b3b
commit 3ffb8309e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 105 additions and 11 deletions

View file

@ -337,6 +337,46 @@ M.toggle_trash = {
end,
}
M.send_to_qflist = {
desc = "Sends files in the current oil directory to the quickfix list, replacing the previous entries.",
callback = function()
util.send_to_quickfix({
target = "qflist",
mode = "r",
})
end,
}
M.add_to_qflist = {
desc = "Adds files in the current oil directory to the quickfix list, keeping the previous entries.",
callback = function()
util.send_to_quickfix({
target = "qflist",
mode = "a",
})
end,
}
M.send_to_loclist = {
desc = "Sends files in the current oil directory to the location list, replacing the previous entries.",
callback = function()
util.send_to_quickfix({
target = "loclist",
mode = "r",
})
end,
}
M.add_to_loclist = {
desc = "Adds files in the current oil directory to the location list, keeping the previous entries.",
callback = function()
util.send_to_quickfix({
target = "loclist",
mode = "a",
})
end,
}
---List actions for documentation generation
---@private
M._get_actions = function()