From 8bd7d192d146e213cc3b032d197c64f2db19e71c Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 11 Feb 2013 11:43:48 +0400 Subject: [PATCH] add `:/?` commands to vim mode --- lib/ace/keyboard/vim/commands.js | 18 +++++++++++++++--- lib/ace/keyboard/vim/maps/motions.js | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/ace/keyboard/vim/commands.js b/lib/ace/keyboard/vim/commands.js index 151aba04..3b9f1d1d 100644 --- a/lib/ace/keyboard/vim/commands.js +++ b/lib/ace/keyboard/vim/commands.js @@ -283,17 +283,29 @@ var actions = exports.actions = { }, ":": { fn: function(editor, range, count, param) { - // not implemented + var val = ":"; + if (count > 1) + val = ".,.+" + count + val; + if (editor.cmdLine) { + editor.cmdLine.setValue(val, 1); + editor.cmdLine.focus(); + } } }, "/": { fn: function(editor, range, count, param) { - // not implemented + if (editor.cmdLine) { + editor.cmdLine.setValue("/", 1); + editor.cmdLine.focus(); + } } }, "?": { fn: function(editor, range, count, param) { - // not implemented + if (editor.cmdLine) { + editor.cmdLine.setValue("?", 1); + editor.cmdLine.focus(); + } } }, ".": { diff --git a/lib/ace/keyboard/vim/maps/motions.js b/lib/ace/keyboard/vim/maps/motions.js index c143d218..961083a5 100644 --- a/lib/ace/keyboard/vim/maps/motions.js +++ b/lib/ace/keyboard/vim/maps/motions.js @@ -614,7 +614,7 @@ module.exports = { }; module.exports.backspace = module.exports.left = module.exports.h; -module.exports.right = module.exports.l; +module.exports.space = module.exports.return = module.exports.right = module.exports.l; module.exports.up = module.exports.k; module.exports.down = module.exports.j; module.exports.pagedown = module.exports["ctrl-d"];