feat: add counters to bulk rename function#2525
Open
JustForFun88 wants to merge 1 commit intosxyazi:mainfrom
Open
feat: add counters to bulk rename function#2525JustForFun88 wants to merge 1 commit intosxyazi:mainfrom
JustForFun88 wants to merge 1 commit intosxyazi:mainfrom
Conversation
a9c693e to
86f4659
Compare
1cc8e5a to
a29dbb9
Compare
d1efbb8 to
a0ab614
Compare
35d9907 to
2768fd2
Compare
9f077f9 to
60a2382
Compare
00f9b4e to
32e0efc
Compare
6bc287c to
a6d2c30
Compare
a6d2c30 to
f64c0d9
Compare
41034d0 to
449450d
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This Pull Request introduces counter-based bulk renaming to Yazi, enabling users to specify incrementing placeholders across multiple lines. Each line can include zero or more placeholders of the form:
where:
<COUNT_TYPE>: A single character indicating the counter type:N,n,D,d→ Numeric digits.A→ Uppercase ANSI letters.a→ Lowercase ANSI letters.R→ Uppercase Roman numerals.r→ Lowercase Roman numerals.C→ Uppercase Cyrillic letters.c→ Lowercase Cyrillic letters.<START_VALUE>(optional): Initial value, either as a number (e.g.,1,2, etc.) or a value corresponding to the counter type:A,B,AA(ANSI uppercase)a,b,aa(ANSI lowercase)I,II,III(Roman uppercase)i,ii,iii(Roman lowercase)А,Б,АБ(Cyrillic uppercase)а,б,аб(Cyrillic lowercase)_for unspecified.<COUNT_STEP>(optional): Step size, integer (e.g.,2) or_for unspecified.<COUNT_WIDTH>(optional): Minimum width with zero-padding. Integer (e.g.,3) or_for unspecified.Optional parameters (
<START_VALUE>,<STEP>,<WIDTH>) can be set or left as_to take defaults. For instance,%{n,_,2,3}starts at the default value 1, increments by 2, and has a minimum width of 3. They also can be omitted, i.e. not written at all. For example, you can write%{N},%{N, 1}Optional parameters must be specified sequentially:
<START_VALUE>is required if<COUNT_STEP>or<COUNT_WIDTH>are used, either explicitly (e.g.,1) or with_. Omitting earlier parameters with commas (e.g.,%{N,,2}or%{N,,,4}) is invalid. User should write%{N,_,2}or%{N,_,_,4}instead.Escaping: To insert a literal
%{in filenames (in linux for example), user could escape it by writing%%{. For example,file_%%{name}.txtwill becomefile_%{name}.txt.Constraints & Error Handling:
To avoid adding extra dependencies, the parser is custom-written. While parsing performance could theoretically be improved using Rayon parallelization, I think that typical usage scenarios likely won’t require such optimization.
default.mp4