Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incremental paste plugin?

I know that often using a for loop to generate repetitive content is the better way than pasting something 20 times and changing each paste to the correct number by hand. But let's say for cases where content is hard-coded and I just want a list from 1-20.

I would like a text editor with a "smart" paste command that takes any number imbedded in a string on the clipboard and increments it each time I paste. If it doesn't exist, I will make a plugin.

I'm trying to think of a good 2-stroke keyboard shortcut to do it, close to the ctrl-V. Maybe ctrl-g or numpad_+ (in an app with no zooming).

Does it exist?

like image 450
tkotitan Avatar asked Dec 30 '25 23:12

tkotitan


2 Answers

In Zeus this can be easily done as follows:

  1. Column mark the area to be converted to a numbers
  2. Use the Macros, Execute Script menu
  3. Type in numbers to run the numbers Lua macro
  4. Type in the first number of the sequence

The marked area will be replaced by an incrementing sequence of number starting at the first number provided in step 4.

I'm trying to think of a good 2-stroke keyboard shortcut to do it,

Making this into a key stoke action is as simple as binding the numbers Lua macro to the keyboard.

Here is an example of how it works. If 1 values in the text below are column marked and the macro executed with a starting number of 1000:

Field_1
Field_1
Field_1
Field_1

the following text changes will be made:

Field_1000
Field_1001
Field_1002
Field_1003
like image 84
jussij Avatar answered Jan 03 '26 07:01

jussij


Armed bear J has a renumber region command, as well as a case-preserving replace-in-files, which means I often keep it around for those features.

like image 30
Pete Kirkham Avatar answered Jan 03 '26 09:01

Pete Kirkham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!