feat: allow bulk renaming to include trailing content in addition to the required new names#2494
Merged
sxyazi merged 4 commits intosxyazi:mainfrom Mar 24, 2025
Merged
Conversation
Owner
|
This doesn't make sense. Not everyone wants the file names to appear twice, and you can already achieve this through custom bulk rename commands: [[opener.bulk-rename]]
block = true
run = '''
s="$(cat "$1")"
echo "$s\n------\n$s" > "$1"
nvim "$1"
sed -i "" "$(wc -l <<< "$s")q" "$1"
'''
[[open.prepend_rules]]
name = "bulk-rename.txt"
use = "bulk-rename"However, I can accept removing the strict restriction that the new and old file lists must have the same length, and instead just read the first n lines. This way, you wouldn't need the final |
a117530 to
6a22f12
Compare
Contributor
Author
|
Thanks for the reminder. I apologize for not fully reading the documentation. I've modified the bulk rename logic; it truncates when the number of new filenames exceeds the number of old filenames, but the rest of the logic remains the same. |
Lemi0002
pushed a commit
to Lemi0002/yazi
that referenced
this pull request
Apr 10, 2025
…the required new names (sxyazi#2494) Co-authored-by: sxyazi <sxyazi@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When handling numerous filenames, it's better to give indication to original filenames. I've added the original filenames below, separated by a divider, without changing the code related to renaming.