Closed idr4n closed 4 years ago
Why Startify saves nofile buffers? I don't understand.
I don't want to add :DefxClose
like command.
Can I do something similar for Defx as well?
You can use :Defx -toggle
I don't know why Startify saves nofile buffers, but it happens woth NerdTree, coc-explorer, and Defx.
:Defx -toggle
would not solve the issue as then if Defx is not open, Startify would open it before saving, and I don't keep Defx or any file manager open all the time, but when I do i don't want to worry about closing it first.
Any suggestion about any other session manager that supports Defx, or that doesn't save nofile buffers?
I could raise this issue to Startify instead.
I have added -close
option for it.
Any suggestion about any other session manager that supports Defx, or that doesn't save nofile buffers?
I don't like session managers...
Thanks, -close
works as expected.
Btw, is there a way to check whether Defx is open? Like with the name of the buffer, perhaps. But haven't been able to figure it out what buffer name is given to Defx.
Btw, is there a way to check whether Defx is open? Like with the name of the buffer, perhaps. But haven't been able to figure it out what buffer name is given to Defx.
You should check defx
filetype buffers instead of filename or check b:defx
exists.
You can write Vim script for it.
Warning: I will close the issue without the minimal init.vim and the reproduction instructions.
Problems summary
If Defx is open and I close the session with
:SClose
(which saves and closes the session) using Startify, then when I reopen/load the session I get the message '"[defx] -0" [Not Edited] --No Lines in buffer--' and the window where Defx was at is empty of course. This is assuming that I had open Defx in a vertical split.Also, I have the following mapping to close Nerdtree when it is open and I close another buffer (so Nerdtree is not hanging there as last Window open)
Can I do something similar for Defx as well?
Expected
With NerdTree I manage to avoid this as Startify provides a option to perform a command before saving a session and NerdTree has a command to close it:
I would like to be able to do something similar so I don't have to close Defx before closing the session or before deleting a buffer.
Environment Information
Latest (how do I check?)
OS: MacOS Catalina
neovim/Vim version: Neovim v0.4.3
Provide a minimal init.vim/vimrc with less than 50 lines (Required!)