Reputation: 3949
I am trying to enable tab auto-completion with pressing "Tab" button but it doesn't work for me and it always works as Tab character when it is supposed to work as autocomplete. Which setting or shortcut should I enable or disable to have this feature?
With pressing "Tab", I will get this;
PS: Pressing "Enter" works fine and accepts the suggestion and I can disable it by setting the following setting to off.
Upvotes: 49
Views: 109112
Reputation: 642
I found I had to press 'CTRL
+m
' to toggle whether the tab
key would...
Alternatively, try ctrl
+shift
+p
(opens command pallete), then search and select 'Toggle Tab Moves Focus'.
*It doesn't solve OP's exact error, but I came looking here for this answer, and others may, too. :)
Upvotes: 47
Reputation: 407
What worked for me was to search "suggestion" under keyboard shortcuts and change acceptSelectedSuggestion
from Enter
to Tab
.
Upvotes: 0
Reputation: 511
Well what worked for me is that I went to Keyboard Shortcuts
and then in toggle the sort by precedence
button on the left side of input and pressed the tab
key. Like this
As you can see the
Accept inline Suggestion
is there but its precedence is far lower.
What I did then is
Ctrl+Shift+P
and typing open default shortcut
tab
key using ctrl+f
accepting inline suggestion
{ "key": "tab",
"command": "acceptSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus" },
keybindings.json
file using Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac) and paste above JSON into itUpvotes: 0
Reputation: 1
Do this:
"editor.suggest.selectionMode": "always"
Here is the image the VS Code config in settings:
Upvotes: 0
Reputation: 3740
Choose an option in the drop down and then try using Shift + Enter
to confirm the suggestion.
If that works you can go to keyboard shortcuts in VSCode (File - Preferences - Keyboard Shortcuts) and search for Shift + Enter, you might see something like acceptAlternativeSelectedSuggestion and you could try changing that.
Upvotes: 1
Reputation: 1
Upvotes: 0
Reputation: 1
You likely have a Keyboard Shortcut overriding the System default.
Upvotes: 0
Reputation: 310
In my situation, I was working in a remote environment and my user settings weren't being applied to it (obviously).
This may be helpful to anyone who stumbles upon this question but the accepted answer doesn't work.
Just select your environment and then change the settings there.
Upvotes: 0
Reputation: 1145
Open Visual Study Code Setting.
Go to edit in settings.json.
Add the below code:-
"emmet.includeLanguages": {"javascript": "javascriptreact"},
Now have a fun 😄
Upvotes: 0
Reputation: 887
there may be keyboard shortcut conflicts in vs code. you should check keyboard shortcuts for tab, especially keyboard shortcuts come from extensions. if there is, you should remove it. then it will work.
Upvotes: 3
Reputation: 131
Control + P -> Terminal:Focus Terminal TabsView ->Click ().
Or Ctrl + shift + \
Upvotes: 0
Reputation: 1
For HTML doing both the steps listed by Vinoth on Sep 08, 2019 worked for me:
Upvotes: 0
Reputation: 1239
Try changing tab completion setting to On:
Editor › tab Completion
"editor.tabCompletion": "on"
Also for HTML/Javascript you could make emmet setting to true
"emmet.triggerExpansionOnTab": true
Upvotes: 49