Closed mengq627 closed 1 month ago
I think it's not possible right now, but I would like this feature as well :)
I recommend having a keybinding or some other way so you can easily :qa
or :wqa
. Personally I use a keybinding for this and would use it whenever I want to exit neovim, regardless of how many windows are open.
I recommend having a keybinding or some other way so you can easily
:qa
or:wqa
. Personally I use a keybinding for this and would use it whenever I want to exit neovim, regardless of how many windows are open.
That's good, it is useful. However, I have not set plugin which can open&edit multiple file at same time, I don't know what to do when closing one of multiple files , is this method still valid?
qa/wqa closes multiple buffers and windows. And you can use to close both the outline and the code window, or if the outline isn't open at all.
An autocmd can also be used that closes neovim when a window is closed and the outline is the last one remaining, so I wouldn't really consider this something outline.nvim needs to support.
I am using this autocmd and it seems to work. When entering a buffer is triggered it checks that the buffer filetype is Outline and if we are in the last remaining window, it will close neovim.
vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
if vim.bo.filetype == "Outline" and vim.fn.winnr('$') == 1 then
vim.cmd("q")
end
end,
})
I am using this autocmd and it seems to work. When entering a buffer is triggered it checks that the buffer filetype is Outline and if we are in the last remaining window, it will close neovim.
vim.api.nvim_create_autocmd("BufEnter", { callback = function() if vim.bo.filetype == "Outline" and vim.fn.winnr('$') == 1 then vim.cmd("q") end end, })
It's so great, help me a lot. So thanks! 😆
when I open outline window and code window, if I close code window by
:wq
, I need to close outline window by:q
again. I have not seen related configuration in doc.