Sublime Forum

Is there Increment next line feature?

#1

I have text file with src:

How i do much more lines - up to 1000 like this:

[quote]http://jkeks.ru/1/
jkeks.ru/2/
jkeks.ru/3/

jkeks.ru/999/
jkeks.ru/1000/
[/quote]

without external soft.

Sorry for my noob Question
jkeks

0 Likes

#2

Don’t think there such feature but easy to implement it with plugin (if I remember well there is already a plugin like that).

Or there is the ‘Dirty way’ :smiling_imp: :

  1. Open your file and put the cursor where you want to insert your sequence
  2. Open the console
  3. Type (or paste):
b=view.begin_edit();l='http://jkeks.ru/%d/'%i for i in range(1,101)];view.insert(b, 0, '\n'.join(l));view.end_edit(b)
  1. Hit Enter key

Welcome to the dark side of Python :astonished:

0 Likes

#3

wiii!!! thanks!
very interest and main, but hard to take that for python beginner.
try to search plugin

0 Likes

#4

your recipe work well ! I’m in shock

is there way to make it shortly!?

0 Likes

#5

There are a few plugins that will help you.

A simple but effective one:
viewtopic.php?f=5&t=1604&start=0

A more complex one with more features:
github.com/rmaksim/Sublime-Text-2-Solutions/

Both solutions can be called with a keyboard shortcut (both links have basic info on the required keymap entries).

0 Likes