implement redo

This commit is contained in:
Jason Poon 2015-11-29 00:38:12 -08:00
parent 560875c075
commit ac66853677
4 changed files with 6 additions and 3 deletions

View File

@ -26,7 +26,7 @@ Vim emulation for Visual Studio Code.
* Navigation: `h`, `j`, `k`, `l`
* Indentation: `>>`, `<<`
* Deletion: `dd`, `dw`
* Editing: `u`
* Editing: `u`, `ctrl+r`
### Planned

View File

@ -85,8 +85,9 @@ export function activate(context: vscode.ExtensionContext) {
registerCommand(context, 'extension.vim_6', () => handleKeyEvent("6"));
registerCommand(context, 'extension.vim_7', () => handleKeyEvent("7"));
registerCommand(context, 'extension.vim_8', () => handleKeyEvent("8"));
registerCommand(context, 'extension.vim_9', () => handleKeyEvent("9"));
registerCommand(context, 'extension.vim_9', () => handleKeyEvent("9"));
registerCommand(context, 'extension.vim_ctrl_r', () => handleKeyEvent("ctrl+r"));
registerCommand(context, 'extension.vim_ctrl_[', () => handleKeyEvent("ctrl+["));
registerCommand(context, 'extension.vim_<', () => handleKeyEvent("<"));

View File

@ -114,6 +114,7 @@
{ "key": "9", "command": "extension.vim_9", "when": "editorTextFocus" },
{ "key": "Ctrl+[", "command": "extension.vim_ctrl_[", "when": "editorTextFocus" },
{ "key": "Ctrl+r", "command": "extension.vim_ctrl_r", "when": "editorTextFocus" },
{ "key": "Shift+,", "command": "extension.vim_<", "when": "editorTextFocus" },
{ "key": "Shift+.", "command": "extension.vim_>", "when": "editorTextFocus" }

View File

@ -12,6 +12,7 @@ export default class CommandMode extends Mode {
this.keyHandler = {
":" : () => { showCmdLine(); },
"u" : () => { vscode.commands.executeCommand("undo"); },
"ctrl+r" : () => { vscode.commands.executeCommand("redo"); },
"h" : () => { vscode.commands.executeCommand("cursorLeft"); },
"j" : () => { vscode.commands.executeCommand("cursorDown"); },
"k" : () => { vscode.commands.executeCommand("cursorUp"); },