A mode for NSIS to use with CodeMirror, the versatile text editor implemented in JavaScript for the browser.
Use your preferred Node package manager to install the mode
$ yarn add codemirror-nsis || npm install codemirror-nsis
Alternatively, you can clone this repository
$ git clone https://github.com/idleberg/codemirror-nsis
Example usage on website
<!DOCTYPE html>
<html>
<head>
<!-- Import CodeMirror styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5/lib/codemirror.min.css">
<head>
</head>
<body>
<!-- Add Textarea -->
<textarea id="editor"></textarea>
<!-- Import CodeMirror library -->
<script defer src="https://cdn.jsdelivr.net/npm/codemirror@5/lib/codemirror.min.js"></script>
<!-- Import NSIS mode -->
<script defer type="module" src="https://cdn.jsdelivr.net/npm/codemirror-nsis@latest/dist/codemirror-nsis.mjs"></script>
<!-- Initialize CodeMirror -->
<script type="text/javascript">
const editor = document.getElementById('editor');
const options = {
lineNumbers: true,
mode: 'nsis'
};
CodeMirror.fromTextArea(editor, options);
</script>
</body>
</html>
Note: If you want to load CodeMirror from a CDN, make sure to specify a specific version for better performance – the example above doesn't to keep it simple.
Released under The MIT License