Skip to main content

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:

  • vdir always prompts before applying changes

  • vdir doesn't integrate with git (for not accidentally messing up your staging area)

  • vdir displays an (arguably) pretty-looking preview of the changes

  • vdir pads sequence number to same width for visual block operations

  • vdir references LS_COLORS for coloring

  • vdir supports stage/unstage items dynamically

  • vdir treats symbolic links as files instead of resolving them

  • vdir supports editing symbolic links

Examples (shell)

Edit the current diretory:

sh$ vdir

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 a path to track it.
# - Sort the paths as you want.
# - Add a '#' before the id to untrack an item.
# - Add a '+' before the id to expand non-hidden items under the directory.
# - Add a '*' before the id to expand all items under the directory.
# - Add a '@' before the id to resolve the soft link.
# - Setup default vdir.vimrc with
#   $ vdir --vimrc
# ═════════════════════════════════════════════════════════════════════════════

110 ││ LICENSE
120 ││ README.md
131 ││ __pycache__/
140 ││ pyproject.toml
151 ││ vdir/

Edit the content, 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] _
  • y to apply and continue with another vim session
  • Empty input to apply and quit
  • n to cancel the edit
  • ctrl+c to cancel the edit if you're scared of the change
  • e to continue editing
  • r to restart with initial contents

Installation

vdir

sh$ pipx install vdir

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vdir-0.2.4.tar.gz (92.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vdir-0.2.4-py3-none-any.whl (114.9 kB view details)

Uploaded Python 3

File details

Details for the file vdir-0.2.4.tar.gz.

File metadata

  • Download URL: vdir-0.2.4.tar.gz
  • Upload date:
  • Size: 92.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.3 HTTPX/0.28.1

File hashes

Hashes for vdir-0.2.4.tar.gz
Algorithm Hash digest
SHA256 ecb7e857d6f3f8c331fe6165a01a999ff76e0c5ad8d4fa3a94bc34f7db269475
MD5 5ea3b892bd444baa4fb1a128e39db978
BLAKE2b-256 d2db2b0a4c18abd2db27422907673a4ddeb9c69685e2cbeb825617dbfc1f6b02

See more details on using hashes here.

File details

Details for the file vdir-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: vdir-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 114.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.3 HTTPX/0.28.1

File hashes

Hashes for vdir-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0cd6e4e963879dab5d937997a44bd75fa029936c9d041c44b12c29a5dcc95e5b
MD5 d07bacb9f45acb52290fdcb6822458a3
BLAKE2b-256 d7d03d694ce33ace1a27d900e93eef1636f3f3d8e14f0e6bca2ada82e9de498a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page