Closed timtyrrell closed 2 years ago
I was able to add that to a pre_save_cmds
in my session plugin, I am good.
Saving and loading sessions is something I haven't implemented for floating windows and seditors yet, unfortunately.
@timtyrrell Could you please post your fix in #2, for the other users?
@hoschi Sorry I didn't post earlier because I leverage plugins for the workflow, so it is surely not a solution for the masses but works for me. The main part is the close-buffers glob feature and then having the session plugin use the pre-save callback to run the command:
call plug#begin('~/.config/nvim/plugged')
Plug 'nvim-lua/plenary.nvim'
Plug 'hoschi/yode-nvim'
Plug 'kazhala/close-buffers.nvim'
Plug 'rmagatti/auto-session'
call plug#end()
lua << EOF
require('yode-nvim').setup {}
require('auto-session').setup {
pre_save_cmds = {"BDelete glob=yode*"}
}
EOF
Restoring a session will restore the
acwrite
buffers in a non-awesome way. Is there a recommended method or a command that I can run to close all the buftypeacwrite
buffers when I exit vim or can one be added?EDIT: Using https://github.com/kazhala/close-buffers.nvim I am able to run
:BDelete glob=yode*
and they all get closed. Although, when I create an autocmd using the same command I am getting some errors. I tried a few of the exit and leave events and seemed to get the same error each time. Any thoughts on it?autocmd ExitPre * :BDelete glob=yode*