It is currently December 12th, 2018, 4:09 am

Notepad++: Snippets for Rainmeter

Share your custom plugins and applications to enhance Rainmeter.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Notepad++: Snippets for Rainmeter Update!

eclectic-tech » November 20th, 2015, 4:40 am

First my apology for "zigging" on my last update... it was the same code (not updated!... that can happen at 2 am! :D )

JSMorley pointed out a few thoughts on cursor placement after snippet insertion, that I had not really considered.

And as usual, his idea made a lot of sense. The discussion above considered ways to easily modify the database, but after looking through the list of rainmeter snippets, the spot where editing would happen first varied, so I ended up selecting where most users would enter the first 'Value' item, as the place to have the cursor appear after insertion (for most snippet). If you feel anything needs 'cursor placement tweaking' please let me know.

With this update, all available snippet libraries (from Snippets version 1.2) with the Rainmeter library are in the compressed file.
This means the update process is slightly different.

Download the latest Snippets compressed file from the first post in this thread.
Extract the file, and remember where you extracted :)
The compressed file will extract 1 file, named: "NppSnippets.sqlite".

To update to the newest Rainmeter snippets library, you should first delete the current Rainmeter snippets library from the snippet list in notepad++.

To delete:
Select the Rainmeter library from the list.
Right-click on the drop-down list box, and select 'Delete library...'.
A dialog box will ask if you really want to delete the Rainmeter library.
Click 'Yes'.

To add the new Rainmeter snippets:
Again right-click the drop-down list of libraries in notepad++.
Select 'Import library...'
Browse to where you saved the extracted file and select it.
From the drop-down list in the dialog box, select 'Rainmeter' from the list of included libraries.
Click 'Import', after a few seconds, the new snippets will be available in the Snippet's library list.

Update file is also available from the first post.

(EDIT: Removed attached file from this post)
Last edited by eclectic-tech on November 24th, 2015, 2:38 am, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 18476
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Notepad++: Snippets for Rainmeter

jsmorley » November 20th, 2015, 10:34 am

Thats good, much better for me. However, I hate to nitpick, but as clever an idea as "the first option value" for cursor placement is, it wouldn't be what I would do. The reason is that that approach is actively encouraging folks to end up with duplicate section names when they add multiple sections of the same type. Some measures, like WebParser, and some meters, like String, can be used dozens of times in a skin, and any measure or meter can be used more than once. Just my opinion, but I would have it end up on the section name, to encourage having them change that as the first step. In fact, in a perfect world, I would end up with the section name highlighted inside the [brackets].

I guess my point is that after inserting a String meter, the first thing you want to do is not to set the X value, but is absolutely always to change the section name from the generic [MeterString].

My second nitpit is that I sorta think of this as a logical "paste" and not an "insert". The difference is that if I have some part of the code selected / highlighted, I want the default "paste" behavior, where the selection is replaced by the snippet. There is a setting "ReplaceSelection" for that for each snippet, which you have as "0". I would set those all to "1" if it were me. The point here is that if the cursor is just "placed" at some location, then it's an "insert". If some part of the code is highlighted, then it really should be a "replace". The logical intent here, in my view, is to "paste in a snippet" at the end of the day. I can never think of a case when you have some code selected, and you wouldn't want something you paste in to replace it. That is sorta the point of highlighting the code first.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Notepad++: Snippets for Rainmeter

eclectic-tech » November 21st, 2015, 12:51 am

I appreciate your thoughts, I do not consider them 'nitpicking'.

I was 'on the fence' as to where the cursor would best be positioned, and believe that you are right (again!), that the need to have a unique section name overrides any benefit to selecting a different position, DONE! Now the cursor will be on the section name in all measures and meters. Plus this adds continuity to the plugin action.

I agree that all snippets should REPLACE rather than insert, DONE!

I removed the extra carriage return/line feeds I had added for 'looks' from all snippets; now that they REPLACE, they are not needed.

