VSCode suggest multiple auto completion options in a list to me. I can navigate the list with the arrow keys, and auto complete using the currently selected item via ENTER. To me, this is counter intuitive, because to navigate with the arrow keys, I have to shift my hand position on the keyboard. I would expect, e.g. TAB to navigate to the next element in the list & hitting ENTER to complete. Is there a shortcut for navigating besides the arrow keys that I am missing?
Related
In VSCode, the intellisense autocomplete suggestions occasionally pop up and prevent me from using the arrow keys to move my cursor up and down. Is there any way for me to disable the auto focusing of the suggestions until I push the tab key? (A.K.A: I want to be able to cycle through the autocomplete suggestions only after I push the tab key)
Under Preferences > Keyboard Shortcuts, find and remove the keyboard shortcuts that associate the up and down arrow with "Next Suggestion" and "Prev Suggestion". You should no longer get your arrows hijacked by the suggestions and can then use the default alternative of ctrl+up or ctrl+down to navigate them. It won't toggle on Tab like you want, but it's a good workaround.
Default VS Code Intellisense behaviour
User is presented with a menu of suggestions
User then has to press the Up or Down arrow keys to navigate through the menu
Finally user has to confirm with Enter to insert the suggestion and close the dialog
What I would like instead
Don't need to press Enter
Suggestions are automatically inserted (and cycled through) by pressing Up/Down
Pressing any other keys will close the dialog and resume typing
To be clear, I want to replicate the default behaviour of YouCompleteMe:
When you type, a completion menu pops up. If you like the completions, you use the <Tab> key (by default, can be changed to <Enter> or <Down> arrow or whatever) to select a completion string you want. The very act of "tabbing through" the list to select the item you want inserts the candidate string. When you tab to a different candidate, the editor code is replaced with the new candidate. There is no accept key because by the point where you have the candidate you want selected in the menu the candidate has already been inserted in the editor. There is nothing to "accept". You just keep typing, the candidate has already been inserted.
Is such behaviour possible with Visual Studio Code, either by default or through a plugin?
The editor.tabCompletion option is the closest thing currently available:
By default, tab completion is disabled. Use the editor.tabCompletion setting to enable it. These values exist:
off - (default) Tab completion is disabled.
on - Tab completion is enabled for all suggestions and repeated invocations insert the next best suggestion.
onlySnippets - Tab completion only inserts static snippets which prefix match the current line prefix.
(Emphasis mine)
... except that the first Tab press hides the suggestion window.
I did some digging about editor.tabCompletion, and I found that closing the suggestion window is part of the tab completion's option original design, and that while other users have asked about an option not to close the suggestion window or specifically YouCompleteMe-style behaviour, that this is currently not supported.
"editor.acceptSuggestionOnEnter": "off",
To disable Enter to accept suggestion.
We have a view that we developed, in this view at the beginning a keyboard shortcut key binding works. So I open a list. Then After right clicking the opened list item, I get the context menu. Now after getting this last context menu, I try to hide the list by clicking the same key binding. But the windows computer gives a sound of bing. It sounds like a focus lost but nope, The list item is higlighted. And when I press the item and then press the key binging it bings again. And interestingly the other keys does work. I can press other key options and they work but the shortcut key binding key that hides and shows the list of items does not work. When I right click to the item that does not work with certain key bindings, does work interestingly. any idea about this situation ?
We have used setEnabled in code, that disables the shortcuts. After deleting these enablement code we got the keys work as we want.
Is there a way to show/hide various panels in Eclipse?
For example, shift-alt-p opens the Package Explorer panel in my setup, but then to close the panel I have to mouse over and close it manually.
Ideally one could toggle show/hide panels in Eclipse with keyboard shortcuts set via prefs > general > keys
Tough on the wrist to go keyboard-mouse-keyboard-mouse all day.
Perhaps I'm missing some magic combo, please enlighten if you have the Nirvana to spare.
Press Ctrl+F7 you will get below pop up.
Traverse or cycle through the views you want to close by pressing F7 key. After selecting the view to be closed in the above pop up release Ctrl key.
Then the view to be closed will be activated.
Go to Window->Preferences type keys in the search box. Check whether any short cut key is assigned to close part. Refer below picture,
In my case it is assigned to Ctrl+W. Once the view is activated press this short cut key to close the view. If any short cut key is not assigned to close part then you can assign new short-cut key for this.
Click on Binding text box(Refer second picture) and assign your own short cut key.
When Eclipse shows a popup for code completion, how do you change the highlighted option using the keyboard home keys? Currently, if the thing I want is third or fourth on the list of suggestions, I have to use the mouse to select it, or use the arrow keys. Is there a way to use the keyboard home keys/ shortcuts with ctrl/alt to do this?
Arrow keys always work for me. Can you be little more specific as to what perspective, editor, etc?
I get a code completion popup when I press Ctrl + 1 in the Java editor. From then on, I can use the arrow keys to navigate.
I'm assuming you want to select from the code completion menu by X for up and Y for down. Go to Preferences > Keys and bind the commands Line Up and Line Down to X and Y, respectively. Make sure that in the When drop-down you select In Windows.
Note that after the settings are applied, X (Y) also makes the cursor go one line up (down) in the source editor. Personally, I use X = Ctrl+P and Y = Ctrl+N which means I can navigate lines and select entries from the code completion menu without lifting my hands off the keyboard.
Unfortunately, these bindings don't work with other pop-up lists in Eclipse, e.g. quick outline (Ctrl+O) or quick access (Ctrl+3). I'd love to find out how to bind these too.