-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
[FEATURE] Save Quickfix List #173
Comments
Hey @ariel-frischer essentially there is currently no As for somehow implementing this through auto-session, it's not one of the goals of this plugin to implement its own session management separately from what Neovim has to offer, that said, one could use probably the session hooks to achieve saving and reloading the quickfix window while there isn't any upstream support for it. |
@rmagatti Thanks for the response, that issue does seem super old though (2017!) so I'll look into using the session hook. Really loving the repository though it works great out of the box! |
I'll just keep this open though for tracking |
For reference, you can use pre_save_cmds and post_restore_cmds to achieve that, I implemented it here. |
(accidentally deleted my earlier reply) @rbmarliere nice solution! if you don't want to handle the file management, you could leverage the save_extra_cmds = {
function()
local _qflist = vim.fn.getqflist()
if #_qflist == 0 then return nil end
local _qfinfo = vim.fn.getqflist({ title = 1 })
for _, entry in ipairs(_qflist) do
-- the goal is to use SaveQf across nvim instances,
-- so use filename instead of bufnr
entry.filename = vim.api.nvim_buf_get_name(entry.bufnr)
entry.bufnr = nil
end
local _setqflist = string.format('call setqflist(%s)', vim.fn.string(_qflist))
local _setqfinfo = string.format('call setqflist([], "a", %s)', vim.fn.string(_qfinfo))
return { _setqflist, _setqfinfo, 'copen' }
end,
}, |
I am revisiting my position on this particular feature request. While it still holds true that extending auto-session to support session features that aren't nvim-out-of-the-box-supported is still a non-goal, perhaps this could be a worthwhile exception given that quickfix would 1. be very useful 2. is a vim staple feature 3. is fairly simple to implement |
@rmagatti couple of questions:
|
Ideally the history would be saved too. So that :colder etc. is usable across sessions. |
Good points @cameronr.
Sorry about the delay here, busy couple of weeks at work! |
Is your feature request related to a problem? Please describe.
I want to be able to save the quickfix list for each session and maybe even location list.
Describe the solution you'd like
Saving the quickfix list in the session file.
The text was updated successfully, but these errors were encountered: