Codemirror -extrakeys

by jean-philippe janecek

HTML

<link rel="stylesheet" href="https://codemirror.net/theme/ambiance.css">
<script src="https://codemirror.net/lib/codemirror.js"></script>
<link rel="stylesheet" href="https://codemirror.net/lib/codemirror.css">
<script src="https://codemirror.net/3/mode/shell/shell.js"></script>
<form>
  <textarea id="code" name="code">
$ mkdir template && cd template
$ edjangerinit template=demo_template
Archive:  /opt/edjanger/scripts/templates/templating/demo_template.zip
  inflating: /Users/docker/Documents/workspace/docker/test_template/template/demo_template.yaml  
  inflating: /Users/docker/Documents/workspace/docker/test_template/template/demo_template.tar  
x ./deploy_run.sh
x ./diff_conf.sh
x ./tmp/deploy_run.sh
x ./tmp/diff_conf.sh
x ./tmp/web1/volumes/int/html/index.html
x ./tmp/web1/volumes/prod/html/index.html
x ./tmp/web2/volumes/int/html/index.html
x ./tmp/web2/volumes/prod/html/index.html
x ./web1/volumes/int/html/index.html
x ./web1/volumes/prod/html/index.html
x ./web2/volumes/int/html/index.html
x ./web2/volumes/prod/html/index.html
x ./tmp/web1/edjanger.template
x ./tmp/web1/integration.properties
x ./tmp/web1/production.properties
x ./tmp/web2/edjanger.template
x ./tmp/web2/integration.properties
x ./tmp/web2/production.properties
x ./web1/edjanger.template
x ./web1/integration.properties
x ./web1/production.properties
x ./web2/edjanger.template
x ./web2/integration.properties
x ./web2/production.properties
  </textarea>
</form>

CSS

.CodeMirror {
  border: 1px solid #eee;
  height: auto;
}

JavaScript

$(document).ready(function() {
  var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
    mode: 'shell',
    theme: "ambiance",
    lineNumbers: true,
    matchBrackets: true
  });
});