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 Visual Studio Keymap support #24

Merged
merged 2 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to the Keyboard Macro Bata extension will be documented in t
### [Unreleased]
- New
- Added Delphi Keymap support. (See [Keymap Wrappers](keymap-wrapper/README.md)) [#23](https://github.com/tshino/vscode-kb-macro/pull/23)
- Added Visual Studio Keymap support. (See [Keymap Wrappers](keymap-wrapper/README.md)) [#24](https://github.com/tshino/vscode-kb-macro/pull/24)

### [0.7.0] - 2021-12-26
- New
Expand Down
1 change: 1 addition & 0 deletions keymap-wrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Click the keymap wrapper link in the table below, which opens a JSON file. Copy
| [Delphi Keymap](https://marketplace.visualstudio.com/items?itemName=alefragnani.delphi-keybindings) | [link](alefragnani.delphi-keybindings.json) | 2021-12-27 | `Ctrl/Cmd+Shift+R` | `Ctrl/Cmd+Shift+R` | `Ctrl/Cmd+Shift+P` |
| [Notepad++ Keymap](https://marketplace.visualstudio.com/items?itemName=ms-vscode.notepadplusplus-keybindings) | [link](ms-vscode.notepadplusplus-keybindings.json) | 2021-12-26 | `Ctrl+Shift+R` | `Ctrl+Shift+R` | `Ctrl+Shift+P` |
| [Sublime Text Keymap](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings) | [link](ms-vscode.sublime-keybindings.json) | 2021-12-21 | `Ctrl/Cmd+Q` | `Ctrl/Cmd+Q` | `Ctrl/Cmd+Shift+Q` |
| [Visual Studio Keymap](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vs-keybindings) | [link](ms-vscode.vs-keybindings.json) | 2021-12-29 | `Ctrl+M R` | `Ctrl+M R` | `Ctrl+M Enter` |
| [Vz Keymap](https://marketplace.visualstudio.com/items?itemName=tshino.vz-like-keymap) | [link](tshino.vz-like-keymap.json) | 2021-12-11 | `Ctrl+_` | `Ctrl+^` | `Ctrl+^` |

- Some keybinding for start/stop recording and playback in the above table are overriding the default shortcuts of VS Code such as Command Palette (`Ctrl/Cmd+Shift+P`).
Expand Down
28 changes: 28 additions & 0 deletions keymap-wrapper/ms-vscode.vs-keybindings.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"base": {
"type": "url",
"url": "https://github.com/microsoft/vscode-vs-keybindings/raw/main/package.json"
},
"footer": [
{
"key": "ctrl+m r",
"command": "kb-macro.startRecording",
"when": "!kb-macro.recording"
},
{
"key": "ctrl+m r",
"command": "kb-macro.finishRecording",
"when": "kb-macro.recording"
},
{
"key": "ctrl+m enter",
"command": "kb-macro.playback",
"when": "!kb-macro.recording"
},
{
"key": "ctrl+m enter",
"command": "kb-macro.cancelRecording",
"when": "kb-macro.recording"
}
]
}
116 changes: 116 additions & 0 deletions keymap-wrapper/ms-vscode.vs-keybindings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
[
// Keymap wrapper for Visual Studio Keymap v0.2.1
// (required by Keyboard Macro Beta)
{ "key": "ctrl+shift+b", "command": "kb-macro.wrap", "args": { "command": "workbench.action.tasks.build" },
"when": "kb-macro.recording" },
{ "key": "ctrl+b", "command": "kb-macro.wrap", "args": { "command": "workbench.debug.viewlet.action.addFunctionBreakpointAction" },
"when": "kb-macro.recording" },
{ "key": "ctrl+shift+f9", "command": "kb-macro.wrap", "args": { "command": "workbench.debug.viewlet.action.removeAllBreakpoints" },
"when": "kb-macro.recording" },
{ "key": "ctrl+shift+f5", "command": "kb-macro.wrap", "args": { "command": "workbench.action.debug.restart" },
"when": "kb-macro.recording && inDebugMode" },
{ "key": "ctrl+f10", "command": "kb-macro.wrap", "args": { "command": "editor.debug.action.runToCursor" },
"when": "kb-macro.recording && inDebugMode" },
{ "key": "ctrl+k ctrl+d", "command": "kb-macro.wrap", "args": { "command": "editor.action.formatDocument" },
"when": "kb-macro.recording" },
{ "key": "ctrl+k ctrl+x", "command": "insertSnippet",
"when": "kb-macro.recording" },
{ "key": "ctrl+shift+l", "command": "kb-macro.wrap", "args": { "command": "editor.action.deleteLines" },
"when": "kb-macro.recording && editorTextFocus && !editorReadonly" },
{ "key": "ctrl+l", "command": "kb-macro.wrap", "args": { "command": "editor.action.clipboardCutAction", "await": "document selection clipboard" },
"when": "kb-macro.recording && !kb-macro.headOfLine && editorTextFocus && !editorReadonly" },
{ "key": "ctrl+l", "command": "kb-macro.wrap", "args": { "command": "editor.action.clipboardCutAction", "await": "document clipboard" },
"when": "kb-macro.recording && kb-macro.headOfLine && editorTextFocus && !editorReadonly" },
{ "key": "ctrl+shift+g", "command": "kb-macro.wrap", "args": { "command": "workbench.action.files.openFileFolder" },
"when": "kb-macro.recording" },
{ "key": "alt+f12", "command": "kb-macro.wrap", "args": { "command": "editor.action.referenceSearch.trigger" },
"when": "kb-macro.recording" },
{ "key": "ctrl+y", "command": "kb-macro.wrap", "args": { "command": "redo" },
"when": "kb-macro.recording" },
{ "key": "ctrl+w", "command": "kb-macro.wrap", "args": { "command": "editor.action.smartSelect.expand" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "shift+alt+.", "command": "kb-macro.wrap", "args": { "command": "editor.action.addSelectionToNextFindMatch" },
"when": "kb-macro.recording && editorFocus" },
{ "key": "ctrl+alt+space", "command": "editor.action.triggerSuggest",
"when": "kb-macro.recording && editorHasCompletionItemProvider && editorTextFocus && !editorReadonly" },
{ "key": "alt+space", "command": "kb-macro.wrap", "args": { "command": "undo" },
"when": "kb-macro.recording" },
{ "key": "ctrl+delete", "command": "kb-macro.wrap", "args": { "command": "deleteWordEndRight" },
"when": "kb-macro.recording && editorTextFocus && !editorReadonly" },
{ "key": "ctrl+backspace", "command": "kb-macro.wrap", "args": { "command": "deleteWordStartLeft" },
"when": "kb-macro.recording && editorTextFocus && !editorReadonly" },
{ "key": "ctrl+shift+s", "command": "kb-macro.wrap", "args": { "command": "workbench.action.files.saveAll" },
"when": "kb-macro.recording" },
{ "key": "ctrl+alt+o", "command": "kb-macro.wrap", "args": { "command": "workbench.action.output.toggleOutput" },
"when": "kb-macro.recording" },
{ "key": "ctrl+alt+l", "command": "kb-macro.wrap", "args": { "command": "workbench.view.explorer" },
"when": "kb-macro.recording" },
{ "key": "ctrl+r ctrl+r", "command": "kb-macro.wrap", "args": { "command": "editor.action.rename" },
"when": "kb-macro.recording && editorHasRenameProvider && editorTextFocus && !editorReadonly" },
{ "key": "ctrl+r ctrl+w", "command": "kb-macro.wrap", "args": { "command": "editor.action.toggleRenderWhitespace" },
"when": "kb-macro.recording" },
{ "key": "ctrl+k ctrl+m", "command": "kb-macro.wrap", "args": { "command": "editor.foldAll" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "ctrl+-", "command": "kb-macro.wrap", "args": { "command": "workbench.action.navigateBack" },
"when": "kb-macro.recording" },
{ "key": "ctrl+shift+-", "command": "kb-macro.wrap", "args": { "command": "workbench.action.navigateForward" },
"when": "kb-macro.recording" },
{ "key": "ctrl+,", "command": "kb-macro.wrap", "args": { "command": "workbench.action.quickOpen" },
"when": "kb-macro.recording" },
{ "key": "shift+alt+down", "command": "kb-macro.wrap", "args": { "command": "cursorColumnSelectDown" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "shift+alt+left", "command": "kb-macro.wrap", "args": { "command": "cursorColumnSelectLeft" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "shift+alt+pagedown", "command": "kb-macro.wrap", "args": { "command": "cursorColumnSelectPageDown" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "shift+alt+pageup", "command": "kb-macro.wrap", "args": { "command": "cursorColumnSelectPageUp" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "shift+alt+right", "command": "kb-macro.wrap", "args": { "command": "cursorColumnSelectRight" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "shift+alt+up", "command": "kb-macro.wrap", "args": { "command": "cursorColumnSelectUp" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "shift+alt+enter", "command": "kb-macro.wrap", "args": { "command": "workbench.action.toggleZenMode" },
"when": "kb-macro.recording" },
{ "key": "ctrl+f4", "command": "kb-macro.wrap", "args": { "command": "workbench.action.closeActiveEditor" },
"when": "kb-macro.recording" },
{ "key": "ctrl+d", "command": "kb-macro.wrap", "args": { "command": "editor.action.copyLinesDownAction" },
"when": "kb-macro.recording" },
{ "key": "ctrl+right", "command": "kb-macro.wrap", "args": { "command": "cursorWordStartRight" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "ctrl+shift+right", "command": "kb-macro.wrap", "args": { "command": "cursorWordStartRightSelect" },
"when": "kb-macro.recording && editorTextFocus" },
{ "key": "ctrl+enter", "command": "kb-macro.wrap", "args": { "command": "editor.action.insertLineBefore" },
"when": "kb-macro.recording && editorTextFocus && !editorReadonly" },
{ "key": "shift+enter", "command": "kb-macro.wrap", "args": { "command": "editor.action.insertLineAfter" },
"when": "kb-macro.recording && editorTextFocus && !editorReadonly" },
{ "key": "ctrl+shift+down", "command": "kb-macro.wrap", "args": { "command": "editor.action.wordHighlight.next" },
"when": "kb-macro.recording && editorTextFocus && hasWordHighlights" },
{ "key": "ctrl+shift+up", "command": "kb-macro.wrap", "args": { "command": "editor.action.wordHighlight.prev" },
"when": "kb-macro.recording && editorTextFocus && hasWordHighlights" },
{ "key": "alt+a", "command": "kb-macro.wrap", "args": { "command": "editor.action.replaceAll" },
"when": "kb-macro.recording && editorFocus && findWidgetVisible" },
{ "key": "alt+a", "command": "kb-macro.wrap", "args": { "command": "search.action.replaceAll" },
"when": "kb-macro.recording && replaceActive && searchViewletVisible && !findWidgetVisible" },
{ "key": "alt+a", "command": "kb-macro.wrap", "args": { "command": "search.action.replaceAllInFile" },
"when": "kb-macro.recording && fileMatchFocus && replaceActive && searchViewletVisible" },
{ "key": "alt+a", "command": "kb-macro.wrap", "args": { "command": "search.action.replaceAllInFolder" },
"when": "kb-macro.recording && folderMatchFocus && replaceActive && searchViewletVisible" },
{ "key": "alt+r", "command": "kb-macro.wrap", "args": { "command": "editor.action.replaceOne" },
"when": "kb-macro.recording && editorFocus && findWidgetVisible" },
{ "key": "alt+r", "command": "kb-macro.wrap", "args": { "command": "search.action.replace" },
"when": "kb-macro.recording && matchFocus && replaceActive && searchViewletVisible" },
{ "key": "alt+e", "command": "kb-macro.wrap", "args": { "command": "toggleSearchRegex" },
"when": "kb-macro.recording && searchInputBoxFocus && searchViewletVisible" },
{ "key": "alt+e", "command": "kb-macro.wrap", "args": { "command": "toggleFindRegex" },
"when": "kb-macro.recording && editorFocus" },
{ "key": "ctrl+delete", "command": "kb-macro.wrap", "args": { "command": "deleteWordStartRight" },
"when": "kb-macro.recording && editorTextFocus && !editorReadonly" },
{ "key": "ctrl+m r", "command": "kb-macro.startRecording",
"when": "!kb-macro.recording" },
{ "key": "ctrl+m r", "command": "kb-macro.finishRecording",
"when": "kb-macro.recording" },
{ "key": "ctrl+m enter", "command": "kb-macro.playback",
"when": "!kb-macro.recording" },
{ "key": "ctrl+m enter", "command": "kb-macro.cancelRecording",
"when": "kb-macro.recording" }
]