Skip to content

Instantly share code, notes, and snippets.

@zenware
Last active December 15, 2015 08:29
Show Gist options
  • Save zenware/5231030 to your computer and use it in GitHub Desktop.
Save zenware/5231030 to your computer and use it in GitHub Desktop.
Instant Vim-Style Editor in any Browser.
data:text/html,
<html style="background:#002b36;font:13px monospace;padding:30px;">
<head>
<link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css">
<style>.CodeMirror{height:100%}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{background:#93a1a1}.CodeMirror-linenumber{color:#b58900}.CodeMirror-gutters{background:#073642;border-color:#073642}</style>
<script src="http://codemirror.net/lib/codemirror.js"></script>
<script src="http://codemirror.net/keymap/vim.js"></script>
<body style="background:#073642;color:#93a1a1;max-width:600px;padding:10px 0;">
<textarea id="code"></textarea>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
lineNumbers:true,
mode:'text/x-csrc',
keyMap:'vim',
showCursorWhenSelecting:true
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment