Rpinski / vscode-shebang-snippets

Shebang Snippets Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=rpinski.shebang-snippets
MIT License
23 stars 10 forks source link

Shebang Snippets

Visual Studio Marketplace Open VSX

Set of snippets for Visual Studio Code to insert "shebang" lines for various types of scripts and interpreters used on Unix-like systems.

Features

Shebang Snippets

After opening a new file you can just type # or press CTRL+SPACE at the beginning of the first line to add the full line:

Shebang Snippets in action

Currently supported shebang snippets:

Magic Comments for Encoding

For some languages the magic comment for encoding

# -*- coding: utf-8 -*-

can be inserted by typing # at the beginning of the second line. The snippet offers different encodings for selection.

Complete magic comment for encoding

Encoding selection

Automatic Selection of Language Mode

After inserting a shebang snippet the extension automatically switches current editor tab to the appropriate language. For example, if you insert a shebang for the Python interpreter, the editor will switch to "Python" mode.

Language Mode selection

Language Mode in Status Bar