Skip to content

Commit 74f08d3

Browse files
committed
fix keymap alert
1 parent 58057c4 commit 74f08d3

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
- Supports Emacs region select keybindings (includes column region)
1010
- Since Vim insert mode and mlti-cursors are incompatible, Vim disabled when column region mode.
1111
- Respect the default keybindings of VSCode
12-
- Using system clipboard
1312

1413
## Related extensions
1514

@@ -90,13 +89,13 @@ Blank type means it is not original keymap.
9089
| ctrl+x k | - | Emacs | `workbench.action.closeActiveEditor` |
9190
| ctrl+x ctrl-c | - | Emacs | `workbench.action.closeAllEditors` |
9291
| ctrl+x ctrl+n | - | - | `workbench.action.newWindow` |
92+
| ctrl+x n | - | - | `workbench.action.files.newUntitledFile` |
9393
| ctrl+x 1 | - | Emacs | `workbench.action.closeEditorsInOtherGroups` |
9494
| ctrl+x 2 | - | Emacs | `workbench.action.splitEditor` |
9595
| ctrl+x 3 | - | Emacs | `workbench.action.toggleEditorGroupLayout` |
9696
| ctrl+x o | - | Emacs | `workbench.action.navigateEditorGroups` |
9797
| ctrl+x shift+] | - | Emacs | `workbench.action.increaseViewSize` |
9898
| ctrl+x shift+[ | - | Emacs | `workbench.action.decreaseViewSize` |
99-
| ctrl+x n | - | - | `workbench.action.files.newUntitledFile` |
10099
| ctrl+x h | - | Emacs | `editor.action.selectAll` |
101100
| ctrl+x u | - | Emacs | `undo` |
102101
| ctrl+x r | - | - | `redo` |

package.json

+17-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vimacs",
33
"displayName": "Vimacs",
44
"description": "Provides Emacs keybindings for VSCodeVim",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"publisher": "migrs",
77
"engines": {
88
"vscode": "^1.0.0"
@@ -11,8 +11,13 @@
1111
"type": "git",
1212
"url": "https://github.com/migrs/vscode-vimacs"
1313
},
14+
"keywords": [
15+
"vim",
16+
"emacs",
17+
"keymaps",
18+
"keybindings"
19+
],
1420
"categories": [
15-
"Keymaps",
1621
"Extension Packs"
1722
],
1823
"icon": "images/icon.png",
@@ -74,7 +79,7 @@
7479
{
7580
"key": "ctrl+x ctrl+x",
7681
"command": "extension.vim_ctrl+x",
77-
"when": "editorTextFocus && mode != 'Insert' && vim.mode != 'Replace'"
82+
"when": "editorTextFocus && vim.active && vim.mode != 'Insert' && vim.mode != 'Replace'"
7883
},
7984
{
8085
"key": "ctrl+shift+2",
@@ -912,6 +917,15 @@
912917
"command": "workbench.action.quickOpenNavigateNext",
913918
"when": "inQuickOpen"
914919
},
920+
{
921+
"key": "ctrl+p",
922+
"command": "workbench.action.quickOpenNavigatePrevious",
923+
"when": "!editorFocus && !inQuickOpen"
924+
}, {
925+
"key": "ctrl+n",
926+
"command": "workbench.action.quickOpenNavigateNext",
927+
"when": "!editorFocus && !inQuickOpen"
928+
},
915929
{
916930
"key": "ctrl+g",
917931
"command": "closeFindWidget",

src/emacs-region.ts

-7
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ export function activate(context: vscode.ExtensionContext) {
3737
vscode.commands.executeCommand(deletionAction).then(exitRegionMode);
3838
}));
3939
});
40-
41-
const disableVimActions: string[] = ["action.insertLineBefore", "action.insertLineAfter"];
42-
disableVimActions.forEach((insertLineAction) => {
43-
context.subscriptions.push(vscode.commands.registerCommand("emacs." + insertLineAction, () => {
44-
vscode.commands.executeCommand("editor." + insertLineAction).then(exitRegionMode).then(vim.disableVim);
45-
}));
46-
});
4740
}
4841

4942
async function startRegionMode() {

src/emacs.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
'use strict';
22

33
import * as vscode from 'vscode';
4+
import * as vim from './vim'
45

56
export function activate(context: vscode.ExtensionContext) {
67
context.subscriptions.push(vscode.commands.registerCommand('emacs.cutAllRight', cutAllRight));
78
context.subscriptions.push(vscode.commands.registerCommand('emacs.scrollLineToCenter', scrollLineToCenter));
9+
10+
const insertLineActions: string[] = ["action.insertLineBefore", "action.insertLineAfter"];
11+
insertLineActions.forEach((insertLineAction) => {
12+
context.subscriptions.push(vscode.commands.registerCommand("emacs." + insertLineAction, () => {
13+
vscode.commands.executeCommand("editor." + insertLineAction).then(vim.disableVim);
14+
}));
15+
});
816
}
917

1018
async function cutAllRight() {

0 commit comments

Comments
 (0)