4
keybinds.settings的语法是什么?我是VIM用户,我将最终想:keybinds.settings的语法是什么?
- 绑定移-J下井8行(nnoremapĴ8J)
- 其中k是相同的(nnoremakĴ8K)
- 用途,作为“领导者”,即我想绑定“,b”到“构建”,也许“g”在终端中运行“ghci文件名”。
keybinds.settings的语法是什么?我是VIM用户,我将最终想:keybinds.settings的语法是什么?
keybinding.settings文件仅适用于CLOUD9现在命令,用于定制Vim命令,你将不得不使用的init脚本(见Open Your Init Script item
在Cloud9
菜单)
您可以使用下面的代码片段
require(["plugins/c9.ide.ace.keymaps/vim/keymap"], function(vim) {
var defaultKeymap = vim.aceKeyboardHandler.defaultKeymap;
function ideCommand() { services.commands.exec(this.name); }
function map(keys, action, context) {
var mapping;
if (!action) {
return defaultKeymap.forEach(function(x) {
if (x.keys == keys) {
x.defaultKeys = keys;
x.keys = "";
}
});
} else if (/^c9:/.test(action)) {
var commandName = action.substr(3);
mapping = {
keys: keys, type: "action", action: "aceCommand",
actionArgs: { exec: ideCommand, name: commandName }
};
} else {
mapping = { keys: keys, type: "keyToKey", toKeys: action };
}
if (context)
mapping.context = context;
mapping.user = true;
defaultKeymap.unshift(mapping);
}
map("J", "8j", "normal");
map("K", "8k", "normal");
map(",", ""); // remove default mapping of ,
map(",b", "c9:build", "normal");
map(",g", "c9:run", "normal");
});
请注意,对于,g
您需要创建ghci转轮,详情请参阅https://docs.c9.io/custom_runners.html。
这真的很酷!非常感谢! – 2014-12-06 18:48:01