I've been looking through
:help autocmd-events for an event that is going to be ran when a file is closed, but I got pretty confused, seeing there were many events that sound like they might do their job, but also that might not do it completely, for example:
BufLeave, but their descriptions confuse me a bit.
What I am looking for is an autocmd that is going to be run on any writable file, excepting some filetypes that appear in a table, before the respective file is closed.
What autocmd event should I be using for this situation, and how would the pattern I mentioned look like? I'll be writing my config in Lua, but Vimscript solutions are welcome too, since I can translate them for myself later.
<afile>filetype should be checked against your list.
:help tabline) shows open tab pages. Perhaps you have a plugin that uses it to display buffers?