Page 1 of 30

Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 6:27 am
by MerlinTheRed
sublime-rainmeter

This package for Sublime Text 2 makes developing Rainmeter skins even more fun.

Visit the project website for more information, instructions and downloads.

Features

Syntax Highlighting

Syntax highlighting is turned on by default for files with the .ini and .inc extensions. There are several color schemes you can choose from.

Image

Code Completion

Image

Code completion is activated by default. While typing, it will suggest completions from a list of options, values, builtin variables and more. When auto-completing a bang, the required and optional (in braces) parameters are also added, and you can cycle through them by pressing tab or shift+tab.

Additionally, code snippets for common usages of each meter and measure type, and all native plugins are included. The names of those snippets start with a "t" for template, so if you want to insert a basic template for a string meter, type tstring and hit enter, if you want to insert a metadata block, type tmetadata. There is also a snippet with a basic structure of a skin file called tskin.

Image

You can see all available snippets by looking in the Snippets folder in the Rainmeter package directory. If you feel that one of those snippets needs to be changed in order to be more useful, don't hesitate to contact me.

Tools

Code Folding

Image

Sublime Text 2 supports folding indented code sections. Hitting ctrl+alt+i automatically indents a Rainmeter source file so code folding is possible in a sensible way. All options in a section are indented and can be folded away. Additionally, inserting a comment line starting with a double semicolon: ;; will indent everything after it so it can be folded until the next ;; that you indented by the same amount. This is useful if you want to fold a specific section of code, like all measures or meters. If you want to add a nice looking header for your foldable sections, try typing divider and hitting enter.

Color Picker

Image

Ever wanted to quickly adjust the color of a meter but found yourself unable to imagine what a rgb color will look like in your head? No more! I have adapted the awesome Color Picker Plugin created by weslly to work with rainmeter-style hex-color definitions. Place your mouse cursor in a hexadecimal color definition, or select it and hit ctrl+shift+c. This will open a color picker dialog and let you choose a color. If your cursor is currently not in a color definition, the hex code will be inserted at the cursor position. You can't adjust the alpha value, but it will be preserved after you chose the new color.

New Skin

Image

The Rainmeter section in the Tools menu contains a handy command for creating a new skin. It will open a new buffer, insert a basic skin skeleton and change the syntax highlighting mode to Rainmeter. The same skeleton is also available as a snippet called tskin.

Refresh Skin/Rainmeter

The package includes a custom "build system" for Rainmeter, which lets you refresh the current skin with a single button press. Press f7 or ctrl+b to refresh the current skin, or load it, if it's not currently active. Pressing ctrl+shift+b will refresh Rainmeter and all skins instead. Those commands are also available from the tools menu via Build and Run.

For more information, instructions and downloads, visit the project page: http://merlinthered.github.com/sublime-rainmeter/

Re: [WIP] Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 6:40 am
by UnforgivenRevival
Testing and messing with it to see if I can break anything. Will let you know tomorrow what I find out.

Re: [WIP] Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 8:06 am
by MerlinTheRed
I already found some issues. Will upload a fix later.

One thing I'm wondering: Should I highlight valid values for certain options only if they are used directly with that option, or also anywhere else? I'm talking about things like ImageFlip=Horizontal. RainLexer only highlights this if it's used like that, not if it's used for example in a variable which is used to switch the value. Of course if it's used in a variable it could also be a normal string. Very confusing.

Also I currently have no checking if a certain combination of option=value is valid. I need to figure out how to do this right.

Re: [WIP] Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 9:13 am
by thatsIch
Testing it too
Already searched for a better environment

€: my incs doesnt highlight



€€: nvm I could switch it up,
was just a lil confusiing cause the text was cut off

Re: [WIP] Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 10:01 am
by Alex Becherer
the color highlighting is a cool idea!

i probably would get annoyed by the red, green and blue, but a subtle difference for the alpha part is something i would appreciate.

may i ask three questions before i decide wether i'll give this a try:
does it have folding?
does it have split view?
does it load fast (as fast as notepad.exe)?

Re: [WIP] Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 10:50 am
by MerlinTheRed
loads pretty fast, has split view. Folding only works if you indent all options under a section. I think there is no way I can specify a folding behavior depending on custom syntax.

Re: [WIP] Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 10:53 am
by thatsIch
Alex Becherer wrote:the color highlighting is a cool idea!

i probably would get annoyed by the red, green and blue, but a subtle difference for the alpha part is something i would appreciate.

may i ask three questions before i decide wether i'll give this a try:
does it have folding?
does it have split view?
does it load fast (as fast as notepad.exe)?
Folding


Split View with 4 max


Speed: I tried counting to one, but failed. Its definitly faster than notepad++. Its different speed than notepad. I loads as fast but content is loaded after, but you wont see a noticable difference imho.

If he develops this software further the 59 bucks are well invested

love the CTRL + D function

€: I have an Issue with variable names using space


Re: [WIP] Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 1:17 pm
by MerlinTheRed
As far as I know variables names aren't allowed to have spaces in them? At least it is my feeling that they shouldn't.

I've uploaded a new version of the colors and syntax definition. It now includes checking for some common option values (like legal values for StringAlign etc.). The colors are a bit different now, but I'm still experimenting.

Re: [WIP] Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 1:21 pm
by KreAch3R
Awesome job Merlin, if you have the time, check if we can set 'Refresh skin' in the context menu. I will try your work soon.

Re: [WIP] Sublime Text 2 Rainmeter package

Posted: August 12th, 2012, 2:44 pm
by Alex Becherer
just had a look at it. pretty cool software.
it does not have a toolbar though? i use those buttons quite often. :/