I added all of the conditional tests (IfAbove, IfBelow, IfEqual, IfCondition, and IfMatch) to 'Action -' section of the snippets, and corrected several meters and measures that included them before. Also corrected MouseDoubleclickAction (typo) and added a few snippets: DynamicVariables and ColorMatrix (since I have been muddling my way through the power of that matrix!)

I think (with you help) we have the Rainmeter snippets performing better, better functioning and continuity. Thanks for 'nitpicking'! :p

EDIT: Removed file (see first post for latest snippets)
Last edited by eclectic-tech on November 24th, 2015, 2:39 am, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 18476
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Notepad++: Snippets for Rainmeter

jsmorley » November 21st, 2015, 12:58 am

Looks good to me. Nice work!

I can't see a single reason to keep RainSend at all. This does all it does and more, and the UI integration with Notepad++ is a bonus.
User avatar
jsmorley
Developer
Posts: 18476
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Notepad++: Snippets for Rainmeter

jsmorley » November 21st, 2015, 1:11 am

P.S. For those who might not want to give up the real-estate in the Notepad++ UI, you can double-click the "header" of the snippets sidebar panel, and it will create a separate window for it that you can drag somewhere else, maybe onto a second monitor if you want. Double-click it again to integrate it back into the Notepad++ UI.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Notepad++: Snippets for Rainmeter

eclectic-tech » November 21st, 2015, 2:11 am

jsmorley wrote:P.S. For those who might not want to give up the real-estate in the Notepad++ UI, you can double-click the "header" of the snippets sidebar panel, and it will create a separate window for it that you can drag somewhere else, maybe onto a second monitor if you want. Double-click it again to integrate it back into the Notepad++ UI.
Good find! I'll add this info to the first post...
You can also drag it to the top, bottom, or left side and have it fit to those sides of the text area in Notepad++.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Notepad++: Snippets for Rainmeter

eclectic-tech » November 24th, 2015, 2:42 am

Updated file in first post to improve usability:
  • Modified Mouse Action snippets by removing the brackets; the brackets are included in the Bang snippets
    Separated Fileview Parent/Child into separate snippets
    Added RegExpSubstitute= & Substitute= to the 'Add General Measure' snippet
    Added [!UpdateMeasure MeasureName] snippet
    Added [!UpdateMeter MeterName][!Redraw] snippet
RdMNet
Posts: 1
Joined: November 30th, 2015, 8:39 am
Location: Netherlands

Re: Notepad++: Snippets for Rainmeter

RdMNet » November 30th, 2015, 10:24 am

Hello,

I'm very new to Rainmeter and Notepad ++, but this is very handy.

Thank you.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Notepad++: Snippets for Rainmeter

eclectic-tech » December 28th, 2015, 6:38 pm

Added more snippets over he past month and with the new release candidate, thought I would update also...

Added ALL Bangs (App, Skin, System, Measures, Meters)
Added ActionTimer snippet
Added RunCommand snippet
Added a separate "Group" label; expand Bangs to groups (by adding this to the end of the associated bang...)
Added a separate RegExpSubstitute snippet
Added Mouse Scroll Left/Right snippets

Renamed for quick access via key presses:
* New Files (Lua or Skin)
- Inserted code (TransformationMatrixes, RegExpSubstitute, DynamicVariables, Group)
+ Metadata
A Actions
B Bangs
M Measures/Meters
P Plugins

Current snippet list (images show sections; actual snippets are all in a single list)
snippets2015-12-28.png
Updated download link in first post
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Notepad++: Snippets for Rainmeter

eclectic-tech » January 27th, 2016, 4:51 pm

Updated Snippet Library

Moved bangs for Rainmeter, skins, and system to end of list (renamed), this puts the more common snippets for Actions, Measures, Meters, & PlugIns together nearer the list top

Renamed 'Add Group' to 'Add Group Label' because this snippet only adds the word 'Group' to the current cursor position; used to expand bangs to groups

The new arrangement (items shows in a single, scroll-able window, in alphabetically order)
Image

Download latest version from first post