add cm vim mode
This commit is contained in:
parent
d097d41144
commit
f47c3ea8bd
5 changed files with 8479 additions and 6 deletions
|
|
@ -254,6 +254,7 @@ commands.addCommand({
|
|||
var keybindings = {
|
||||
ace: null, // Null = use "default" keymapping
|
||||
vim: require("ace/keyboard/vim").handler,
|
||||
vim2: require("ace/keyboard/vim2").handler,
|
||||
emacs: "ace/keyboard/emacs",
|
||||
// This is a way to define simple keyboard remappings
|
||||
custom: new HashHandler({
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
-->
|
||||
|
||||
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||
<script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
|
||||
|
||||
<!-- <script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
|
||||
-->
|
||||
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -96,6 +96,7 @@
|
|||
<select id="keybinding" size="1">
|
||||
<option value="ace">Ace</option>
|
||||
<option value="vim">Vim</option>
|
||||
<option value="vim2">Vim2</option>
|
||||
<option value="emacs">Emacs</option>
|
||||
<option value="custom">Custom</option>
|
||||
</select>
|
||||
|
|
|
|||
4841
lib/ace/keyboard/vim2.js
Normal file
4841
lib/ace/keyboard/vim2.js
Normal file
File diff suppressed because it is too large
Load diff
3614
lib/ace/keyboard/vim2_test.js
Normal file
3614
lib/ace/keyboard/vim2_test.js
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,7 @@
|
|||
var https = require("https")
|
||||
, http = require("http")
|
||||
, url = require("url")
|
||||
, fs = require("fs");
|
||||
var https = require("https");
|
||||
var http = require("http");
|
||||
var url = require("url");
|
||||
var fs = require("fs");
|
||||
|
||||
var Path = require("path");
|
||||
var spawn = require("child_process").spawn;
|
||||
|
|
@ -119,6 +119,22 @@ var deps = {
|
|||
});
|
||||
}
|
||||
},
|
||||
vim: {
|
||||
fetch: function(){
|
||||
var rootHref = "https://raw.githubusercontent.com/codemirror/CodeMirror/master/"
|
||||
var fileMap = {"keymap/vim.js": "keyboard/vim2.js", "test/vim_test.js": "keyboard/vim2_test.js"};
|
||||
async.forEach(Object.keys(fileMap), function(x, next) {
|
||||
download(rootHref + x, function(e, d) {
|
||||
d = d.replace(/^\(function.*{[^{}]+^}[^{}]+{/m, "define(function(require, exports, module) {");
|
||||
d = d.replace(/^\s*return vimApi;\s*};/gm, " //};")
|
||||
.replace("var Vim = function() {", "$& return vimApi; } //{")
|
||||
fs.writeFile(rootDir + fileMap[x], d, next)
|
||||
})
|
||||
}, function() {
|
||||
console.log("done")
|
||||
});
|
||||
}
|
||||
},
|
||||
coffee: {
|
||||
fetch: function(){
|
||||
var rootHref = "https://raw.github.com/jashkenas/coffee-script/master/";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue