I want to use a 'for' snippet for example. I write for and press tab twice so it autocompletes to the whole for loop and selects the counter so I can change it. I change that and then press tab to go to next variable(the one 'counter < [here]' in the condition statement). Then the problem is i write 'arr' and it autocompletes to something like 'ANGLE_instanced_arrays'. I want to just write 'arr' then press tab to go to next variable in the loop, BUT if I press tab it autocompletes. Any solutions?
Tab is conflicting intellisense and snippets in vs code
4.3k Views Asked by Kys Plox AtThere are 4 best solutions below
                        
                            
                        
                        
                            On
                            
                                                    
                    
                Basically JakeParis's comment to a previous answer is what worked for me. However it was confusing for me to find the correct key binding in the Keyboard Shortcuts UI, so I figured I could help provide some guidance on that.
I found it was easiest to use the search bar for acceptSelectedSuggestion, then find the line that was currently bound to the Tab key, then right-click and "Change When Expression" like so: suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus && !inSnippetMode
screenshot of the line in the Keyboard Shortcuts UI. VSCode v1.82
                        
                            
                        
                        
                            On
                            
                                                    
                    
                I created an account specifically to answer this question because it's such an annoying problem :)
Add the following to your keybindings.json:
{"key": "tab", "command": "-acceptSelectedSuggestion", "when": "editorTextFocus && suggestWidgetVisible"},    
{"key": "tab", "command": "acceptSelectedSuggestion", "when": "editorTextFocus && suggestWidgetVisible && !inSnippetMode" },    
The first line disables the existing rule, the second line re-enables it unless you're in snippet mode.
                        
                            
                        
                        
                            On
                            
                                                    
                    
                this is my keybindings.json press tab to go to next variable in the loop ctrl+p go to the previous one
[  
    {   
      "key": "tab",               
      "command": "selectNextSuggestion",  
      "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible" },  
    {  
      "key": "ctrl+p",                    
      "command": "selectPrevSuggestion",  
      "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible" },  
]
                        
What you can do is to disable accepting suggestions on
taband to enable puretabCompletion. The respective settings are"editor.acceptSuggestionOnEnter": falseand"editor.tabCompletion": true. With those settings you can complete snippets, likeforjust with tab (no IntelliSense pop up) and when IntelliSense shows suggestions can be accepted withenteronly