A modern file browser for Neovim built on top of snacks.nvim that provides telescope-style navigation in a floating picker interface.
- π Fast and lightweight - Built on snacks.nvim picker
- π Telescope-style navigation - Use
<C-l>and<C-h>for intuitive browsing - π¨ Proper file icons - Integrates with your icon theme (mini.icons, nvim-web-devicons)
- β‘ Non-recursive browsing - Shows only current directory contents
- π§ Highly configurable - Customize keymaps, icons, and behavior
- π Modern Lua plugin - Type-annotated with lazy loading
- Neovim >= 0.9.0
- snacks.nvim
With lazy.nvim
{
"your-username/snacks-file-browser.nvim",
dependencies = { "folke/snacks.nvim" },
opts = {
-- Configuration options (see below)
},
keys = {
{ "<leader>e", function() require("snacks-file-browser").browse_current() end, desc = "File Browser" },
{ "<leader>E", function() require("snacks-file-browser").browse_cwd() end, desc = "File Browser (CWD)" },
},
}-- Add the plugin
require("snacks-file-browser").setup({
-- Your configuration
})
-- Set up keymaps
vim.keymap.set("n", "<leader>e", function() require("snacks-file-browser").browse_current() end, { desc = "File Browser" })
vim.keymap.set("n", "<leader>E", function() require("snacks-file-browser").browse_cwd() end, { desc = "File Browser (CWD)" })- Browse current file's directory:
require("snacks-file-browser").browse_current() - Browse current working directory:
require("snacks-file-browser").browse_cwd() - Browse specific directory:
require("snacks-file-browser").browse("/path/to/directory")
Once the file browser is open:
<C-l>- Enter directories or open files<C-h>- Go back to parent directory<CR>- Alternative to<C-l>(enter/open)- Type to filter - Start typing to filter files and directories
<Esc>- Close the browser
Default configuration:
{
keymaps = {
enter = "<C-l>", -- Key to enter directories or open files
back = "<C-h>", -- Key to go back to parent directory
confirm = "<CR>", -- Alternative key to enter/open
},
icons = {
enabled = true, -- Whether to show file icons
dir = "π ", -- Icon for directories
file = "π ", -- Default icon for files
},
show_hidden = false, -- Whether to show hidden files (starting with .)
sort_directories_first = true, -- Whether directories appear before files
}{
keymaps = {
enter = "<C-l>",
back = "<C-h>",
confirm = "<CR>",
},
}{
keymaps = {
enter = "<Tab>",
back = "<S-Tab>",
confirm = "<CR>",
},
}Show hidden files
{
show_hidden = true,
}{
icons = {
enabled = true,
dir = "σ° ",
file = "σ° ",
},
}require("snacks-file-browser").setup(opts)Open file browser in specified directory.
start_dir(string, optional): Directory to start browsing from
Browse current file's directory.
Browse current working directory.
| Feature | snacks-file-browser | telescope file_browser | nvim-tree | oil.nvim |
|---|---|---|---|---|
| Interface | Floating picker | Floating picker | Sidebar tree | Buffer |
| Navigation | Telescope-style | Telescope-style | Tree expansion | Buffer editing |
| Performance | Fast | Fast | Medium | Fast |
| Dependencies | snacks.nvim | telescope.nvim | None | None |
| File operations | View/Open only | Full CRUD | Full CRUD | Full CRUD |
- Lightweight: Built on the fast snacks.nvim picker infrastructure
- Familiar: Uses telescope-style navigation that many users already know
- Consistent: Integrates seamlessly with other snacks.nvim components
- Simple: Focused on file browsing without complex file operations
- Modern: Pure Lua with type annotations and lazy loading
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.