Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent VS Code intellisense suggestion boxes from consuming up/down arrows

When I type "std::" in VS Code with Intellisense active, a dropdown appears with suggested completions. Then, pressing the down key will cycle through the dropdown. But I don't want to browse through the dropdown with my arrow keys; I want to move to the next line of code. Is there a way to make arrow keys ignore the dropdown without disabling dropdowns entirely?

like image 329
Kevin Yin Avatar asked Dec 05 '17 09:12

Kevin Yin


People also ask

How do you toggle IntelliSense?

You can easily turn Intellisense on and off And it says, hey Ctrl + Q followed by Ctrl + I will toggle Intellisense on and off.


1 Answers

Add these to your keybindings.json:

{
  "key": "down",
  "command": "-selectNextSuggestion",
  "when": "textInputFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
// {
//   "key": "down",
//   "command": "Your Other Command Here",
//   "when": "textInputFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
// }

The first disables the default DownArrow action when a suggest panel is open and the second makes the DownArrow do something else in that situation. You don't need the second keybinding since you only want the default action once the special selectNextSuggestion is disabled.

like image 98
Mark Avatar answered Oct 16 '22 14:10

Mark