Visual Studio Code is currently a hot cake in the software development field. It is pretty lightweight but powerful source code editor that runs on your desktop. It is available for Windows, macOS and Linux. It has rich ecosystem of extensions which is called Visual Studio Marketplace.
If you are into programming, you must have already heard about Gist. Gist is an easy way to share snippets and files. This is one awesome service provided by GitHub. It allows you to store code snippets for later use, you can have as many private gists as you need and you can group multiple gist files under a single gist.
If you frequently use Gist then there is a Gist Extension which helps you to use it the easy way in Visual Studio Code. You can install this extension from the marketplace.
Generating Access Token
You will need Access Token for using Gist in Sublime text.
- Open up GitHub site.
- Go to Developer Settings
- Go to “Personal access tokens”
- Click “Generate new token”
- Enter some meaningful name in “Note”
- Under “Select scopes”, select “gist”
- Click “Generate token”
- Copy the token and keep safe. You will need it in VS Code settings.
Setting up Gist in Visual Studio Code
- Open Visual Studio Code
- Press CTRL + ALT + = (in Windows/Linux) or Control + Option + = (in MacOS)
- Command palette will open.
- Select “Create New Profile”
- Select your Github profile.
- Enter Access Token you have generated from GitHub site.
- Give a profile name.
Setup is now complete.
Using Gist in Visual Studio Code
After setup is complete, you can access all Gist options from the command palette. Press Control + Shift + P, and command palette will open. Type “Gist” and you will see all Gist commands.
Say you want to create Gist from the current file. Open command palette with Control + Shift + P, and select “GIST: Create New Gist”. Give file name for the Gist and press Enter key. Then enter Gist description and press Enter. Then it will ask “Public?”. Enter “Y” to create a public Gist or enter “N” to create a private Gist
Press Control + Shift + P to open command palette and select “GIST: Open Gist”. Now you will see the list of your Gists. Select your desired Gist and press Enter. You can then edit the files normally and save to update the Gist.
|Command||Command Label||Keyboard Shortcut|
|extension.gist.openFavorite||Open Favorite Gist|
|extension.gist.create||Create New Gist|
|extension.gist.openInBrowser||Open Gist In Browser||ctrl+alt+b|
|extension.gist.add||Add File||ctrl+alt+a ctrl+alt+a|
|extension.gist.insert||Insert Text From Gist File|