Atom: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
Line 55: Line 55:
=== Building ===
=== Building ===


The easiest way to build scripts is probably [http://atom.io/packages/script atom-script], a package which already supports makensis. Use the default <kbd>Super</kbd>+<kbd>I</kbd> to build scripts. Be aware that atom-script will build selectively once lines of codes have been selected.
There are several ways to build NSIS scripts within Atom, each of them depending on a separate build package.


As an alternative, you can also use [http://atom.io/packages/atom-runner atom-runner] to build scripts within Atom. If atom-runner has been detected, the user will be asked whether to use makensis as the default runner for NSIS scripts. Use the default <kbd>Ctrl</kbd>+<kbd>R</kbd> to build scripts.
'''Note:''' You might have to add makensis to your [http://superuser.com/a/284351/195953 PATH environmental variable] in order to use any of the mentioned building tools.
 
==== build ====
 
With the [https://atom.io/packages/build build] package installed, you can compile scripts using the default <kbd>Cmd</kbd>+<kbd>Alt</kbd>+<kbd>b</kbd> shortcut (or <kbd>F9</kbd>).
 
==== script ====
 
With the [https://atom.io/packages/script script] package installed, you can compile scripts using the default <kbd>Super</kbd>+<kbd>I</kbd> shortcut.
 
==== atom-runner ====
 
With the [https://atom.io/packages/atom-runner atom-runner] package installed, you need to create a runner task to compile scripts. From the [https://atom.io/packages/command-palette command-palette] run “NSIS: Set build command for atom–runner” and <code>makensis</code> will added as runner for NSIS files. Use the default shortcut <kbd>Ctrl</kbd>+<kbd>R</kbd> to compile your scripts.
 
==== atom-build ====
 
You can also create <code>.atom-build.json</code> to use with [https://github.com/mirhec/atom-build atom-build]. From the [https://atom.io/packages/command-palette command-palette] run “NSIS: Create .atom–build file” to add it to your current project folder. Use the default shortcut <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>B</kbd> to compile your scripts.


== Links ==
== Links ==

Revision as of 17:18, 21 February 2016

Description

An all around NSIS language package for GitHub's new Atom editor

Grammar

Syntax highlighting of all commands in NSIS versions 2.46 & 3.0b1 and their included plug-ins

Completions

Tab-completions for syntax, useful snippets for quick scaffolding

screenshot.gif

Extension Packages

You can further extend #nsis support in Atom.

Installation

Atom Package Manager (apm)

Install package from apm install language-nsis (or use the GUI)

Git

Change to the Atom package directory and clone the repository:

git clone https://github.com/idleberg/atom-language-nsis.git language-nsis

Usage

Completion

With most commands, you can specify available options before completion. For instance, rather than completing RequestExecutionLevel and then specifying an option, you can directly choose RequestExecutionLevel user from the completion menu.

To complete compile time commands, variables or predefines, *leave out* special characters:

  • include completes to !include
  • INSTDIR completes to $INSTDIR
  • NSIS_VERSION completes to ${NSIS_VERSION}`

However, you have to type __LINE___ to complete to ${__LINE__}.

There are several special cases for your convenience:

  • MB_OK completes to MessageBox MB_OK
  • onInit completes to a Function .onInit block
  • LogicLib completes to !include "LogicLib.nsh"`

Building

There are several ways to build NSIS scripts within Atom, each of them depending on a separate build package.

Note: You might have to add makensis to your PATH environmental variable in order to use any of the mentioned building tools.

build

With the build package installed, you can compile scripts using the default Cmd+Alt+b shortcut (or F9).

script

With the script package installed, you can compile scripts using the default Super+I shortcut.

atom-runner

With the atom-runner package installed, you need to create a runner task to compile scripts. From the command-palette run “NSIS: Set build command for atom–runner” and makensis will added as runner for NSIS files. Use the default shortcut Ctrl+R to compile your scripts.

atom-build

You can also create .atom-build.json to use with atom-build. From the command-palette run “NSIS: Create .atom–build file” to add it to your current project folder. Use the default shortcut Ctrl+Alt+B to compile your scripts.

Links