batchy.vim – perform batch operations on files
github.com/arp242/batchy.vimPosted Jun 17, 2021, 6:00 PM UTC
817
Posted Jun 17, 2021, 6:00 PM UTC
Hey! I forked your startscreen.vim a few days ago for my own startscreen! Keep doing great work!
Aha, I had forgotten about that! I haven't used it in years myself 😅
not to knock what you've done, but for linux people
vidir(frommoreutilspackage) is the benchmark. It can also handle deletions, circular renames (not saying yours doesn't; did not read enough to know that), creating intermediate directories if the new name needs it, etc.there's also some rename command that pops up vim too, but vidir is so powerful I never looked anywhere else.
I tried a lot of different things; I couldn't really find anything I liked and trusted. vidir can do really unexpected stuff if you change one of those numbers at the start (e.g. accidentally) and there is no preview at all. It's also a lot less flexible and you won't be able to see the original filename, or see what you (possible accidentally) deleted. making it easy to mix things up.
I mean, whatever works for you of course; but I looked at a lot of different tools over the years and always came back to some variation of what batchy does. Maybe there's something out there, but I'm not aware of it.
It's just an easier way to write shell scripts really. It's super-simple. For these kind of things, that's a feature IMO.
didn't understand your last para but I'll leave that alone.
agree with the rest, vidir is dangerous, but that's true for many tools that are not all GUI etc. Hence I always mention
:cqto abortvidirif needed :)the thing is, it's rare that I need the simpler forms of this kind of functionality, so it just seems easier to reach for a powerful one that you know does everything.
The other thing is I've never had the need to invoke this from within vim, I always needed it from the shell. But maybe that's just me -- I live in vim, vifm (file manager -- another awesome tool that can also do this!), and zsh almost equally.
vidir is not more powerful, just more dangerous. Those are not the same. Actually, Batchy is probably more powerful and flexible, but the UI is a lot simpler IMHO.
You can just create a
vim +:Batchyshell alias, which is what I do. This was mentioned in the README btw, as was the answer to your previous "why not use another tool?"-question. Just sayin'can batchy do file deletes?
can it handle circular renames? (I admit I didn't understand your answer to this earlier).
can it create intermediate directories as needed, if the new name you gave has one or more directory components in it?
can it handle arbitrary list of files piped via STDIN?
Once all of those are "yes", tell me what it can do which vidir cannot, and then you might be on to something. (Please take this from a power user; so things like "both src and dst visible", or file size is visible, don't count; I'm talking about actual functionality not UI)
Edit: just in case it is not clear, I have no stake in vidir -- I didn't write it or whatever. I've been using it for years though. Probably more than a decade, and in all this time nothing has come close to what I can do with it.
What bugs me the most with vidir is that it often happens that I want to rename files for which I don't have the permission. Vidir just fails in that case and all my modifications are lost. I'd rather have vidir generate a shell script then to be able to reexecute it with the correct permissions.
But as u/xkcd__386 said: I need this functionality outside of vim and call it via commandline.
ooh that's an interesting error I have never seen.
Good to keep in mind; thanks!
Oh, Long time Linux user but never heard of vidir. Thanks for the tip!