Heavily inspired by vidir from moreutils and
edir.
With a few different design choices:
vdiralways prompts before applying changesvdirdoesn't integrate withgit(for not accidentally messing up your staging area)vdirdisplays an (arguably) pretty-looking preview of the changesvdirpads sequence number to same width for visual block operationsvdirreferencesLS_COLORSfor coloringvdirsupports stage/unstage items dynamicallyvdirsupports stage/unstage items dynamically from shell commands' output- Shell commands could be piped
vdirsupports sorting staged items by several attributes, each of them could be reversedvdirtreats symbolic links as files instead of resolving themvdirsupports editing symbolic links
Check version
sh$ vdir --versionvdir 0.4.1Manage current diretory:
sh$ vdirManage everything including hidden files in current diretory:
sh$ vdir -aManage certain files:
sh$ vdir *.txtManage found files:
sh$ fd --type f | vdirA vdir's vim session looks like this:
# ═════════════════════════════════════════════════════════════════════════════
# - Add paths to stage them. Globs are recognized.
# - Add a '#' before id to untrack an item.
# - Add a '+' before id to expand non-hidden items under the directory.
# - Add a '*' before id to expand all items under the directory.
# - Add a '@' before id to resolve the soft link.
# - Stage items by shell command output: (globs are not supported here)
# $ find . -type f | grep py
# - Sort with:
# :sort [-][type|isdir|isfile|isfifo|islink|path|basename|name|dirname|size|atime|mtime|ctime|birthtime] ...
# - Setup default vd.vimrc with:
# $ vdir --vimrc
# ═════════════════════════════════════════════════════════════════════════════110 ││ LICENSE120 ││ README.md131 ││ __pycache__/140 ││ pyproject.toml151 ││ vdir/Paths could be added directly for next round editing.
Shell commands could be used to add paths in batch. Shell commands could be piped, but note that commands are ran one-by-one, i.e. each command's stdout is collected, returncode is checked, and then all pipe to stdin of the next command.
If one command fails (i.e. returncode != 0), the pipeline stops, and stderr is appended in comment.
The inventory could be sorted with :sort command.
Several attributes are available, each of them could be prefixed with - for reversing the order.
For example, :sort dirname -type basename sorts the inventory with dirname ascending,
type decending, and basename ascending.
When you're done, save and quit, and vdir prompts you the changes like this:
[info] Delete:[LICENSE]
[info] Rename:[README.mdd]
Continue? [(Y)es / (n)o / (e)dit / (r)edo] _
yto apply and continue with anothervimsession- Empty input to apply and quit
nto cancel the editctrl+cto cancel the edit if you're scared of the changeeto continue editingrto restart with initial contents
sh$ pipx install vdir