VDIR - Edit directory with vim
Heavily inspired by vidir from moreutils and
edir.
With a few different design choices:
-
vdiralways prompts before applying changes -
vdirdoesn't integrate withgit(for not accidentally messing up your staging area) -
vdirdisplays an (arguably) pretty-looking preview of the changes -
vdirpads sequence number to same width for visual block operations -
vdirreferencesLS_COLORSfor coloring -
vdirsupports stage/unstage items dynamically -
vdirsupports 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 reversed -
vdirtreats symbolic links as files instead of resolving them -
vdirsupports editing symbolic links -
vdirsupports compress/uncompress files bytar,zip, and7z.
Examples (shell)
Check version
sh$ vdir --version
vdir 0.4.1
Manage current diretory:
sh$ vdir
Manage everything including hidden files in current diretory:
sh$ vdir -a
Manage certain files:
sh$ vdir *.txt
Manage found files:
sh$ fd --type f | vdir
Examples (vim)
A 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 ││ LICENSE
120 ││ README.md
131 ││ __pycache__/
140 ││ pyproject.toml
151 ││ 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
Installation
sh$ pipx install vdir
Release files for vdir 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vdir-0.6.0.tar.gz | 95.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vdir-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 213.1 kB
Release files / vdir-0.6.0.tar.gz
| Download URL | vdir-0.6.0.tar.gz |
|---|---|
| Size | 95.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa6118d694b5c565ec517572a67286e63880f684c4e285777582f5817381e169
|
|
BLAKE2b-256 checksum How to use checksums |
8beb3f8b01b388b394a5b84e2b05c96ceec32ca3d16291081afcc34731230bfc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.16.5 cpython/3.14.5 HTTPX/0.28.1
|
Release files / vdir-0.6.0-py3-none-any.whl
| Download URL | vdir-0.6.0-py3-none-any.whl |
|---|---|
| Size | 118.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2051e5cc09b3821dc817aa8a169a724eddf2ab8c49bf884fcbb1ab2a48adce85
|
|
BLAKE2b-256 checksum How to use checksums |
f36f812b8cb74765b6db200b5210d7da793afe2aaf75142430a51b8793513b69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.16.5 cpython/3.14.5 HTTPX/0.28.1
|