Open shane0 opened 1 year ago
npm install codemirror npm install codemirror/mode/javascript npm install codemirror/mode/vim
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="node_modules/codemirror/lib/codemirror.css"> <link rel="stylesheet" href="node_modules/codemirror/theme/material.css"> </head> <body> <textarea id="code"></textarea> <script src="node_modules/codemirror/lib/codemirror.js"></script> <script src="node_modules/codemirror/mode/javascript/javascript.js"></script> <script src="node_modules/codemirror/keymap/vim.js"></script> <script> var editor = CodeMirror.fromTextArea(document.getElementById("code"), { mode: "javascript", theme: "material", keyMap: "vim", lineNumbers: true, tabSize: 2, indentWithTabs: true }); </script> </body> </html>