trouble.nvim
trouble.nvim copied to clipboard
feature: override default quickfix window
Did you check the docs?
- [X] I have read all the trouble.nvim docs
Is your feature request related to a problem? Please describe.
Though trouble.nvim provides a nice quickfix window ui, many plugins or nvim itself calls :copen
to open the quickfix window, so it's troublesome to utilize trouble for quickfix.
Describe the solution you'd like
I found a hack that could hijack the quickfix window.
vim.api.nvim_create_autocmd("FileType", {
pattern = "qf",
callback = function(args)
local bufnr = args.buf
vim.defer_fn(function()
local winid = vim.fn.bufwinid(bufnr)
if winid == -1 then
return
end
vim.api.nvim_win_close(winid, true)
trouble.open "quickfix"
end, 0)
end,
})
Describe alternatives you've considered
Though this hack works, occasionally it will "flicker". Not sure if there exists a better way to handle this.
Additional context
I'm wondering whether trouble.nvim could provide an option to do something like this, or provide this hack directly.