Rename files with same basename

In another file manager I used to use, there is a feature that works like this:

  • you press F2 to rename a file
  • you change the basename to something else
  • you press enter
  • now comes the interesting part. If there is one or more files that had the same basename, the file manager shows a dialog asking yes/no if you want to change the other files to the same new basename.

This is handy if you are, for example, renaming a video and subtitle files (and many other use cases).

This feature is configurable in the file manager options to be enabled or disabled.

Is it viable to implement it in dopus?

You can already do that in Opus; just select the files you want to rename first.

You can use Select SIMILARBASE to automatically select the other files.

Alternatively, use the full Rename dialog instead of simple inline-rename, and there is an option in there to "rename matching filenames as one" which is similar. (Although you often don't need that as the rename often naturally results in the same thing. Depends what patterns/operations you are applying to the names.)

Ok, I selected all files, pressed F2 and renamed.
It is a 2 step process but does the job.
Thank you!

I rescripted the F2 key to come closer to what I was used to:

@ifsel:numfiles=1
Select SIMILARBASE
rename inline

@ifsel:else
rename inline

The only downside (that occurs even with the standard script - rename inline) is that, after the renaming of 2 or more similar base files, renaming from ABC.txt to LMN.txt, the focused file goes to the file next to ABC.txt (for example DEF.txt) instead of focusing LMN.txt

Before rename:
ABC.nfo (selected, focused)
ABC.txt (selected)
DEF.txt
GHI.txt

After rename:
DEF.txt (focused)
GHI.txt
LMN.nfo (selected)
LMN.txt (selected)

I would want LMN.nfo (selected, focused)

It's not something I could reproduce. Inline renaming changed neither selection nor focus.

Did you try to rename like in the example, from ABC to LMN having DEF in the middle?

If I rename from ABC to AAA, it doesn't present a problem, but if I rename from ABC to LMN the focused file goes to DEF.

Yes.

In the clip, I select the files with the mouse and show the focus by moving it with Ctrl-Up/Down.

I don't know....
Mine does this... (I reverted F2 to the original rename inline only)
After renaming I press F2 again to show that GHI.txt receives the focus