A file explorer for snacks. This is actually a picker in disguise.
This module provide a shortcut to open the explorer picker and a setup function to replace netrw with the explorer.
When the explorer and replace_netrw
is enabled, the explorer will be opened:
- when you start
nvim
with a directory - when you open a directory in vim
Configuring the explorer picker is done with the picker options.
-- lazy.nvim
{
"folke/snacks.nvim",
---@type snacks.Config
opts = {
explorer = {
-- your explorer configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
picker = {
sources = {
explorer = {
-- your explorer picker configuration comes here
-- or leave it empty to use the default settings
}
}
}
}
}
-- lazy.nvim
{
"folke/snacks.nvim",
---@type snacks.Config
opts = {
explorer = {
-- your explorer configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
}
}
These are just the general explorer settings.
To configure the explorer picker, see snacks.picker.explorer.Config
---@class snacks.explorer.Config
{
replace_netrw = true, -- Replace netrw with the snacks explorer
}
---@type fun(opts?: snacks.picker.explorer.Config): snacks.Picker
Snacks.explorer()
Shortcut to open the explorer picker
---@param opts? snacks.picker.explorer.Config|{}
Snacks.explorer.open(opts)