Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 2.17 KB

README.md

File metadata and controls

53 lines (35 loc) · 2.17 KB

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:

  • Shell:
    • sh
    • bash
    • zsh
    • nu
  • Expect: expect -f
  • Perl: perl
  • Lua: lua
  • Python:
    • python
    • python3
  • PHP: php
  • Node: node
  • F#: dotnet fsi
  • Ruby: ruby
  • Groovy: groovy
  • PowerShell Core: pwsh

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