edir 2.30__tar.gz → 2.32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- edir-2.32/Makefile +25 -0
- {edir-2.30 → edir-2.32}/PKG-INFO +69 -46
- edir-2.30/edir.egg-info/PKG-INFO → edir-2.32/README.md +66 -56
- edir-2.30/README.md → edir-2.32/edir.egg-info/PKG-INFO +79 -43
- {edir-2.30 → edir-2.32}/edir.egg-info/SOURCES.txt +0 -1
- {edir-2.30 → edir-2.32}/edir.py +297 -147
- {edir-2.30 → edir-2.32}/pyproject.toml +6 -5
- edir-2.30/.flake8 +0 -3
- edir-2.30/Makefile +0 -22
- {edir-2.30 → edir-2.32}/.gitignore +0 -0
- {edir-2.30 → edir-2.32}/edir.egg-info/dependency_links.txt +0 -0
- {edir-2.30 → edir-2.32}/edir.egg-info/entry_points.txt +0 -0
- {edir-2.30 → edir-2.32}/edir.egg-info/requires.txt +0 -0
- {edir-2.30 → edir-2.32}/edir.egg-info/top_level.txt +0 -0
- {edir-2.30 → edir-2.32}/setup.cfg +0 -0
edir-2.32/Makefile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
NAME = $(shell basename $(CURDIR))
|
|
2
|
+
PYFILES = $(NAME).py
|
|
3
|
+
|
|
4
|
+
check::
|
|
5
|
+
ruff check $(PYFILES)
|
|
6
|
+
mypy $(PYFILES)
|
|
7
|
+
pyright $(PYFILES)
|
|
8
|
+
vermin -vv --no-tips -i $(PYFILES)
|
|
9
|
+
md-link-checker
|
|
10
|
+
|
|
11
|
+
build::
|
|
12
|
+
rm -rf dist
|
|
13
|
+
uv build
|
|
14
|
+
|
|
15
|
+
upload:: build
|
|
16
|
+
uv-publish
|
|
17
|
+
|
|
18
|
+
doc::
|
|
19
|
+
update-readme-usage
|
|
20
|
+
|
|
21
|
+
format::
|
|
22
|
+
ruff check --select I --fix $(PYFILES) && ruff format $(PYFILES)
|
|
23
|
+
|
|
24
|
+
clean::
|
|
25
|
+
@rm -vrf *.egg-info .venv/ build/ dist/ __pycache__/
|
{edir-2.30 → edir-2.32}/PKG-INFO
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: edir
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.32
|
|
4
4
|
Summary: Utility to rename, remove, and copy files/dirs using your editor
|
|
5
5
|
Author-email: Mark Blakeney <mark.blakeney@bullet-systems.net>
|
|
6
|
-
License:
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
7
|
Project-URL: Homepage, https://github.com/bulletmark/edir
|
|
8
8
|
Keywords: vidir,git,trash,trash-put,thrash-d
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -15,7 +15,7 @@ Requires-Dist: platformdirs
|
|
|
15
15
|
[](https://pypi.org/project/edir/)
|
|
16
16
|
[](https://aur.archlinux.org/packages/edir/)
|
|
17
17
|
|
|
18
|
-
[edir][edir] is a command line utility to rename, remove, and copy
|
|
18
|
+
[`edir`][edir] is a command line utility to rename, remove, and copy
|
|
19
19
|
filenames and directories using your text editor. Run it in the current
|
|
20
20
|
directory and `edir` will open your editor on a list of files and
|
|
21
21
|
directories in that directory. Each item in the directory will appear on
|
|
@@ -34,10 +34,10 @@ https://github.com/bulletmark/edir.
|
|
|
34
34
|
|
|
35
35
|
## Advantages Compared to Vidir
|
|
36
36
|
|
|
37
|
-
[edir][edir] unashamedly mimics the functionality of the
|
|
38
|
-
[vidir](https://
|
|
39
|
-
[moreutils](https://joeyh.name/code/moreutils/) but aims to improve it
|
|
40
|
-
|
|
37
|
+
[`edir`][edir] unashamedly mimics the functionality of the
|
|
38
|
+
[vidir](https://man.archlinux.org/man/extra/moreutils/vidir.1.en) utility from
|
|
39
|
+
[moreutils](https://joeyh.name/code/moreutils/) but aims to improve it in the
|
|
40
|
+
following ways:
|
|
41
41
|
|
|
42
42
|
1. `edir` automatically uses `git mv` instead of `mv` and `git rm`
|
|
43
43
|
instead of `rm` for tracked files when invoked within a
|
|
@@ -128,11 +128,11 @@ in the following ways:
|
|
|
128
128
|
14. `edir` adds a `-d/--depth` option to edit to the specified directory
|
|
129
129
|
depth. The default is 1 so `edir a` (if a is a directory) will edit
|
|
130
130
|
names to `a/*`, `edir -d2 a` will edit names to `a/*/*`, etc. `edir
|
|
131
|
-
-d0 a` will just edit the `a` name directly. Can specify `-1` to
|
|
131
|
+
-d0 a` will just edit the `a` name directly. Can specify `-d -1` to
|
|
132
132
|
edit to all depths (or use a large positive number).
|
|
133
133
|
|
|
134
134
|
15. `edir` adds a [`-t/--trash` option](#using-trash) to remove to your
|
|
135
|
-
[Trash]
|
|
135
|
+
[Trash][trash].
|
|
136
136
|
By default this option invokes
|
|
137
137
|
[`trash-put`](https://www.mankier.com/1/trash-put) from the
|
|
138
138
|
[trash-cli](https://github.com/andreafrancia/trash-cli) package to
|
|
@@ -247,14 +247,12 @@ default option off temporarily and re-enable git functionality.
|
|
|
247
247
|
|
|
248
248
|
## Using Trash
|
|
249
249
|
|
|
250
|
-
Given how easy `edir` facilitates deleting files, some users may prefer
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
from where they can be later listed and/or recovered. Specifying
|
|
254
|
-
`-t/--trash` does this by executing the
|
|
250
|
+
Given how easy `edir` facilitates deleting files, some users may prefer to
|
|
251
|
+
remove them to system [Trash][trash] from where they can be later listed and/or
|
|
252
|
+
recovered. Specifying `-t/--trash` does this by executing the
|
|
255
253
|
[`trash-put`](https://www.mankier.com/1/trash-put) command, from the
|
|
256
|
-
[`trash-cli`](https://github.com/andreafrancia/trash-cli) package, to
|
|
257
|
-
|
|
254
|
+
[`trash-cli`](https://github.com/andreafrancia/trash-cli) package, to remove
|
|
255
|
+
files rather than removing them natively.
|
|
258
256
|
|
|
259
257
|
You may want to set `-t/--trash` as a default option. If you do so then
|
|
260
258
|
you can use `-T` on the command line to turn that default option off
|
|
@@ -272,7 +270,7 @@ want to set this as a [default option](#command-default-options).
|
|
|
272
270
|
Many users would like to see a preview of changes after they finish
|
|
273
271
|
editing but before they are actioned by `edir`, i.e. to confirm exactly
|
|
274
272
|
which files/dirs will be deleted, renamed, or copied. Add the
|
|
275
|
-
`-i/--interactive` option and edir will present a list of changes and
|
|
273
|
+
`-i/--interactive` option and `edir` will present a list of changes and
|
|
276
274
|
prompt you to continue, or allow you to re-edit the path list etc.
|
|
277
275
|
Consider setting `--interactive` as a [default
|
|
278
276
|
option](#command-default-options) so you are always prompted.
|
|
@@ -297,18 +295,24 @@ Python 3.8 or later is required. Arch Linux users can install [`edir`
|
|
|
297
295
|
from the AUR](https://aur.archlinux.org/packages/edir) and skip this
|
|
298
296
|
section.
|
|
299
297
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
298
|
+
Note [`edir` is on PyPI](https://pypi.org/project/edir/) so the easiest
|
|
299
|
+
way to install it is to use [`uv tool`][uvtool] (or [`pipx`][pipx] or
|
|
300
|
+
[`pipxu`][pipxu]).
|
|
303
301
|
|
|
304
|
-
```
|
|
305
|
-
$
|
|
302
|
+
```sh
|
|
303
|
+
$ uv tool install edir
|
|
306
304
|
```
|
|
307
305
|
|
|
308
306
|
To upgrade:
|
|
309
307
|
|
|
308
|
+
```sh
|
|
309
|
+
$ uv tool upgrade edir
|
|
310
310
|
```
|
|
311
|
-
|
|
311
|
+
|
|
312
|
+
To uninstall:
|
|
313
|
+
|
|
314
|
+
```sh
|
|
315
|
+
$ uv tool uninstall edir
|
|
312
316
|
```
|
|
313
317
|
|
|
314
318
|
[Git](https://git-scm.com/) must be installed if you want to use the git
|
|
@@ -345,26 +349,26 @@ temporarily override and disable default options on the command line.
|
|
|
345
349
|
|
|
346
350
|
Rename and/or remove any files and directories in the current directory:
|
|
347
351
|
|
|
348
|
-
```
|
|
352
|
+
```sh
|
|
349
353
|
$ edir
|
|
350
354
|
```
|
|
351
355
|
|
|
352
356
|
Rename and/or remove any jpeg files in current dir:
|
|
353
357
|
|
|
354
|
-
```
|
|
358
|
+
```sh
|
|
355
359
|
$ edir *.jpg
|
|
356
360
|
```
|
|
357
361
|
|
|
358
362
|
Rename and/or remove any files under current directory and subdirectories:
|
|
359
363
|
|
|
360
|
-
```
|
|
364
|
+
```sh
|
|
361
365
|
$ find | edir -F
|
|
362
366
|
```
|
|
363
367
|
|
|
364
368
|
Use [`fd`](https://github.com/sharkdp/fd) to view and `git mv/rm`
|
|
365
369
|
repository files only, in the current directory only:
|
|
366
370
|
|
|
367
|
-
```
|
|
371
|
+
```sh
|
|
368
372
|
$ fd -d1 -tf | edir -g
|
|
369
373
|
```
|
|
370
374
|
|
|
@@ -374,9 +378,9 @@ Type `edir -h` to view the usage summary:
|
|
|
374
378
|
|
|
375
379
|
```
|
|
376
380
|
usage: edir [-h] [-i] [-I] [-a] [-A] [-r] [-R] [-q] [-Q] [-G] [-g] [-t]
|
|
377
|
-
[-T] [--trash-program TRASH_PROGRAM] [-c] [-C] [-d DEPTH]
|
|
378
|
-
|
|
379
|
-
[
|
|
381
|
+
[-T] [--trash-program TRASH_PROGRAM] [-c] [-C] [-d DEPTH] [-F |
|
|
382
|
+
-D] [-L] [-N] [-M] [-S] [-E] [-X] [-Y] [-Z] [--suffix SUFFIX]
|
|
383
|
+
[-V]
|
|
380
384
|
[args ...]
|
|
381
385
|
|
|
382
386
|
Program to rename, remove, or copy files and directories using your editor.
|
|
@@ -406,8 +410,7 @@ options:
|
|
|
406
410
|
-c, --no-color do not color rename/remove/copy messages
|
|
407
411
|
-C, --no-invert-color
|
|
408
412
|
do not invert the color to highlight error messages
|
|
409
|
-
-d
|
|
410
|
-
edit paths to specified depth, default=1
|
|
413
|
+
-d, --depth DEPTH edit paths to specified depth, default=1
|
|
411
414
|
-F, --files only show/edit files
|
|
412
415
|
-D, --dirs only show/edit directories
|
|
413
416
|
-L, --nolinks ignore all symlinks
|
|
@@ -424,19 +427,34 @@ options:
|
|
|
424
427
|
-V, --version show edir version
|
|
425
428
|
|
|
426
429
|
Note you can set default starting options in $HOME/.config/edir-
|
|
427
|
-
flags.conf. The negation options (i.e. the --no-* options
|
|
428
|
-
|
|
430
|
+
flags.conf. The negation options (i.e. the --no-* options) allow you to
|
|
431
|
+
temporarily override your defaults.
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## Running with sudo
|
|
435
|
+
|
|
436
|
+
You can use `edir` with `sudo` to rename, delete, or copy system files. For
|
|
437
|
+
improved security, `edir` runs the editing session as your regular user, not as
|
|
438
|
+
root - similar to how `sudoedit` works. This approach allows you to use graphical
|
|
439
|
+
editors (like VS Code), which should not be run as root. To ensure your editor
|
|
440
|
+
settings are preserved, use `sudo -E` so that your `$EDIR_EDITOR` or `$EDITOR`
|
|
441
|
+
environment variable is available. For example, to edit files in `/etc` with VS
|
|
442
|
+
Code:
|
|
443
|
+
|
|
444
|
+
```sh
|
|
445
|
+
export EDIR_EDITOR="code -w"
|
|
446
|
+
sudo -E edir /etc
|
|
429
447
|
```
|
|
430
448
|
|
|
431
449
|
## Embed in Ranger File Manager
|
|
432
450
|
|
|
433
|
-
In many ways `edir` (and `vidir`) is better than the
|
|
434
|
-
|
|
435
|
-
[bulkrename](https://github.com/ranger/ranger/wiki/Official-user-guide#bulk-renaming)
|
|
436
|
-
command which does not handle name swaps and clashes etc. To add `edir`
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
451
|
+
In many ways `edir` (and even `vidir`) is better than the [`ranger`][ranger]
|
|
452
|
+
terminal file manager
|
|
453
|
+
[`bulkrename`](https://github.com/ranger/ranger/wiki/Official-user-guide#bulk-renaming)
|
|
454
|
+
command which does not handle name swaps and clashes etc. To add `edir` as a
|
|
455
|
+
command within [`ranger`][ranger], add or create the following in
|
|
456
|
+
`~/.config/ranger/commands.py`. Then run it from within [`ranger`][ranger] by
|
|
457
|
+
typing `:edir`.
|
|
440
458
|
|
|
441
459
|
```python
|
|
442
460
|
from ranger.api.commands import Command
|
|
@@ -454,8 +472,10 @@ class edir(Command):
|
|
|
454
472
|
return self._tab_directory_content()
|
|
455
473
|
```
|
|
456
474
|
|
|
457
|
-
|
|
458
|
-
|
|
475
|
+
## Use with Yazi File Manager
|
|
476
|
+
|
|
477
|
+
If you use [`yazi`][yazi] for your file manager then you don't need any special
|
|
478
|
+
configuration. Just type `:edir` from within [`yazi`][yazi].
|
|
459
479
|
|
|
460
480
|
## License
|
|
461
481
|
|
|
@@ -466,13 +486,16 @@ General Public License as published by the Free Software Foundation,
|
|
|
466
486
|
either version 3 of the License, or any later version. This program is
|
|
467
487
|
distributed in the hope that it will be useful, but WITHOUT ANY
|
|
468
488
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
469
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
470
|
-
<
|
|
489
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
490
|
+
License at <https://opensource.org/license/gpl-3-0> for more details.
|
|
471
491
|
|
|
472
492
|
[edir]: https://github.com/bulletmark/edir
|
|
473
493
|
[edirpy]: https://pypi.org/project/edir
|
|
474
494
|
[pipx]: https://github.com/pypa/pipx
|
|
475
495
|
[pipxu]: https://github.com/bulletmark/pipxu
|
|
476
496
|
[uvtool]: https://docs.astral.sh/uv/guides/tools/#installing-tools
|
|
497
|
+
[ranger]: https://ranger.github.io/
|
|
498
|
+
[yazi]: https://yazi-rs.github.io/
|
|
499
|
+
[trash]: https://specifications.freedesktop.org/trash-spec/1.0/
|
|
477
500
|
|
|
478
501
|
<!-- vim: se ai syn=markdown: -->
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: edir
|
|
3
|
-
Version: 2.30
|
|
4
|
-
Summary: Utility to rename, remove, and copy files/dirs using your editor
|
|
5
|
-
Author-email: Mark Blakeney <mark.blakeney@bullet-systems.net>
|
|
6
|
-
License: GPLv3
|
|
7
|
-
Project-URL: Homepage, https://github.com/bulletmark/edir
|
|
8
|
-
Keywords: vidir,git,trash,trash-put,thrash-d
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Requires-Python: >=3.8
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
Requires-Dist: platformdirs
|
|
13
|
-
|
|
14
1
|
## EDIR - Rename, Remove, and Copy Files and Directories Using Your Editor
|
|
15
2
|
[](https://pypi.org/project/edir/)
|
|
16
3
|
[](https://aur.archlinux.org/packages/edir/)
|
|
17
4
|
|
|
18
|
-
[edir][edir] is a command line utility to rename, remove, and copy
|
|
5
|
+
[`edir`][edir] is a command line utility to rename, remove, and copy
|
|
19
6
|
filenames and directories using your text editor. Run it in the current
|
|
20
7
|
directory and `edir` will open your editor on a list of files and
|
|
21
8
|
directories in that directory. Each item in the directory will appear on
|
|
@@ -34,10 +21,10 @@ https://github.com/bulletmark/edir.
|
|
|
34
21
|
|
|
35
22
|
## Advantages Compared to Vidir
|
|
36
23
|
|
|
37
|
-
[edir][edir] unashamedly mimics the functionality of the
|
|
38
|
-
[vidir](https://
|
|
39
|
-
[moreutils](https://joeyh.name/code/moreutils/) but aims to improve it
|
|
40
|
-
|
|
24
|
+
[`edir`][edir] unashamedly mimics the functionality of the
|
|
25
|
+
[vidir](https://man.archlinux.org/man/extra/moreutils/vidir.1.en) utility from
|
|
26
|
+
[moreutils](https://joeyh.name/code/moreutils/) but aims to improve it in the
|
|
27
|
+
following ways:
|
|
41
28
|
|
|
42
29
|
1. `edir` automatically uses `git mv` instead of `mv` and `git rm`
|
|
43
30
|
instead of `rm` for tracked files when invoked within a
|
|
@@ -128,11 +115,11 @@ in the following ways:
|
|
|
128
115
|
14. `edir` adds a `-d/--depth` option to edit to the specified directory
|
|
129
116
|
depth. The default is 1 so `edir a` (if a is a directory) will edit
|
|
130
117
|
names to `a/*`, `edir -d2 a` will edit names to `a/*/*`, etc. `edir
|
|
131
|
-
-d0 a` will just edit the `a` name directly. Can specify `-1` to
|
|
118
|
+
-d0 a` will just edit the `a` name directly. Can specify `-d -1` to
|
|
132
119
|
edit to all depths (or use a large positive number).
|
|
133
120
|
|
|
134
121
|
15. `edir` adds a [`-t/--trash` option](#using-trash) to remove to your
|
|
135
|
-
[Trash]
|
|
122
|
+
[Trash][trash].
|
|
136
123
|
By default this option invokes
|
|
137
124
|
[`trash-put`](https://www.mankier.com/1/trash-put) from the
|
|
138
125
|
[trash-cli](https://github.com/andreafrancia/trash-cli) package to
|
|
@@ -247,14 +234,12 @@ default option off temporarily and re-enable git functionality.
|
|
|
247
234
|
|
|
248
235
|
## Using Trash
|
|
249
236
|
|
|
250
|
-
Given how easy `edir` facilitates deleting files, some users may prefer
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
from where they can be later listed and/or recovered. Specifying
|
|
254
|
-
`-t/--trash` does this by executing the
|
|
237
|
+
Given how easy `edir` facilitates deleting files, some users may prefer to
|
|
238
|
+
remove them to system [Trash][trash] from where they can be later listed and/or
|
|
239
|
+
recovered. Specifying `-t/--trash` does this by executing the
|
|
255
240
|
[`trash-put`](https://www.mankier.com/1/trash-put) command, from the
|
|
256
|
-
[`trash-cli`](https://github.com/andreafrancia/trash-cli) package, to
|
|
257
|
-
|
|
241
|
+
[`trash-cli`](https://github.com/andreafrancia/trash-cli) package, to remove
|
|
242
|
+
files rather than removing them natively.
|
|
258
243
|
|
|
259
244
|
You may want to set `-t/--trash` as a default option. If you do so then
|
|
260
245
|
you can use `-T` on the command line to turn that default option off
|
|
@@ -272,7 +257,7 @@ want to set this as a [default option](#command-default-options).
|
|
|
272
257
|
Many users would like to see a preview of changes after they finish
|
|
273
258
|
editing but before they are actioned by `edir`, i.e. to confirm exactly
|
|
274
259
|
which files/dirs will be deleted, renamed, or copied. Add the
|
|
275
|
-
`-i/--interactive` option and edir will present a list of changes and
|
|
260
|
+
`-i/--interactive` option and `edir` will present a list of changes and
|
|
276
261
|
prompt you to continue, or allow you to re-edit the path list etc.
|
|
277
262
|
Consider setting `--interactive` as a [default
|
|
278
263
|
option](#command-default-options) so you are always prompted.
|
|
@@ -297,18 +282,24 @@ Python 3.8 or later is required. Arch Linux users can install [`edir`
|
|
|
297
282
|
from the AUR](https://aur.archlinux.org/packages/edir) and skip this
|
|
298
283
|
section.
|
|
299
284
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
285
|
+
Note [`edir` is on PyPI](https://pypi.org/project/edir/) so the easiest
|
|
286
|
+
way to install it is to use [`uv tool`][uvtool] (or [`pipx`][pipx] or
|
|
287
|
+
[`pipxu`][pipxu]).
|
|
303
288
|
|
|
304
|
-
```
|
|
305
|
-
$
|
|
289
|
+
```sh
|
|
290
|
+
$ uv tool install edir
|
|
306
291
|
```
|
|
307
292
|
|
|
308
293
|
To upgrade:
|
|
309
294
|
|
|
295
|
+
```sh
|
|
296
|
+
$ uv tool upgrade edir
|
|
310
297
|
```
|
|
311
|
-
|
|
298
|
+
|
|
299
|
+
To uninstall:
|
|
300
|
+
|
|
301
|
+
```sh
|
|
302
|
+
$ uv tool uninstall edir
|
|
312
303
|
```
|
|
313
304
|
|
|
314
305
|
[Git](https://git-scm.com/) must be installed if you want to use the git
|
|
@@ -345,26 +336,26 @@ temporarily override and disable default options on the command line.
|
|
|
345
336
|
|
|
346
337
|
Rename and/or remove any files and directories in the current directory:
|
|
347
338
|
|
|
348
|
-
```
|
|
339
|
+
```sh
|
|
349
340
|
$ edir
|
|
350
341
|
```
|
|
351
342
|
|
|
352
343
|
Rename and/or remove any jpeg files in current dir:
|
|
353
344
|
|
|
354
|
-
```
|
|
345
|
+
```sh
|
|
355
346
|
$ edir *.jpg
|
|
356
347
|
```
|
|
357
348
|
|
|
358
349
|
Rename and/or remove any files under current directory and subdirectories:
|
|
359
350
|
|
|
360
|
-
```
|
|
351
|
+
```sh
|
|
361
352
|
$ find | edir -F
|
|
362
353
|
```
|
|
363
354
|
|
|
364
355
|
Use [`fd`](https://github.com/sharkdp/fd) to view and `git mv/rm`
|
|
365
356
|
repository files only, in the current directory only:
|
|
366
357
|
|
|
367
|
-
```
|
|
358
|
+
```sh
|
|
368
359
|
$ fd -d1 -tf | edir -g
|
|
369
360
|
```
|
|
370
361
|
|
|
@@ -374,9 +365,9 @@ Type `edir -h` to view the usage summary:
|
|
|
374
365
|
|
|
375
366
|
```
|
|
376
367
|
usage: edir [-h] [-i] [-I] [-a] [-A] [-r] [-R] [-q] [-Q] [-G] [-g] [-t]
|
|
377
|
-
[-T] [--trash-program TRASH_PROGRAM] [-c] [-C] [-d DEPTH]
|
|
378
|
-
|
|
379
|
-
[
|
|
368
|
+
[-T] [--trash-program TRASH_PROGRAM] [-c] [-C] [-d DEPTH] [-F |
|
|
369
|
+
-D] [-L] [-N] [-M] [-S] [-E] [-X] [-Y] [-Z] [--suffix SUFFIX]
|
|
370
|
+
[-V]
|
|
380
371
|
[args ...]
|
|
381
372
|
|
|
382
373
|
Program to rename, remove, or copy files and directories using your editor.
|
|
@@ -406,8 +397,7 @@ options:
|
|
|
406
397
|
-c, --no-color do not color rename/remove/copy messages
|
|
407
398
|
-C, --no-invert-color
|
|
408
399
|
do not invert the color to highlight error messages
|
|
409
|
-
-d
|
|
410
|
-
edit paths to specified depth, default=1
|
|
400
|
+
-d, --depth DEPTH edit paths to specified depth, default=1
|
|
411
401
|
-F, --files only show/edit files
|
|
412
402
|
-D, --dirs only show/edit directories
|
|
413
403
|
-L, --nolinks ignore all symlinks
|
|
@@ -424,19 +414,34 @@ options:
|
|
|
424
414
|
-V, --version show edir version
|
|
425
415
|
|
|
426
416
|
Note you can set default starting options in $HOME/.config/edir-
|
|
427
|
-
flags.conf. The negation options (i.e. the --no-* options
|
|
428
|
-
|
|
417
|
+
flags.conf. The negation options (i.e. the --no-* options) allow you to
|
|
418
|
+
temporarily override your defaults.
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
## Running with sudo
|
|
422
|
+
|
|
423
|
+
You can use `edir` with `sudo` to rename, delete, or copy system files. For
|
|
424
|
+
improved security, `edir` runs the editing session as your regular user, not as
|
|
425
|
+
root - similar to how `sudoedit` works. This approach allows you to use graphical
|
|
426
|
+
editors (like VS Code), which should not be run as root. To ensure your editor
|
|
427
|
+
settings are preserved, use `sudo -E` so that your `$EDIR_EDITOR` or `$EDITOR`
|
|
428
|
+
environment variable is available. For example, to edit files in `/etc` with VS
|
|
429
|
+
Code:
|
|
430
|
+
|
|
431
|
+
```sh
|
|
432
|
+
export EDIR_EDITOR="code -w"
|
|
433
|
+
sudo -E edir /etc
|
|
429
434
|
```
|
|
430
435
|
|
|
431
436
|
## Embed in Ranger File Manager
|
|
432
437
|
|
|
433
|
-
In many ways `edir` (and `vidir`) is better than the
|
|
434
|
-
|
|
435
|
-
[bulkrename](https://github.com/ranger/ranger/wiki/Official-user-guide#bulk-renaming)
|
|
436
|
-
command which does not handle name swaps and clashes etc. To add `edir`
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
438
|
+
In many ways `edir` (and even `vidir`) is better than the [`ranger`][ranger]
|
|
439
|
+
terminal file manager
|
|
440
|
+
[`bulkrename`](https://github.com/ranger/ranger/wiki/Official-user-guide#bulk-renaming)
|
|
441
|
+
command which does not handle name swaps and clashes etc. To add `edir` as a
|
|
442
|
+
command within [`ranger`][ranger], add or create the following in
|
|
443
|
+
`~/.config/ranger/commands.py`. Then run it from within [`ranger`][ranger] by
|
|
444
|
+
typing `:edir`.
|
|
440
445
|
|
|
441
446
|
```python
|
|
442
447
|
from ranger.api.commands import Command
|
|
@@ -454,8 +459,10 @@ class edir(Command):
|
|
|
454
459
|
return self._tab_directory_content()
|
|
455
460
|
```
|
|
456
461
|
|
|
457
|
-
|
|
458
|
-
|
|
462
|
+
## Use with Yazi File Manager
|
|
463
|
+
|
|
464
|
+
If you use [`yazi`][yazi] for your file manager then you don't need any special
|
|
465
|
+
configuration. Just type `:edir` from within [`yazi`][yazi].
|
|
459
466
|
|
|
460
467
|
## License
|
|
461
468
|
|
|
@@ -466,13 +473,16 @@ General Public License as published by the Free Software Foundation,
|
|
|
466
473
|
either version 3 of the License, or any later version. This program is
|
|
467
474
|
distributed in the hope that it will be useful, but WITHOUT ANY
|
|
468
475
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
469
|
-
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
470
|
-
<
|
|
476
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
477
|
+
License at <https://opensource.org/license/gpl-3-0> for more details.
|
|
471
478
|
|
|
472
479
|
[edir]: https://github.com/bulletmark/edir
|
|
473
480
|
[edirpy]: https://pypi.org/project/edir
|
|
474
481
|
[pipx]: https://github.com/pypa/pipx
|
|
475
482
|
[pipxu]: https://github.com/bulletmark/pipxu
|
|
476
483
|
[uvtool]: https://docs.astral.sh/uv/guides/tools/#installing-tools
|
|
484
|
+
[ranger]: https://ranger.github.io/
|
|
485
|
+
[yazi]: https://yazi-rs.github.io/
|
|
486
|
+
[trash]: https://specifications.freedesktop.org/trash-spec/1.0/
|
|
477
487
|
|
|
478
488
|
<!-- vim: se ai syn=markdown: -->
|