Skip to content

Commit

Permalink
added snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed May 20, 2014
1 parent 5e5eb64 commit 52796ff
Show file tree
Hide file tree
Showing 17 changed files with 854 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,44 @@ With [auto_upgrade](http://wbond.net/sublime_packages/package_control/settings/)

You can complete all nsL (and NSIS) commands using the `Tab` key. Hit `Tab` again to jump between fields.

### Scaffolding

Scaffolding snippets start with the prefix scaffold followed by the type of script you'd like to build:

* Basic Script
* MUI2 Script

Example:

With Sublime Text's fuzzy search in mind, you could for instance type `scaffBasic` to trigger the `scaffold:Basic Script`snippet and create the following script:

; Scaffolding by https://github.com/idleberg/nsL-Assembler-Sublime-Text

; Settings ---------------------------------
Name("installer_name");
OutFile("installer_name.exe");
RequestExecutionLevel(user);
InstallDir("$PROGRAMFILES\installer_name");

; Includes ---------------------------------


; Pages ------------------------------------
page Components();
page Directory();
page InstFiles();

; Sections ---------------------------------
section section_index("section_name") {

// your code here

}

; Functions --------------------------------

Use Tab to jump to the next relevant bit of code you might want to change, Shift-Tab to jump back.

### Building

You can build your script using the default shortcut or from the Tools menu. Output scripts will be placed in the same folder as your input. Note that from Windows Vista on you need administrative rights to compile scripts in `%PROGRAMFILES%`, which is the default location for nsL example scripts!
Expand Down
37 changes: 37 additions & 0 deletions snippets/scaffold.Basic Script (2 Sections).sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<snippet>
<content><![CDATA[
; Scaffolding by https://github.com/idleberg/nsL-Assembler-Sublime-Text
; Settings ---------------------------------
Name("${1:installer_name}");
OutFile("${2:${1}}.exe");
RequestExecutionLevel(${3:user});
InstallDir("\$PROGRAMFILES\\${4:${1}}");
; Includes ---------------------------------
${5}
; Pages ------------------------------------
page Components();
page Directory();
page InstFiles();
; Sections ---------------------------------
section ${6:section1_index}("${7:section1_name}") {
${8:// your code here}
}
section ${9:section2_index}("${10:section2_name}") {
${11:// your code here}
}
; Functions --------------------------------
${12}
]]></content>
<tabTrigger>scaffold:Basic Script (2 Sections)</tabTrigger>
<scope>source.nsl</scope>
</snippet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<snippet>
<content><![CDATA[
; Scaffolding by https://github.com/idleberg/nsL-Assembler-Sublime-Text
; Settings ---------------------------------
Name("${1:installer_name}");
OutFile("${2:${1}}.exe");
RequestExecutionLevel(${3:user});
InstallDir("\$PROGRAMFILES\\${4:${1}}");
; Includes ---------------------------------
${5}
; Pages ------------------------------------
page Components();
page Directory();
page InstFiles();
; Sections ---------------------------------
section ${6:section1_index}("${7:section1_name}") {
${8:// your code here}
}
section ${9:section2_index}("${10:section2_name}") {
${11:// your code here}
}
; Functions --------------------------------
function .onInit() {
${12:// your code here}
}
]]></content>
<tabTrigger>scaffold:Basic Script (2 Sections, onInit)</tabTrigger>
<scope>source.nsl</scope>
</snippet>
43 changes: 43 additions & 0 deletions snippets/scaffold.Basic Script (3 Sections).sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<snippet>
<content><![CDATA[
; Scaffolding by https://github.com/idleberg/nsL-Assembler-Sublime-Text
; Settings ---------------------------------
Name("${1:installer_name}");
OutFile("${2:${1}}.exe");
RequestExecutionLevel(${3:user});
InstallDir("\$PROGRAMFILES\\${4:${1}}");
; Includes ---------------------------------
${5}
; Pages ------------------------------------
page Components();
page Directory();
page InstFiles();
; Sections ---------------------------------
section ${6:section1_index}("${7:section1_name}") {
${8:// your code here}
}
section ${9:section2_index}("${10:section2_name}") {
${11:// your code here}
}
section ${12:section3_index}("${13:section3_name}") {
${14:// your code here}
}
; Functions --------------------------------
${15}
]]></content>
<tabTrigger>scaffold:Basic Script (3 Sections)</tabTrigger>
<scope>source.nsl</scope>
</snippet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<snippet>
<content><![CDATA[
; Scaffolding by https://github.com/idleberg/nsL-Assembler-Sublime-Text
; Settings ---------------------------------
Name("${1:installer_name}");
OutFile("${2:${1}}.exe");
RequestExecutionLevel(${3:user});
InstallDir("\$PROGRAMFILES\\${4:${1}}");
; Includes ---------------------------------
${5}
; Pages ------------------------------------
page Components();
page Directory();
page InstFiles();
; Sections ---------------------------------
section ${6:section1_index}("${7:section1_name}") {
${8:// your code here}
}
section ${9:section2_index}("${10:section2_name}") {
${11:// your code here}
}
section ${12:section3_index}("${13:section3_name}") {
${14:// your code here}
}
; Functions --------------------------------
function .onInit() {
${15:// your code here}
}
]]></content>
<tabTrigger>scaffold:Basic Script (3 Sections, onInit)</tabTrigger>
<scope>source.nsl</scope>
</snippet>
49 changes: 49 additions & 0 deletions snippets/scaffold.Basic Script (4 Sections).sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<snippet>
<content><![CDATA[
; Scaffolding by https://github.com/idleberg/nsL-Assembler-Sublime-Text
; Settings ---------------------------------
Name("${1:installer_name}");
OutFile("${2:${1}}.exe");
RequestExecutionLevel(${3:user});
InstallDir("\$PROGRAMFILES\\${4:${1}}");
; Includes ---------------------------------
${5}
; Pages ------------------------------------
page Components();
page Directory();
page InstFiles();
; Sections ---------------------------------
section ${6:section1_index}("${7:section1_name}") {
${8:// your code here}
}
section ${9:section2_index}("${10:section2_name}") {
${11:// your code here}
}
section ${12:section3_index}("${13:section3_name}") {
${14:// your code here}
}
section ${15:section4_index}("${16:section4_name}") {
${17:// your code here}
}
; Functions --------------------------------
${18}
]]></content>
<tabTrigger>scaffold:Basic Script (4 Sections)</tabTrigger>
<scope>source.nsl</scope>
</snippet>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<snippet>
<content><![CDATA[
; Scaffolding by https://github.com/idleberg/nsL-Assembler-Sublime-Text
; Settings ---------------------------------
Name("${1:installer_name}");
OutFile("${2:${1}}.exe");
RequestExecutionLevel(${3:user});
InstallDir("\$PROGRAMFILES\\${4:${1}}");
; Includes ---------------------------------
${5}
; Pages ------------------------------------
page Components();
page Directory();
page InstFiles();
; Sections ---------------------------------
section ${6:section1_index}("${7:section1_name}") {
${8:// your code here}
}
section ${9:section2_index}("${10:section2_name}") {
${11:// your code here}
}
section ${12:section3_index}("${13:section3_name}") {
${14:// your code here}
}
section ${15:section4_index}("${16:section4_name}") {
${17:// your code here}
}
; Functions --------------------------------
function .onInit() {
${18:// your code here}
}
]]></content>
<tabTrigger>scaffold:Basic Script (4 Sections, onInit)</tabTrigger>
<scope>source.nsl</scope>
</snippet>
33 changes: 33 additions & 0 deletions snippets/scaffold.Basic Script (onInit).sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<snippet>
<content><![CDATA[
; Scaffolding by https://github.com/idleberg/nsL-Assembler-Sublime-Text
; Settings ---------------------------------
Name("${1:installer_name}");
OutFile("${2:${1}}.exe");
RequestExecutionLevel(${3:user});
InstallDir("\$PROGRAMFILES\\${4:${1}}");
; Includes ---------------------------------
${5}
; Pages ------------------------------------
page Components();
page Directory();
page InstFiles();
; Sections ---------------------------------
section ${6:section_index}("${7:section_name}") {
${8:// your code here}
}
; Functions --------------------------------
function .onInit() {
${9:// your code here}
}
]]></content>
<tabTrigger>scaffold:Basic Script (onInit)</tabTrigger>
<scope>source.nsl</scope>
</snippet>
31 changes: 31 additions & 0 deletions snippets/scaffold.Basic Script.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<snippet>
<content><![CDATA[
; Scaffolding by https://github.com/idleberg/nsL-Assembler-Sublime-Text
; Settings ---------------------------------
Name("${1:installer_name}");
OutFile("${2:${1}}.exe");
RequestExecutionLevel(${3:user});
InstallDir("\$PROGRAMFILES\\${4:${1}}");
; Includes ---------------------------------
${5}
; Pages ------------------------------------
page Components();
page Directory();
page InstFiles();
; Sections ---------------------------------
section ${6:section_index}("${7:section_name}") {
${8:// your code here}
}
; Functions --------------------------------
${9}
]]></content>
<tabTrigger>scaffold:Basic Script</tabTrigger>
<scope>source.nsl</scope>
</snippet>
Loading

0 comments on commit 52796ff

Please sign in to comment.