From 7223d3505c0c4323d668c77f164d9df2160cb303 Mon Sep 17 00:00:00 2001 From: Jason Poon Date: Fri, 18 Mar 2016 03:22:49 -0700 Subject: [PATCH] fixes #159. opens vscode's search panel when '/' pressed in command mode --- extension.ts | 1 + package.json | 1 + src/mode/modeNormal.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/extension.ts b/extension.ts index 799975a53d5..ed45c35705e 100644 --- a/extension.ts +++ b/extension.ts @@ -30,6 +30,7 @@ export function activate(context: vscode.ExtensionContext) { registerCommand(context, 'extension.vim_space', () => handleKeyEvent("space")); registerCommand(context, 'extension.vim_left_curly_bracket', () => handleKeyEvent("{")); registerCommand(context, 'extension.vim_right_curly_bracket', () => handleKeyEvent("}")); + registerCommand(context, 'extension.vim_forwardslash', () => handleKeyEvent("/")); registerCommand(context, 'extension.vim_a', () => handleKeyEvent("a")); registerCommand(context, 'extension.vim_b', () => handleKeyEvent("b")); diff --git a/package.json b/package.json index e4f11742cb6..fbdbf9d0f0c 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ { "key": "\\", "command": "extension.vim_backslash", "when": "editorTextFocus" }, { "key": "Shift+[", "command": "extension.vim_left_curly_bracket", "when": "editorTextFocus" }, { "key": "Shift+]", "command": "extension.vim_right_curly_bracket", "when": "editorTextFocus" }, + { "key": "/", "command": "extension.vim_forwardslash", "when": "editorTextFocus" }, { "key": "a", "command": "extension.vim_a", "when": "editorTextFocus" }, { "key": "b", "command": "extension.vim_b", "when": "editorTextFocus" }, diff --git a/src/mode/modeNormal.ts b/src/mode/modeNormal.ts index 712de01028a..7a1a66a7c6d 100644 --- a/src/mode/modeNormal.ts +++ b/src/mode/modeNormal.ts @@ -14,6 +14,7 @@ import {TextEditor} from './../textEditor'; export class NormalMode extends Mode { protected keyHandler : { [key : string] : (motion : Motion) => Promise<{}>; } = { ":" : async () => { return showCmdLine("", this._modeHandler); }, + "/" : async () => { return vscode.commands.executeCommand("workbench.view.search"); }, "u" : async () => { return vscode.commands.executeCommand("undo"); }, "ctrl+r" : async () => { return vscode.commands.executeCommand("redo"); }, "h" : async (c) => { return c.left().move(); },