Skip to content

vhminh/tree-edit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tree-edit

CLI tool to edit file system tree using a text editor, inspired by oil.nvim

  • List all files in the directory recursively and write the list into a temporary file.

  • Open the temporary file in the text editor (configured by the user with $VISUAL or $EDITOR).

  • User edits the content of the buffer to reflect the desired state.

  • Upon saving, determine the necessary file system operations (create/copy/move/delete) to transform the initial file tree into the new one.

  • If the user confirms, apply those operations.

Demo

Bulk create files

bulk_create_f32_w160_h40-1.mov

Bulk rename files

bulk_rename_f32_w160_h40-1.mov

Swap 2 files

swap_2_file_f32_w160_h40-1.mov

Usage

Set $VISUAL or $EDITOR environment variable to your editor of choice:

  • Neovim: export VISUAL=nvim
  • Nano: export VISUAL=nano

Syntax

$ tree-edit --help
Edit file system tree using a text editor

Usage: tree-edit [OPTIONS] [DIR]

Arguments:
  [DIR]  Directory to operate on, default to current working directory

Options:
      --no-git-ignore  When set, .gitignore will not be respected
      --hidden         Include hidden files
  -h, --help           Print help
  -V, --version        Print version

Example

$ VISUAL=nvim tree-edit .

Install

From source

$ git clone [email protected]:vhminh/tree-edit.git
$ cd tree-edit
$ cargo install --bin tree-edit --path .

Dev

Run unit test

$ cargo test

Run fuzz test

$ time cargo run --release --bin fuzz

About

Edit file system tree using a text editor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages