Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Yeah, I was going to point out some of those same problems.

I wrote the same basic tool about 20 years ago. Since then it has been one of my most heavily-used tools.

It was usually the first tool I missed when I moved to a new environment. And I've been surprised over the years to not run into this functionality by other authors.

I remember missing my precious mvi and thinking, "Oh, vim lets you edit directories, I'll just use that". Gah, what an awkward interface. I can't even do :%s/HTM/html/. I can't use all of the vi features to get all of the file names just right.

So it was nice to finally see this simple idea cross my path. (Surely others have written such a tool, just not that I've run into.)

Over the years my mvi has grown. It is now over 500 lines, actually. It handles all of the cases you outlined. It also lets you copy, link, or delete files. Deleting files leads to the case of "delete b; mv a b" which would be ugly if you did those steps in the wrong order. It deals with very badly named files. It lets you pick whether you want to overwrite files and/or be asked first (it was always important that it be a safe way to rename files -- in fact, I'd often reach for it to do a very simple rename because I knew it wouldn't overwrite even when I didn't have a local equivalent for "mv -n" or wasn't sure what the local equivalent of "mv -i" was).

I'll post the code for it in a bit.

bumby++

Update: Posted at mvi -- mv+vi (+ln+rm+cp+mkdir).

- tye        


In reply to Re^2: Rename files with $EDITOR (more) by tye
in thread Rename files with $EDITOR by bumby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-19 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found