Search code examples
visual-studio-codecode-snippetsvscode-snippets

How to disable Enter button for code snippet in VSCode


Sometimes when I press the Enter button, VSCode will aggressively complete the code which I don't want.

For example:

When I type in the

import numpy as np

and press the enter, VSCode will change the np to numpy

or when I type in the

else

and press the enter, VSCode will change it to

else
{
    /*...*/
}

while I sometimes really don't need this format.

So how can I disable 'Enter' for code snippet and use Tab only?


Solution

  • You can achieve this by going to your settings and search for Accept Suggestion On Enter in the search bar. Simply toggle it to off and this should solve your problem.enter image description here