elihunter173
dirbuf.nvim
Lua

A file manager for Neovim which lets you edit your filesystem like you edit text

Last updated Jul 8, 2026
466
Stars
6
Forks
18
Issues
+1
Stars/day
Attention Score
42
Language breakdown
Lua 90.1%
Vim Script 9.9%
โ–ธ Files click to expand
README

dirbuf.nvim

A directory buffer for Neovim that lets you edit your filesystem like you edit text. Inspired by [vim-dirvish] and [vidir].

Features

Intuitive:* Create, copy, delete, and rename files, directories, and more by editing their lines in the directory buffer. Buffer names are automatically updated to reflect changes. Minimal:* Works out of the box with no configuration. Default mappings easily changed. Unobtrusive:* Preserves alternate buffers and navigation history. Switch between files with Ctrl-^ (Ctrl-6) and jump around your navigation history with custom <Plug> mappings. Safe:* Does not modify the filesystem until you save the buffer. Optionally request confirmation and dry-run saving. Reliable:* Resolves inter-dependencies in batch renames, including cycles. Polite:* Plays nicely with tree-based file viewers like [nvim-tree.lua], [fern.vim], and [carbon.nvim].

https://user-images.githubusercontent.com/42009212/162110083-9fd3701f-8ffb-4cf7-9333-d57020a9242e.mp4

Installation

Requires Neovim 0.6 or higher.

  • [vim-plug]: Plug "elihunter173/dirbuf.nvim"
  • [packer.nvim]: use "elihunter173/dirbuf.nvim"

Notes

If you use nvim-tree.lua, you must disable the :help nvim-tree.updatetobuf_dir option. Otherwise, Dirbuf will fail to open directory buffers.

require("nvim-tree").setup {
    updatetobuf_dir = { enable = false }
}

Usage

Run the command :Dirbuf to open a directory buffer. Press - in any buffer to open a directory buffer for its parent. Editing a directory will also open up a directory buffer, overriding Netrw.

Inside a directory buffer, there are the following keybindings:

  • <CR>: Open the file or directory at the cursor.
  • gh: Toggle showing hidden files (i.e. dot files).
  • -: Open parent directory.
See :help dirbuf.txt for more info.

Configuration

Configuration is not necessary for Dirbuf to work. But for those that want to override the default config, the following options are available with their default values listed.

require("dirbuf").setup {
    hash_padding = 2,
    show_hidden = true,
    sort_order = "default",
    write_cmd = "DirbufSync",
}

Read the documentation for more information (:help dirbuf-options).

Development

A [Justfile][just] is provided to test and lint the project.

# Run unit tests
$ just test

Run luacheck

$ just lint

just test will automatically download [plenary.nvim]'s test harness and run the *_spec.lua tests in tests/.

[carbon.nvim]: https://github.com/SidOfc/carbon.nvim [fern.vim]: https://github.com/lambdalisue/fern.vim [just]: https://github.com/casey/just [nvim-tree.lua]: https://github.com/kyazdani42/nvim-tree.lua [packer.nvim]: https://github.com/wbthomason/packer.nvim [plenary.nvim]: https://github.com/nvim-lua/plenary.nvim [vidir]: https://github.com/trapd00r/vidir [vim-dirvish]: https://github.com/justinmk/vim-dirvish [vim-plug]: https://github.com/junegunn/vim-plug

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท elihunter173/dirbuf.nvim ยท Updated daily from GitHub