Javascript examples for CodeMirror:Configuration
Use full screen by default in codemirror
<html> <head> <link rel="stylesheet" href="https://codemirror.net/doc/docs.css"> <link rel="stylesheet" href="https://codemirror.net/lib/codemirror.css"> <link rel="stylesheet" href="https://codemirror.net/theme/night.css"> <script src="https://codemirror.net/lib/codemirror.js"></script> <script src="https://codemirror.net/mode/htmlmixed/htmlmixed.js"></script> <script src="https://codemirror.net/mode/xml/xml.js"></script> <style type="text/css"> .CodeMirror {float: left; width: 100%; height: 100%; } </style> </head> <body> <div style="padding: 1px; position: absolute; margin: 0px; left: 0px; right: 0px; top: 0px; bottom: 0px; width: auto; height: auto; "> <textarea id="content" name="content" style="display: none;"><dl> <dt id="option_indentWithTabs"><code><strong>indentWithTabs</strong>: boolean</code></dt> <dd>Whether, when indenting, the first N*<code>tabSize</code> spaces should be replaced by N tabs. Default is false.</dd> <dt id="option_electricChars"><code><strong>electricChars</strong>: boolean</code></dt> <dd>Configures whether the editor should re-indent the current line when a character is typed that might change its proper indentation (only works if the mode supports indentation). Default is true.</dd> <dt id="option_specialChars"><code><strong>specialChars</strong>: RegExp</code></dt> <dd>A regular expression used to determine which characters should be replaced by a special <a href="#option_specialCharPlaceholder">placeholder</a>. Mostly useful for non-printing special characters. The default is <code>/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/</code>.</dd> <dt id="option_specialCharPlaceholder"><code><strong>specialCharPlaceholder</strong>: function(char) ? Element</code></dt> right in right-to-left text). The default is <code>false</code> on Windows, and <code>true</code> on other platforms.</dd> </dl> </textarea> </div> <script> var editor = CodeMirror.fromTextArea(document.getElementById('content'), { mode: 'application/xml', lineNumbers: true,//from w ww.ja v a 2 s . c om theme: "night" }); </script> </body> </html>