zsh-users
 help / color / mirror / code / Atom feed
* "Edit" files names
@ 2017-09-05 17:56 Yuri D'Elia
  2017-09-05 21:04 ` Mikael Magnusson
  2017-09-06  4:10 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Yuri D'Elia @ 2017-09-05 17:56 UTC (permalink / raw)
  To: zsh-users

Hi everyone,

Let's assume I have a garbled file name that I want to rename more
conveniently into an editor, without painful escaping.

I'd like to do the following:

$ editname *garbled*

popping my $EDITOR with a file containing the original file name
(unescaped), and upon saving+closing, renames the original into the new
name provided. If the pattern expands to more files, it just repeats for
each file, in turn.

It's not hard to implement, but does anybody know of a tool which
already does that (or something very similar)?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "Edit" files names
  2017-09-05 17:56 "Edit" files names Yuri D'Elia
@ 2017-09-05 21:04 ` Mikael Magnusson
  2017-09-05 21:17   ` Yuri D'Elia
  2017-09-06  4:10 ` Bart Schaefer
  1 sibling, 1 reply; 5+ messages in thread
From: Mikael Magnusson @ 2017-09-05 21:04 UTC (permalink / raw)
  To: Yuri D'Elia; +Cc: Zsh Users

On Tue, Sep 5, 2017 at 7:56 PM, Yuri D'Elia <wavexx@thregr.org> wrote:
> Hi everyone,
>
> Let's assume I have a garbled file name that I want to rename more
> conveniently into an editor, without painful escaping.
>
> I'd like to do the following:
>
> $ editname *garbled*
>
> popping my $EDITOR with a file containing the original file name
> (unescaped), and upon saving+closing, renames the original into the new
> name provided. If the pattern expands to more files, it just repeats for
> each file, in turn.
>
> It's not hard to implement, but does anybody know of a tool which
> already does that (or something very similar)?

Have you tried the edit-command-line widget?

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "Edit" files names
  2017-09-05 21:04 ` Mikael Magnusson
@ 2017-09-05 21:17   ` Yuri D'Elia
  0 siblings, 0 replies; 5+ messages in thread
From: Yuri D'Elia @ 2017-09-05 21:17 UTC (permalink / raw)
  To: zsh-users

On Tue, Sep 05 2017, Mikael Magnusson wrote:
>> It's not hard to implement, but does anybody know of a tool which
>> already does that (or something very similar)?
>
> Have you tried the edit-command-line widget?

How would you use it efficiently in the above scenario?

The only way I can think of, is by pre-composing

$ mv *exp* *exp*

thus expand the filename twice, then edit the command (which would then
be escaped in the current style).

Inefficient.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "Edit" files names
  2017-09-05 17:56 "Edit" files names Yuri D'Elia
  2017-09-05 21:04 ` Mikael Magnusson
@ 2017-09-06  4:10 ` Bart Schaefer
  2017-09-06  9:17   ` Simon Ruderich
  1 sibling, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2017-09-06  4:10 UTC (permalink / raw)
  To: Yuri D'Elia; +Cc: Zsh Users

On Tue, Sep 5, 2017 at 10:56 AM, Yuri D'Elia <wavexx@thregr.org> wrote:
>
> It's not hard to implement, but does anybody know of a tool which
> already does that (or something very similar)?

Unless you count emacs' Dired mode, no, I haven't heard of any such thing.

There is zmv, of course, but that's a different approach.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: "Edit" files names
  2017-09-06  4:10 ` Bart Schaefer
@ 2017-09-06  9:17   ` Simon Ruderich
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Ruderich @ 2017-09-06  9:17 UTC (permalink / raw)
  To: Zsh Users; +Cc: Yuri D'Elia

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

On Tue, Sep 05, 2017 at 09:10:20PM -0700, Bart Schaefer wrote:
> On Tue, Sep 5, 2017 at 10:56 AM, Yuri D'Elia wrote:
>>
>> It's not hard to implement, but does anybody know of a tool which
>> already does that (or something very similar)?
>
> Unless you count emacs' Dired mode, no, I haven't heard of any such thing.
>
> There is zmv, of course, but that's a different approach.

There's also vidir (works with any $EDITOR), available in
moreutils [1].

Regards
Simon

[1]: http://joeyh.name/code/moreutils/
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-06  9:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 17:56 "Edit" files names Yuri D'Elia
2017-09-05 21:04 ` Mikael Magnusson
2017-09-05 21:17   ` Yuri D'Elia
2017-09-06  4:10 ` Bart Schaefer
2017-09-06  9:17   ` Simon Ruderich

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).