Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing window keys (<C-w><C-[hjklovq]>) #2600

Merged
merged 10 commits into from
May 5, 2018
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,21 @@
"command": "extension.vim_navigateLeft",
"when": "vim.use<C-w> && vim.active && !editorTextFocus"
},
{
"key": "ctrl+h",
"command": "extension.vim_navigateCtrlH",
"when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
Copy link
Member

@jpoon jpoon May 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be <C-h>

},
{
"key": "ctrl+w l",
"command": "extension.vim_navigateRight",
"when": "vim.use<C-w> && vim.active && !editorTextFocus"
},
{
"key": "ctrl+l",
"command": "extension.vim_navigateCtrlL",
"when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<C-l> here

},
{
"key": "ctrl+w ctrl+w",
"command": "extension.vim_navigateGroups",
Expand All @@ -225,16 +235,36 @@
"command": "extension.vim_navigateDown",
"when": "vim.use<C-w> && vim.active && !editorTextFocus"
},
{
"key": "ctrl+j",
"command": "extension.vim_navigateCtrlJ",
"when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to above.

},
{
"key": "ctrl+w k",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, don't think these keybindings are removed. We should only be binding to one single key combo here so any keys with ctrl+<key> <key> don't belong here.

"command": "extension.vim_navigateUp",
"when": "vim.use<C-w> && vim.active && !editorTextFocus"
},
{
"key": "ctrl+k",
"command": "extension.vim_navigateCtrlK",
"when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vim.use<C-k>

},
{
"key": "ctrl+w",
"command": "extension.vim_ctrl+w",
"when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
},
{
"key": "ctrl+q",
"command": "extension.vim_winCtrlQ",
"when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vim.use<C-q>

},
{
"key": "ctrl+v",
"command": "extension.vim_winCtrlV",
"when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vim.use<C-w>

},
{
"key": "ctrl+c",
"command": "extension.vim_ctrl+c",
Expand Down
14 changes: 7 additions & 7 deletions src/actions/commands/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2531,7 +2531,7 @@ class CommandNavigateLastBOL extends BaseCommand {
@RegisterAction
class CommandQuit extends BaseCommand {
modes = [ModeName.Normal];
keys = ['<C-w>', 'q'];
keys = [['<C-w>', 'q'], ['<C-w>', '<C-q>'], ['<C-w>', 'c'], ['<C-w>', '<C-c>']];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
new QuitCommand({}).execute();
Expand All @@ -2543,7 +2543,7 @@ class CommandQuit extends BaseCommand {
@RegisterAction
class CommandOnly extends BaseCommand {
modes = [ModeName.Normal];
keys = [['<C-w>', 'o'], ['<C-w>', 'C-o']];
keys = [['<C-w>', 'o'], ['<C-w>', '<C-o>']];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
new OnlyCommand({}).execute();
Expand All @@ -2555,7 +2555,7 @@ class CommandOnly extends BaseCommand {
@RegisterAction
class MoveToRightPane extends BaseCommand {
modes = [ModeName.Normal, ModeName.Visual, ModeName.VisualLine];
keys = [['<C-w>', 'l'], ['<C-w>', '<right>'], ['<C-w l>']];
keys = [['<C-w>', 'l'], ['<C-w>', '<right>'], ['<C-w l>'], ['<C-w>', '<C-l>']];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
vimState.postponedCodeViewChanges.push({
Expand All @@ -2570,7 +2570,7 @@ class MoveToRightPane extends BaseCommand {
@RegisterAction
class MoveToLowerPane extends BaseCommand {
modes = [ModeName.Normal, ModeName.Visual, ModeName.VisualLine];
keys = [['<C-w>', 'j'], ['<C-w>', '<down>'], ['<C-w j>']];
keys = [['<C-w>', 'j'], ['<C-w>', '<down>'], ['<C-w j>'], ['<C-w>', '<C-j>']];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
vimState.postponedCodeViewChanges.push({
Expand All @@ -2585,7 +2585,7 @@ class MoveToLowerPane extends BaseCommand {
@RegisterAction
class MoveToUpperPane extends BaseCommand {
modes = [ModeName.Normal, ModeName.Visual, ModeName.VisualLine];
keys = [['<C-w>', 'k'], ['<C-w>', '<up>'], ['<C-w k>']];
keys = [['<C-w>', 'k'], ['<C-w>', '<up>'], ['<C-w k>'], ['<C-w>', '<C-k>']];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
vimState.postponedCodeViewChanges.push({
Expand All @@ -2600,7 +2600,7 @@ class MoveToUpperPane extends BaseCommand {
@RegisterAction
class MoveToLeftPane extends BaseCommand {
modes = [ModeName.Normal, ModeName.Visual, ModeName.VisualLine];
keys = [['<C-w>', 'h'], ['<C-w>', '<left>'], ['<C-w h>']];
keys = [['<C-w>', 'h'], ['<C-w>', '<left>'], ['<C-w h>'], ['<C-w>', '<C-h>']];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
vimState.postponedCodeViewChanges.push({
Expand Down Expand Up @@ -2635,7 +2635,7 @@ class BaseTabCommand extends BaseCommand {
@RegisterAction
class VerticalSplit extends BaseCommand {
modes = [ModeName.Normal, ModeName.Visual, ModeName.VisualLine];
keys = ['<C-w>', 'v'];
keys = [['<C-w>', 'v'], ['<C-w>', '<C-v>']];

public async exec(position: Position, vimState: VimState): Promise<VimState> {
vimState.postponedCodeViewChanges.push({
Expand Down