It is currently December 14th, 2018, 8:28 pm

Sublime Text 2 Rainmeter package

Share your custom plugins and applications to enhance Rainmeter.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 911
Joined: September 6th, 2011, 6:34 am

Sublime Text 2 Rainmeter package

MerlinTheRed » August 12th, 2012, 6:27 am

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/
Last edited by MerlinTheRed on August 28th, 2012, 3:09 pm, edited 7 times in total.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
UnforgivenRevival
Posts: 317
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: [WIP] Sublime Text 2 Rainmeter package

UnforgivenRevival » August 12th, 2012, 6:40 am

Testing and messing with it to see if I can break anything. Will let you know tomorrow what I find out.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 911
Joined: September 6th, 2011, 6:34 am

Re: [WIP] Sublime Text 2 Rainmeter package

MerlinTheRed » August 12th, 2012, 8:06 am

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.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
thatsIch
Posts: 464
Joined: August 7th, 2012, 9:18 pm

Re: [WIP] Sublime Text 2 Rainmeter package

thatsIch » August 12th, 2012, 9:13 am

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
Last edited by thatsIch on August 12th, 2012, 10:49 am, edited 2 times in total.
Alex Becherer

Re: [WIP] Sublime Text 2 Rainmeter package

Alex Becherer » August 12th, 2012, 10:01 am

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)?
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 911
Joined: September 6th, 2011, 6:34 am

Re: [WIP] Sublime Text 2 Rainmeter package

MerlinTheRed » August 12th, 2012, 10:50 am

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.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
thatsIch
Posts: 464
Joined: August 7th, 2012, 9:18 pm

Re: [WIP] Sublime Text 2 Rainmeter package

thatsIch » August 12th, 2012, 10:53 am

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

User avatar
MerlinTheRed
Rainmeter Sage
Posts: 911
Joined: September 6th, 2011, 6:34 am

Re: [WIP] Sublime Text 2 Rainmeter package

MerlinTheRed » August 12th, 2012, 1:17 pm

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.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
KreAch3R
Posts: 629
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: [WIP] Sublime Text 2 Rainmeter package

KreAch3R » August 12th, 2012, 1:21 pm

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.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
Alex Becherer

Re: [WIP] Sublime Text 2 Rainmeter package

Alex Becherer » August 12th, 2012, 2:44 pm

just had a look at it. pretty cool software.
it does not have a toolbar though? i use those buttons quite often. :/