nojanath / SublimeKSP

Fork of Nils Liberg's SublimeKSP plugin. See README for details.
GNU General Public License v3.0
84 stars 18 forks source link

SublimeKSP

A Sublime Text 3/4 plugin for working with and compiling KSP (Kontakt Script Processor) code.

Changes

This fork is based on Nils Liberg's official SublimeKSP plugin, v1.11, and supports all Kontakt versions. However, there are a number of additions and changes:

Installation

Manual Installation

To use features of SublimeKSP before official package releases:

Running From Command Line

SublimeKSP compiler can also be ran from command line, by simply executing ksp_compiler.py with the appropriate source (and optionally output) file path(s), along with optional compiler switches. For this, you need to use the manual installation of SublimeKSP, in order to have direct access to ksp_compiler.py file. To execute a compilation of a file, it is as simple as typing:

> python ksp_compiler.py "<source-file-path>"

However, various compiler options from SublimeKSP's Tools menu are also available. All of them are set to false if not used, and by including them in the command line, they are set to true:

ksp_compiler.py [-h] [-c] [-v] [-e] [-o] [-t] [-d] source_file [output_file]

positional arguments:
  source_file
  output_file

optional arguments:
  -h, --help                   show this help message and exit
  -f, --force                  force all specified compiler options, overriding any compile_with pragma directives from the script
  -c, --compact                remove indents and empty lines in compiled code
  -v, --compact_variables      shorten and obfuscate variable names in compiled code
  -d, --combine_callbacks      combines duplicate callbacks - but not functions or macros
  -e, --extra_syntax_checks    additional syntax checks during compilation
  -o, --optimize               optimize the compiled code
  -t, --add_compile_date       adds the date and time comment atop the compiled code
  -x, --sanitize_exit_command  adds a dummy no-op command before every exit function call

> python ksp_compiler.py --force -c -e -o "<source-file-path>" "<target-file-path>"

Updates

Documentation

See the Wiki on GitHub.