Edit directory with vim
Project description
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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vdir-0.5.3.tar.gz.
File metadata
- Download URL: vdir-0.5.3.tar.gz
- Upload date:
- Size: 94.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.14.5 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9761548afabb7faf15a86c76826675f61701603da62535c04a1104e1ba55d54
|
|
| MD5 |
67d8c57e1e2b72e5f6f4c0a48f0418ce
|
|
| BLAKE2b-256 |
ab50b58035a8e6b3f03a29f343b97894258c555797d9411a075e7b64d2f6007d
|
File details
Details for the file vdir-0.5.3-py3-none-any.whl.
File metadata
- Download URL: vdir-0.5.3-py3-none-any.whl
- Upload date:
- Size: 117.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.14.5 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9afe7c63eb1bfff74964e962136a7dcd801c096e9a37222ce763d9898773d3e1
|
|
| MD5 |
21855ac25db9349b4137b992b2ef639f
|
|
| BLAKE2b-256 |
6b137b99aa48a44d254a074d22ddefbcbb0da02eaef37108cf2dcecf35644175
|