Skip to content

Commit

Permalink
navigate between view
Browse files Browse the repository at this point in the history
  • Loading branch information
lyup committed May 2, 2017
1 parent d707063 commit 075a420
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export async function activate(context: vscode.ExtensionContext) {
});
mh.vimState.cursorPosition = Position.FromVSCodePosition(mh.vimState.editor.selection.start);
mh.vimState.cursorStartPosition = Position.FromVSCodePosition(mh.vimState.editor.selection.start);
}
}
},
isRunning: false
});
Expand Down
27 changes: 26 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,31 @@
"command": "extension.vim_ctrl+[",
"when": "editorTextFocus && vim.active && vim.use<C-[> && !inDebugRepl"
},
{
"key": "ctrl+w h",
"command": "extension.vim_navigateLeft",
"when": "vim.use<C-w> && vim.active && !editorTextFocus"
},
{
"key": "ctrl+w l",
"command": "extension.vim_navigateRight",
"when": "vim.use<C-w> && vim.active && !editorTextFocus"
},
{
"key": "ctrl+w ctrl+w",
"command": "extension.vim_navigateGroups",
"when": "vim.use<C-w> && vim.active && !editorTextFocus"
},
{
"key": "ctrl+w j",
"command": "extension.vim_navigateDown",
"when": "vim.use<C-w> && vim.active && !editorTextFocus"
},
{
"key": "ctrl+w k",
"command": "extension.vim_navigateUp",
"when": "vim.use<C-w> && vim.active && !editorTextFocus"
},
{
"key": "ctrl+w",
"command": "extension.vim_ctrl+w",
Expand Down Expand Up @@ -482,4 +507,4 @@
"typescript": "^2.3.2",
"vscode": "^1.0.5"
}
}
}
12 changes: 5 additions & 7 deletions src/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3438,12 +3438,11 @@ class CommandQuit extends BaseCommand {
@RegisterAction
class MoveToRightPane extends BaseCommand {
modes = [ModeName.Normal, ModeName.Visual, ModeName.VisualLine];
keys = [["<C-w>", "l"],
["<C-w>", "<right>"]];
keys = [["<C-w>", "l"], ["<C-w>", "<right>"], ["<C-w l>"]];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
vimState.postponedCodeViewChanges.push({
command: "workbench.action.focusNextGroup",
command: "workbench.action.navigateRight",
args: {}
});

Expand All @@ -3454,12 +3453,11 @@ class MoveToRightPane extends BaseCommand {
@RegisterAction
class MoveToLeftPane extends BaseCommand {
modes = [ModeName.Normal, ModeName.Visual, ModeName.VisualLine];
keys = [["<C-w>", "h"],
["<C-w>", "<left>"]];
keys = [["<C-w>", "h"], ["<C-w>", "<left>"], ["<C-w h>"]];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
vimState.postponedCodeViewChanges.push({
command: "workbench.action.focusPreviousGroup",
command: "workbench.action.navigateLeft",
args: {}
});

Expand All @@ -3474,7 +3472,7 @@ class CycleThroughPanes extends BaseCommand {

public async exec(position: Position, vimState: VimState): Promise<VimState> {
vimState.postponedCodeViewChanges.push({
command: "workbench.action.navigateEditorGroups",
command: "workbench.action.navigateRight",
args: {}
});

Expand Down

0 comments on commit 075a420

Please sign in to comment.