Search and navigate files in nvim-tree with a lightweight overlay, inspired by the Ctrl+S search in Midnight Commander.
- Real-time filtering — results update as you type
- Prefix matching — case-insensitive search by filename
- Keyboard navigation — arrow keys cycle through matches
- Visual highlights — current and regular matches are color-coded
{
"sogimu/nvim-tree-search",
lazy = true,
}Then add <C-s> to your nvim-tree on_attach:
on_attach = function(bufnr) local api = require("nvim-tree.api") api.config.mappings.default_on_attach(bufnr) local opts = { buffer = bufnr, noremap = true, silent = true } vim.keymap.set("n", "<C-s>", function() require("nvim-tree-search").start() end, vim.tbl_extend("force", opts, { desc = "Search" })) end
| Key | Mode | Description |
|---|---|---|
<C-s> |
Normal | Open search overlay |
<CR> |
Insert | Open selected file/directory |
<Esc> |
Insert | Close search |
<C-u> |
Insert | Clear input |
↑ / ↓ |
Insert | Previous / next match |
| Group | Description |
|---|---|
NvimTreeSearchMatch |
Regular matches |
NvimTreeSearchCurrent |
Active/selected match |
