dorkhub

dirbuf.nvim

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

elihunter173
Lua4686 forksAGPL-3.0updated 3 years ago
git clone https://github.com/elihunter173/dirbuf.nvim.gitelihunter173/dirbuf.nvim

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.
dirbuf_demo_2022-04-06.mp4

Installation

Requires Neovim 0.6 or higher.

Notes

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

require("nvim-tree").setup {
    update_to_buf_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 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/.

more like this

r2

Free open-source Cloudflare R2 desktop client and S3 GUI for macOS, Windows, and Linux. Manage Cloudflare R2, AWS S3, M…

TypeScript50

Scythe

SCYTHE is a lightweight, C#-based game engine focused on modifiability and rapid iteration using Raylib.

C#50

meine

meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…

Python50

search

search projects, people, and tags