Skip to content

Commit

Permalink
Merge pull request #142 from tienshiao/page-up-page-down
Browse files Browse the repository at this point in the history
Implement ctrl+f/ctrl+b (PageDown/PageUp)
  • Loading branch information
jpoon committed Feb 16, 2016
2 parents e273ebc + 7e4fc79 commit 874f4da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export function activate(context: vscode.ExtensionContext) {

registerCommand(context, 'extension.vim_ctrl_r', () => handleKeyEvent("ctrl+r"));
registerCommand(context, 'extension.vim_ctrl_[', () => handleKeyEvent("ctrl+["));
registerCommand(context, 'extension.vim_ctrl_f', () => handleKeyEvent("ctrl+f"));
registerCommand(context, 'extension.vim_ctrl_b', () => handleKeyEvent("ctrl+b"));

registerCommand(context, 'extension.vim_%', () => handleKeyEvent("%"));

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@

{ "key": "Ctrl+[", "command": "extension.vim_ctrl_[", "when": "editorTextFocus" },
{ "key": "Ctrl+r", "command": "extension.vim_ctrl_r", "when": "editorTextFocus" },
{ "key": "Ctrl+f", "command": "extension.vim_ctrl_f", "when": "editorTextFocus" },
{ "key": "Ctrl+b", "command": "extension.vim_ctrl_b", "when": "editorTextFocus" },

{ "key": "Shift+5", "command": "extension.vim_%", "when": "editorTextFocus" },

Expand Down
2 changes: 2 additions & 0 deletions src/mode/modeNormal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export class NormalMode extends Mode {
"b" : async (c) => { return c.wordLeft().move(); },
"}" : async (c) => { return c.goToEndOfCurrentParagraph().move(); },
"{" : async (c) => { return c.goToBeginningOfCurrentParagraph().move(); },
"ctrl+f": async (c) => { return vscode.commands.executeCommand("cursorPageDown"); },
"ctrl+b": async (c) => { return vscode.commands.executeCommand("cursorPageUp"); },
"%" : async () => { return vscode.commands.executeCommand("editor.action.jumpToBracket"); },
">>" : async () => { return vscode.commands.executeCommand("editor.action.indentLines"); },
"<<" : async () => { return vscode.commands.executeCommand("editor.action.outdentLines"); },
Expand Down

0 comments on commit 874f4da

Please sign in to comment.