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 = {
|
var keybindings = {
|
||||||
ace: null, // Null = use "default" keymapping
|
ace: null, // Null = use "default" keymapping
|
||||||
vim: require("ace/keyboard/vim").handler,
|
vim: require("ace/keyboard/vim").handler,
|
||||||
|
vim2: require("ace/keyboard/vim2").handler,
|
||||||
emacs: "ace/keyboard/emacs",
|
emacs: "ace/keyboard/emacs",
|
||||||
// This is a way to define simple keyboard remappings
|
// This is a way to define simple keyboard remappings
|
||||||
custom: new HashHandler({
|
custom: new HashHandler({
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-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">
|
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -96,6 +96,7 @@
|
||||||
<select id="keybinding" size="1">
|
<select id="keybinding" size="1">
|
||||||
<option value="ace">Ace</option>
|
<option value="ace">Ace</option>
|
||||||
<option value="vim">Vim</option>
|
<option value="vim">Vim</option>
|
||||||
|
<option value="vim2">Vim2</option>
|
||||||
<option value="emacs">Emacs</option>
|
<option value="emacs">Emacs</option>
|
||||||
<option value="custom">Custom</option>
|
<option value="custom">Custom</option>
|
||||||
</select>
|
</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")
|
var https = require("https");
|
||||||
, http = require("http")
|
var http = require("http");
|
||||||
, url = require("url")
|
var url = require("url");
|
||||||
, fs = require("fs");
|
var fs = require("fs");
|
||||||
|
|
||||||
var Path = require("path");
|
var Path = require("path");
|
||||||
var spawn = require("child_process").spawn;
|
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: {
|
coffee: {
|
||||||
fetch: function(){
|
fetch: function(){
|
||||||
var rootHref = "https://raw.github.com/jashkenas/coffee-script/master/";
|
var rootHref = "https://raw.github.com/jashkenas/coffee-script/master/";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue