Closed ixzh closed 3 years ago
Press Left
on the symlink and it will take you to the target file. Then rename it.
Press
Left
on the symlink and it will take you to the target file. Then rename it.
That's good for an individual file. But if there are hundreds of files from different folders, rename them one by one is tedious. Use find to filter the list and batch rename accordingly is more practical I think.
While it's a regular use case for you, implementing it is roundabout - we have to find each target, add to a new buffer and then rename. Sorry, there is no ROI for us here.
Thanks anyway!
@ixzh this use-case maybe better solved by some dedicated batch-ranamer script/program. There are quite a lot out there, although I haven't used any.
@ixzh this use-case maybe better solved by some dedicated batch-ranamer script/program. There are quite a lot out there, although I haven't used any.
you mean in the plugin listing? Or where can I find? I'm using the default scripts/.nmv.
you mean in the plugin listing?
No, independent ones.
Or where can I find?
You can try searching for "batch renamer" in github. As I've said, I don't use any so I can't recommend one.
you mean in the plugin listing?
No, independent ones.
Or where can I find?
You can try searching for "batch renamer" in github. As I've said, I don't use any so I can't recommend one.
Ok, thank you! I will try to figure out a way.
On second thoughts, @KlzXS do you think we can extend the batchrename script to rename the files in the current directory but apply to the symlink targets? We can see if we can figure a way to indicate to the script if this is a case of a listed directory.
If someone else wants to give it a try, we will need to rename the target for the symlink in plugin .nmv
rather than the file itself to achieve this.
The main program can set an env var before calling .nmv
to indicate that the current directory is in listing mode.
We can do that. Make .nmv
resolve symlinks if. Suggest a name for the env variable.
$NNN_LIST
Resolved at commit 470c777f2d50f21f817b89129c0ee89b8a3b3a35.
@ixzh please confirm the fix.
Please test with commit eb769c0de5d762280b2bd973e3024890c884a58e as I have made a minor modification.
Thank you for the workout!! I have tested the following, and the files are missing after renaming their symbolic links in list mode:
I put 3 files in the following place
and start nnn using fd . ~/Downloads/Telegram\ Desktop/ -0 | nnn
and r
batch rename by prepending a number in Vim
becomes:
and :wq
, the listing now shows 3 files and 3 symbolic links
pressing q
, and the target files are gone.
I also tried fd . ~/Downloads/Telegram\ Desktop/ -0 | NNN_LIST=1 nnn
in step 2, same result.
So are the files removed from disk by doing the above? I can't locate them in my system.
Another issue: the getplugs plugin seems to download an outdated zip.
the getplugs plugin seems to download an outdated zip
By default it downloads a zip that goes with the version of nnn. To download from master run it as getplugs master
.
the getplugs plugin seems to download an outdated zip
By default it downloads a zip that goes with the version of nnn. To download from master run it as
getplugs master
.
I see. I'll amend my plugin command. Thanks!
I can see where the problem is. For now use it only with selection.
hey
since commit #1508874, .nmv seems not to work for 'c'urrent
:
I changed the leading 0
s to .
s, also can't save the changes.
@KlzXS can you please take a look?
See #1232. I hope this ends the whole saga.
thank you! it works.
Is your feature request related to a problem? Please describe.
fd pdf ~/Downloads -0 | nnn
can be used to show and open files, but batch renamer
doesn't work.Describe the solution you'd like
Would it be possible to make
r
operate on symlink list to rename target files? seems to be a natural extension of ther
function.