Daniel Santarriaga
Daniel Santarriaga

Reputation: 60

Create code snippets in Visual Studio Code on trigger keypress TAB?

Is this possible in Visual Studio Code, like in Atom and Sublime Text, where code snippets can be inserted by pressing the TAB key.

Upvotes: 0

Views: 1159

Answers (2)

"editor.tabCompletion": true <-- I often get long loading paused with the editor attempting to figure out what else I could want.

"editor.tabCompletion": onlySnippets

^ I prefer to keep my typing and tabbing to be reserved for my code snippets and instantly will insert my snippet without any lag ever.

Upvotes: 0

MartinSGill
MartinSGill

Reputation: 1210

Yes, it's possible. The language you are using needs to support it though.

The following help page explains both how to use them and how to create your own:

https://code.visualstudio.com/Docs/customization/userdefinedsnippets

There is a setting:

"editor.tabCompletion": true

That controls if the Tab key triggers an expansion, it's off by default I believe but you can change it from File -> Preferences -> Settings.

Upvotes: 1

Related Questions