How to conditionally prevent mini.files from opening on startup #1640
-
Contributing guidelines
Module(s)mini.files QuestionThis is a newbie question but i can't wrap my head around a working solution. Basically I use mini.files as my default file explorer but i'd like on nvim launch that mini.files doesn't open if a (mk)session has been auto loaded (I use persistence.nvim). Any idea how to solve this ? vim.api.nvim_create_autocmd('User', {
pattern = 'PersistenceLoadPost',
callback = function()
require('mini.files').close()
end,
}) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
'mini.files' doesn't open on startup with if Neovim is started as So the answer to "How to conditionally prevent mini.files from opening on startup?" is to not start Neovim in a way that tries to edit a directory. My guess is that either there is some shell alias that opens Neovim like The answer to "How to hide 'mini.files' after session is loaded?" is probably to use A more robust yet more complex solution is to create (inside callback for |
Beta Was this translation helpful? Give feedback.
'mini.files' doesn't open on startup with if Neovim is started as
nvim
from command line. The "default explorer" functionality means that 'mini.files' will open if Neovim is started likenvim .
/nvim path/to/directory
or inside running Neovim instance executing:edit .
/:edit path/to/d…