vscode的keybindings.json 和 AHK 脚本映射Win键

vscodehotkey.ahk

https://github.com/m2nlight/AHKVSCodeLikeMac

; Shortcuts like mac
; Written by Bob
; https://github.com/m2nlight/AHKVSCodeLikeMac

#SingleInstance On

; Code.exe
#IfWinActive ahk_exe Code.exe

; Map Ctrl to Win
LWin::LCtrl
RWin::RCtrl
; emacs move cursor keymap
Ctrl & p::Send {Up}
Ctrl & n::Send {Down}
Ctrl & b::Send {Left}
Ctrl & f::Send {Right}
Alt & b::Send ^{Left}
Alt & f::Send ^{Right}
Ctrl & d::Send {Del}                    ; Delete a charactor
Alt & d::Send ^{Del}                    ; Delete right word 
Alt & Backspace::Send ^{Backspace}    ; Delete left word
; append features
!+d::Send !+{Down}                      ; Duplicate line

#IfWinActive

使用这个就不必用下面的json了。

keybingdings.json

ctrl/cmd+shift+p

> Open keyboard shortcuts file

[{ "key": "ctrl+f", "command": "cursorRight", "when": "editorTextFocus" },
    { "key": "ctrl+b", "command": "cursorLeft", "when": "editorTextFocus" },
    { "key": "ctrl+a", "command": "cursorHome", "when": "editorTextFocus" },
    { "key": "ctrl+e", "command": "cursorEnd", "when": "editorTextFocus" },
    { "key": "alt+f", "command": "cursorWordRight", "when": "editorTextFocus" },
    { "key": "alt+b", "command": "cursorWordLeft", "when": "editorTextFocus" },
    { "key": "ctrl+n", "command": "cursorDown", "when": "textInputFocus" },
    { "key": "ctrl+p", "command": "cursorUp", "when": "textInputFocus" },
    { "key": "ctrl+n", "command": "showNextParameterHint", "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" },
    { "key": "ctrl+p", "command": "showPrevParameterHint", "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" },
    { "key": "ctrl+n", "command": "selectNextSuggestion", "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" },
    { "key": "ctrl+p", "command": "selectPrevSuggestion", "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" },
    { "key": "ctrl+n", "command": "history.showNext", "when": "historyNavigationEnabled && historyNavigationWidget" },
    { "key": "ctrl+p", "command": "history.showPrevious", "when": "historyNavigationEnabled && historyNavigationWidget" },
    { "key": "ctrl+n", "command": "list.focusDown", "when": "listFocus && !inputFocus" },
    { "key": "ctrl+p", "command": "list.focusUp", "when": "listFocus && !inputFocus" },
    { "key": "ctrl+n", "command": "notifications.focusNextToast", "when": "notificationFocus && notificationToastsVisible" },
    { "key": "ctrl+p", "command": "notifications.focusPreviousToast", "when": "notificationFocus && notificationToastsVisible" },
    { "key": "ctrl+n", "command": "outline.focusDownHighlighted", "when": "outlineFiltered && outlineFocused" },
    { "key": "ctrl+p", "command": "outline.focusUpHighlighted", "when": "outlineFiltered && outlineFocused" },
    { "key": "ctrl+n", "command": "workbench.action.interactivePlayground.arrowDown", "when": "interactivePlaygroundFocus && !editorTextFocus" },
    { "key": "ctrl+p", "command": "workbench.action.interactivePlayground.arrowUp", "when": "interactivePlaygroundFocus && !editorTextFocus" },
    { "key": "ctrl+d", "command": "deleteRight", "when": "textInputFocus && !editorReadonly" },
    { "key": "alt+d", "command": "deleteWordRight", "when": "textInputFocus && !editorReadonly" },
    { "key": "alt+shift+d", "command": "editor.action.copyLinesDownAction", "when": "editorTextFocus" },
    { "key": "ctrl+alt+d", "command": "editor.action.addSelectionToNextFindMatch", "when": "editorFocus" },
    { "key": "ctrl+alt+f", "command": "actions.find", "when": "editorTextFocus" },
    { "key": "ctrl+alt+a", "command": "editor.action.selectAll", "when": "textInputFocus" },
    { "key": "ctrl+alt+n", "command": "workbench.action.files.newUntitledFile" },
    { "key": "ctrl+alt+p", "command": "workbench.action.quickOpen" }]
原文地址:https://www.cnblogs.com/Bob-wei/p/10069260.html