codemirror-solidity

0.2.5 • Public • Published

codemirror solidity mode

A CodeMirror mode for Ethereum Solidity development

GitHub package version npm downloads Dependency Status

what is CodeMirror?

  • https://codemirror.net/
  • CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with a number of language modes and addons that implement more advanced editing functionality.

Installation instructions

  • Install from NPM: npm install codemirror-solidity
  • Include the new mode into your project, e.g.
<script src="./node_modules/codemirror-solidity/solidity.js"></script>
  • Set the mode to text/x-solidity in your editor, e.g.
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  theme: "solidity",
  matchBrackets: true,
  indentUnit: 4,
  lineNumbers: true,
  tabSize: 8,
  indentWithTabs: true,
  mode: "text/x-solidity"
});

The index.html file in this project includes a simple example. Note that CodeMirror must be installed through NPM as a dependency of codemirror-solidity for that page to display correctly.

License

MIT © alincode

/codemirror-solidity/

    Package Sidebar

    Install

    npm i codemirror-solidity

    Weekly Downloads

    5,165

    Version

    0.2.5

    License

    MIT

    Unpacked Size

    506 kB

    Total Files

    11

    Last publish

    Collaborators

    • alincode