sublimetext / insertnums Goto Github PK
View Code? Open in Web Editor NEWSublime Text plugin for inserting sequences. Supporting alphanumerics and hex, with bitwise operations!
Home Page: https://james-brooks.uk
License: MIT License
Sublime Text plugin for inserting sequences. Supporting alphanumerics and hex, with bitwise operations!
Home Page: https://james-brooks.uk
License: MIT License
Hi @jbrooksuk,
I'd like to move this package to the SublimeText org with your approval. The last notable changes to it were made 10 years ago and it's basically been unmaintained since then (but it also still works just fine and I use it regurlarly). However, in order to prevent it from potentially being lost in the aether of unmaintained stuff and in case you yourself lose interest in it, I'd like to move it to the org where we have serveral admins to handle maintainership changes et al.
The trigger for this was that I noticed the package's homepage pointing to https://james-brooks.uk/, which is defunct, and I as a contributor (the highest non-owner permission level for account-owned repositories) cannot change this level of setting despite being a co-author of the package.
Please let me know if you're in support of this. You could either transfer the repo to me or I add you to the org (if you're not already a member) and you can transfer it there yourself, whatever you prefer. I'll handle the rest, i.e. updating the Package Control entry.
You can set syntaxes for input panels (afaik), so we should probably add a definition for our format language and highlight the input with it.
There's a EBNF-like syntax specification for this in the repo: https://github.com/jbrooksuk/InsertNums/blob/master/format_syntax.txt
Sometimes you need to generate a list of numbers from 1-n
where n
could be a thousand or whatever. Obviously you don't want to generate a thousand new lines, select the regions and then use InsertNums.
This feature would automatically generate from current
to a new stop
variable. I'm not really sure how to generate lines without already having a region, so perhaps @FichteFoll could shed some light?
I guess we'd need to create a new region?
sorry for opening a new issue, but..
for me the already integrated hex support is missin the "0x" prefix.
The next thing is, that the "step" misses the << and >> operator.
At the moment I can only increment and decrement by stepsize like:
8
9
a
b
If you're using BIT operations on embedded devices it is very handy to use increment like
"Val << count" to select each bit itself. what results in:
01
02
04
08
10
Next thing is the prefix "0x" often it is necessary that you have the prefix "0x" at hex numbers. Then the compiler knows that hex values are meant meant.
0x01
0x02
0x04
0x08
0x10
I don't want to annoy you just want to give you my point.
If you have very small and fast communication, sometimes you en/decode states to single bits See example at the end.
if(MyVariableNo1beforeComLayer) myComBite1 |= 0x01
if(MyVariableNo2beforeComLayer) myComBite1 |= 0x02
if(MyVariableNo3beforeComLayer) myComBite1 |= 0x04
if(MyVariableNo4beforeComLayer) myComBite1 |= 0x08
if(MyVariableNo5beforeComLayer) myComBite1 |= 0x10
----dataBus----->
if(myComBite1 & 0x01) myVariableNo1BehindComLayer = 1;
if(myComBite1 & 0x02) myVariableNo2BehindComLayer = 1;
if(myComBite1 & 0x04) myVariableNo3BehindComLayer = 1;
if(myComBite1 & 0x08) myVariableNo4BehindComLayer = 1;
if(myComBite1 & 0x10) myVariableNo5BehindComLayer = 1;
best regards
Max
Allows using MiniHTML for displaying a syntax briefer and quick help while typing and other forms of previewing that the current input panel just cannot achieve.
Kind of supersedes #19, even though we can't trivially define a syntax definition for the command panel input afaik.
The following screenshot is from ColorHelper, which does something similar already.
I appreciate your job, InsertNums is such a helpful plugin! but the lastest version insert the numbers immediately when I hit the shortcut, sometimes I hit the shortcut accidentally and it already insert the numbers! the pre-version was insert after I hit the enter, can it be kept?
Atari Basic needs line numbers. Programmer have to enter them manually.
In Turbo Basic there was the command AUTO [start, [step]] that enters new line number from 10 with step 10 (or from start with step step).
It would be nice if there is an hotkey that adds the new line number based on number on previous line increased by 10 at the beginning of the last empty line,
When I select multiple empty lines and run Insert Nums with '', '1', and '1:1', it replaces all of the lines with just a single '1'.
Hi this is my first time I have ever done anything in python , so if bad syntax please blame me ;)
added 0x command :
for example :
0x1 1 3 results in :
0x0001
0x0002
0x0004
0x0008
0x0010
0x0020
0x0040
0x0080
class InsertNumsCommand(sublime_plugin.TextCommand):
.
.
.
elif (current[0] == '0' and current[1] == 'x'):
current = int(current[2:])
def tick(counter):
return str('0x%0*x' % (int(padding) + 1, int(current) << counter))
@jbrooksuk
I just noticed (while recommending this package) that there is no license in this repository. We should definitely add one.
Since I authored all the currently used code, I would like to request the MIT license being used with us both as copyright holders.
I'll go ahead with that if you agree, or you can do it yourself.
In the process, I'd also add myself to the author list reported on packagecontrol.io.
DESCRIPTION:
Working with Windows 7, My Sublime Text 2 automatically updated InsertNums to the latest version. After closing and reopening Sublime, I got this error:
Error trying to parse file: Expected value in C:\Users\MYUSERNAME\AppData\Roaming\Sublime Text 2\Packages\Insert Nums\Default (Windows).sublime-keymap:1:1
Opening the file in Mac OS X 10.8 I can see the file content being the keymaps for the plugin. But opening it in Windows 7 I can only see weird characters.
POSSIBLE SOLUTION:
By opening the file in Mac and saving it with UTF-8 enconding (File / Save with encoding / UTF-8) seems to solve the problem.
This was reported to me via email, so I'm leaving it here.
I’ve found another bug, the starting value cannot be negative (although a negative step seems to work)
i.e
-1000 -10 0Wont give
-1000
-1010
-1020
Etc
There are more than one numbers that should have the same value on each line.
How can I skip three steps by increasing one?
[
{ "id": 1, "name": "item-1", "image": "/img/1.jpg" },
{ "id": 1, "name": "item-1", "image": "/img/1.jpg" },
{ "id": 1, "name": "item-1", "image": "/img/1.jpg" },
]
Hi, I have a little issue with key binding. Its set as default to CTRL+ALT+N but it works even without CTRL so whenever Im trying to insert } its enables the plugin.
So I changed the key bind to CTRL+ALT+I (still works witout ctrl) as that combo does nothing.
Could you please take a look at why it works even without ctrl ?
Hopefully this project is still alive. I’m using this tool regularly.
I would expect 2:1::i*2
to result in
4
6
8
10
12
Instead I get
0
2
4
6
8
It seems like it ignores the part before the expression and uses 0:1::i*2
instead. Is this on purpose or am I missing something?
It might also be useful for others to add ::i%5
to the examples to show repeating sequences.
Thanks so much!
The current tag is 2.0.1 dated 2014-05-02. Please could you add a new tag so Package Control knows about the changes since then. Thanks.
Gifs (or rather videos, but github doesn't support <video>
embeds) are a lot easier to grasp than the bulk of text we have currently.
Using: Sublime Text 3 Build 3059, Linux Mint 13 LTS.
Using: InsertNums v. 2.0.1 (version from: Insert Nums/package-metadata.json)
When using InsertNums to insert a number sequence with a floating point step value there are some very strange results.
// Example of `1:.1` with 10 selected regions.
1.0
1.1
1.2000000000000002
1.3000000000000003
1.4000000000000004
1.5000000000000004
1.6000000000000005
1.7000000000000006
1.8000000000000007
1.9000000000000008
I've done some screen captures in order to show a variety of examples.
Zip file with all images: sockshare.com - no waiting
Hope this helps.
I would love to be able to generate binary string:
example:
b1 1 0:
1
10
11
100
101
110
111
and
b1 1 2:
001
010
011
100
101
110
111
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.