How to use `C-g` to replace `Esc`?
YarenZhang opened this issue · comments
hhxjzyr commented
Sorry for asking trivial questions. But how do I use C-g
like in Emacs? I searched through the internet yet do not find an answer to this. Many thanks~
spacegoing commented
Same question here
Steven Guh commented
The only two ways that I can think of
- Set that up in an external keyboard remapping like karabiner-elements for example
- Remap all the shortcuts in vscode that mapped to
esc
toC-g
. See https://code.visualstudio.com/docs/getstarted/keybindings
Closing this for now as this is mostly not related to this extension
spire commented
I got the functionality working by copying the keybinds from vscode-emacs-friendly. Or you could just install the add-on for a more emacs-like experience.
{
"key": "ctrl+g",
"command": "closeFindWidget",
"when": "editorFocus && findWidgetVisible"
},
{
"key": "ctrl+g",
"command": "closeReferenceSearchEditor",
"when": "inReferenceSearchEditor && !config.editor.stablePeek"
},
{
"key": "ctrl+g",
"command": "closeReferenceSearch",
"when": "referenceSearchVisible && !config.editor.stablePeek"
},
{
"key": "ctrl+g",
"command": "closeBreakpointWidget",
"when": "breakpointWidgetVisible && editorFocus"
},
{
"key": "ctrl+g",
"command": "leaveSnippet",
"when": "editorTextFocus && inSnippetMode"
},
{
"key": "ctrl+g",
"command": "closeMarkersNavigation",
"when": "editorFocus && markersNavigationVisible"
},
{
"key": "ctrl+g",
"command": "closeParameterHints",
"when": "editorTextFocus && parameterHintsVisible"
},
{
"key": "ctrl+g",
"command": "hideSuggestWidget",
"when": "editorTextFocus && suggestWidgetVisible"
},
{
"key": "ctrl+g",
"command": "cancelRenameInput",
"when": "editorFocus && renameInputVisible"
},
{
"key": "ctrl+g",
"command": "closeAccessibilityHelp",
"when": "accessibilityHelpWidgetVisible && editorFocus"
},
{
"key": "ctrl+g",
"command": "closeReplaceInFilesWidget",
"when": "replaceInputBoxFocus && searchViewletVisible"
},
{
"key": "ctrl+g",
"command": "workbench.action.closeMessages",
"when": "globalMessageVisible"
},
{
"key": "ctrl+g",
"command": "workbench.action.closeQuickOpen",
"when": "inQuickOpen"
},
Steven Guh commented
Thanks for providing an update and the tip