Visual Studio Code shortcut to display autocomplete list before typing
Asked Answered
F

8

190

I am trying to display all possible words after putting the cursor in certain place in the code.

The autocomplete (suggestions) list appears when I start writing/typing:

enter image description here

However, I would like to see all suggested words even before typing.

I tried command + space, however it was a system shortcut for Search in macOS:

enter image description here

Any thoughts?

Farinaceous answered 14/7, 2018 at 16:59 Comment(4)
It's Ctrl + space: code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf (Also described on the keybindings page)Maypole
Related: #56143739Hawk
It's called trigger suggest, default to ctrl + space, could change in File -> Preference -> Keyboard shortcutsWeeden
docs: code.visualstudio.com/docs/editor/…Antecedency
H
352

In case you are a CJK user using Mac, Ctrl+Space will not work, since it is used to switch IMEs.

There is another keyboard shortcut for triggering suggestions:

  • Option+Esc (Mac)
  • Alt+Esc (Windows)

Also see this post.


VS code version: 1.41.1

Hawk answered 16/1, 2020 at 16:46 Comment(8)
Confirmed ! Awesome. I upgraded VS Code to 1.141.1, and Option + esc works like a charm.Farinaceous
Do I have to press control + space every time? In my previous system it used to show without pressing. Any idea why it's not working anymore?Lennielenno
Pardon my ignorance, but what is CJK and IMEs ?Derose
@Derose CJK means China, Japan and Korea, which have similar character systems. IME stands for input method which is necessary to input CJK characters, contrary to the English language.Hawk
Thank you, I have no words. Upvoted you, of course. It works on Mac Studio, Ventura, M1 MaxEighth
Oops! This did not work for me because Option-Esc is tied to "Read selected text out loud" on my macOS. Fn-Control-Space and Command-I worked.Tang
Not sure why you single out CJK languages. This is true for ANY multi-language setup. For example, I am using SWE keyboard and I have to use ALT+ESC.Raceway
@DanieleTesta Thanks for pointing out, I am a CJK user, so I can only test for CJKHawk
A
131

I solved this problem using fn+control+space.
Hope it helps you.

Atone answered 7/8, 2019 at 0:53 Comment(7)
The question is about MacOS, also , fn does not exist with touchbar (Macbook 2018)Farinaceous
Thank you Sir! That is a correct answer for OSX users!Reiterant
It works on Macbook pro 2019 on BigSur. Thanks a lot!Pickett
Worked for Macbook pro 2019 on Monterey too. Thanks!Twiddle
Works for MBP (M2 Pro) 2023Robson
Works for everyone using MacPayne
Thank you, it works on Mac Studio, Ventura, M1 MaxEighth
A
78

"change input source" keyboard shortcut should be disabled

To disable it->

  • Go to system preferences -> keyboard -> input sources
  • add a new input source (choose ABC)
  • Go to shortcuts tab (inside of keyboard settings)
  • Click on input sources on the left
  • disable the "select previous input source" shortcut

restart your vs code and now ctrl+space will show quick suggestions.

Amaras answered 10/5, 2021 at 15:51 Comment(4)
wow. thank you so much!!Pires
Worked for a German QWERTZ keyboard layout! Thank you very much!!Carthy
Worked great, I struggled a lot finding this keyboard shortcut, thank you very much! ❤️Richers
One super import thing: Change that in your macOS System settings!!Hamo
N
71

You can use the following alternative keyboard shortcuts:

  • +i (mentioned in the official VS Code documentation for "Trigger suggestion")
  • +esc
  • fn+control+space
Nina answered 9/2, 2022 at 14:36 Comment(4)
Best answer: +IEscritoire
I like + IFlood
Unluckily, it is for copilot inlineChat.startSaucy
cmd+i conflicts with Copilot chatRubbish
M
25

The shortcut for the "Trigger Suggest" command is ⌃Space (ctrl+space) — as mentioned in the comments.

Most default shortcuts can be found in the documentation, which will automatically show the correct keybindings for the system you're on. In other words, if you visit the page on a Mac, you'll see Mac keybindings.

Additionally, you can:

  • go to Code > Preferences > Keyboard Shortcuts (on a Mac) and search for keybindings based on the command you want to execute
  • open up "show all commands" (⇧⌘P on a Mac) and search for the command there, allowing you to either view the keybinding for that command, or simply navigate to it directly from the search

Of course you'd have to have some idea of what the command's name might be. And in this case, a search for "suggest" would suffice.

Microfiche answered 14/7, 2018 at 19:0 Comment(1)
To add to this response, if the hotkey is set, even if disabled, it will not work. To fix it you have to enable it, remap and disable it back again.Kodiak
R
17

If you use too many keyboard layouts, maybe the MacOS shortcut might be active. You can disabled ^(Ctrl)+Space shortcuts for MacOS.

  • System Preferences>Keyboard>Shorcuts>Input Sources> Disable Select the previous input source.

You can use next shortcut for change input sources.Ctrl+Alt+Space

Regatta answered 17/6, 2020 at 16:32 Comment(1)
Great! I was getting language change on CTRL + Space in VS Code, but after disabling the change language shortcut from System Preferences AND restarting the VS Code it started to work as expected.Frazzled
P
5

when I was set up 2 keyboards with different layouts, and it turn out it overrides the ^+Space behavior, so this is how fix it:

  • Go to system preferences -> Keyboard -> Keyboard shortcuts enter image description here
  • Click on input sources
  • and disable the "select previous input source" shortcut enter image description here
Puppetry answered 22/2, 2023 at 7:25 Comment(0)
S
0

MacOs 14.4.1

cmd+i

or to change it

open vscode keyboard shortcut, find Trigger Suggest (source: user), change it to cmd+space

then on Mac,System Settings -> Keyboard Shortcuts -> Spotlight -> disable Show Spotlight Search

Starlet answered 20/4 at 14:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.