kasecato / vscode-intellij-idea-keybindings

Port of IntelliJ IDEA key bindings for VS Code.
https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings
MIT License
810 stars 135 forks source link

macos cmd+d not work #352

Closed zzhaolei closed 2 months ago

zzhaolei commented 2 months ago

macos cmd+d not work

expect: cmd+d Duplicate Line

grgar commented 2 months ago

cmd+d is implemented as duplicate line and duplicate selection.

https://github.com/kasecato/vscode-intellij-idea-keybindings/blob/57b9ca5da1c60bc9f8735e80e6e0ecd46715ef7d/package.json#L319-L332

What happens when you use cmd+d? There are good instructions on debugging keybinding issues on VS Code wiki.

zzhaolei commented 2 months ago

output:

2024-04-28 21:37:29.733 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-04-28 21:37:29.733 [info] [KeybindingService]: \ Keyboard event cannot be dispatched
2024-04-28 21:37:29.735 [info] [KeybindingService]: / Received  keydown event - modifiers: [meta], code: MetaLeft, keyCode: 91, key: Meta
2024-04-28 21:37:29.735 [info] [KeybindingService]: | Converted keydown event - modifiers: [meta], code: MetaLeft, keyCode: 57 ('Meta')
2024-04-28 21:37:29.735 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2024-04-28 21:37:30.077 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-04-28 21:37:30.077 [info] [KeybindingService]: | Resolving meta+[KeyD]
2024-04-28 21:37:30.078 [info] [KeybindingService]: \ From 5 keybinding entries, matched extension.vim_cmd+d, when: editorTextFocus && vim.active && vim.use<D-d> && !inDebugRepl, source: user extension vscodevim.vim.
2024-04-28 21:37:30.078 [info] [KeybindingService]: / Received  keydown event - modifiers: [meta], code: KeyD, keyCode: 68, key: d
2024-04-28 21:37:30.078 [info] [KeybindingService]: | Converted keydown event - modifiers: [meta], code: KeyD, keyCode: 34 ('D')
2024-04-28 21:37:30.078 [info] [KeybindingService]: | Resolving meta+[KeyD]
2024-04-28 21:37:30.078 [info] [KeybindingService]: \ From 5 keybinding entries, matched extension.vim_cmd+d, when: editorTextFocus && vim.active && vim.use<D-d> && !inDebugRepl, source: user extension vscodevim.vim.
2024-04-28 21:37:30.079 [info] [KeybindingService]: + Invoking command extension.vim_cmd+d.
2024-04-28 21:37:30.159 [info] [KeybindingService]: + Storing single modifier for possible chord meta.
2024-04-28 21:37:30.460 [info] [KeybindingService]: + Clearing single modifier due to 300ms elapsed.
grgar commented 2 months ago

From 5 keybinding entries, matched extension.vim_cmd+d

If you don't want vim handling cmd+d, add it (<D-d>) to vim.handleKeys set to false. Note the default value of vim.handleKeys has 3 entries already, so if you don't have this setting yet you should keep those values in settings.json:

    "vim.handleKeys": {
        "<C-d>": true,
        "<C-s>": false,
        "<C-z>": false,
        "<D-d>": false, // add this one
    },
zzhaolei commented 2 months ago

Now working, thanks!!!!!!!!