tabout icon indicating copy to clipboard operation
tabout copied to clipboard

Change keybinding

Open mjs271 opened this issue 3 years ago • 3 comments

I would love to be able to easily change the tabout keybinding. The reason for this is that the current functionality, exiting brackets/parentheses via pressing tab, interferes with autocompletion inside these brackets/parentheses (e.g., autocompleting a variable name inside a function call). I personally use shift+tab in Sublime to achieve this end, but would love to see this in vscode.

mjs271 avatar Oct 22 '20 16:10 mjs271

This is already possible right? Via the OOTB 'Keyboards Shortcuts' it's possible to change the keybindings. Go to 'File' -> 'Preferences' -> 'Keyboard Shortcuts' and search for 'tabout'. You can change the keybinding there.

albertromkes avatar Oct 22 '20 17:10 albertromkes

That is a semi-viable workaround, but I see a couple of issues with it. First, the default keybindings json is read only, and would require more effort for a standard user to mess with, and second, adding something like:

{ "key": "shift+tab",             "command": "tabout",
                                     "when": "editorTextFocus && !editorHasMultipleSelections && !inSnippetMode && !suggestWidgetVisible" },

to the editable keyboard shortcuts json doesn't override the default, but instead makes both tab and shift+tab bound to tabout.

FWIW, my current workaround was to edit the source files within this package, change everything to my desired keybind, and restart vscode, though being able to change things more readily would be nice.

I suppose this may not actually be an issue but a feature request, so feel free to close if you think proper.

mjs271 avatar Oct 22 '20 17:10 mjs271

I wanted a different mapping, so I went to File > Preferences > Keyboard Shortcuts, typed in "tabout" and saw that it had Tab as the keybinding, so I clicked the edit icon for the tabout command and changed it to Shift+Space (or shift+tab or whatever you want). That seemed to work just fine for me. I didn't run into read-only issues with bindings.

The only thing I ran into was that Shift+Space was already taken, so I had to remap whatever that was used by to something else to free it up, but no biggie there.

That said, I always like it when extension developers make it easy to customize command triggers in the extension settings directly, so I'd support an effort in that regard. :)

jinglesthula avatar Jan 11 '21 22:01 jinglesthula

I think this can be closed.

Fred-Vatin avatar Sep 13 '23 23:09 Fred-Vatin