Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Shell Snippet TriggerNew to Visual Studio Code? Get it now.
Shell Snippet Trigger

Shell Snippet Trigger

mistcoversmyeyes

| (0) | Free
Trigger existing snippets with a backslash in Shell and Zsh files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Shell Snippet Trigger

Show existing snippet suggestions when you type a backslash (\) in Shell Script or Zsh files, just as backslash-aware Markdown extensions do.

Usage

  1. Install this extension in your local VS Code.
  2. Create a user snippet with a backslash prefix, or keep your existing snippets.
  3. Open a document with language mode Shell Script (shellscript) or Zsh (zsh).
  4. Type your prefix and accept a suggestion using your existing Enter/Tab settings.

For example, put this in a user .code-snippets file. The four backslashes in JSON represent two literal backslashes in the editor:

{
  "Shell function": {
    "scope": "shellscript,zsh",
    "prefix": "\\\\fn",
    "body": ["${1:function_name}() {", "\t${0::}", "}"]
  }
}

Type \\ to browse matching snippets, or continue with \\fn to narrow the list. A single \ is the registered trigger character, so it can already request suggestions. This extension does not require exactly two characters.

Behavior and limits

  • Uses VS Code's native snippet suggestions. No templates are bundled or copied.
  • Requires editor.suggestOnTriggerCharacters to be enabled and snippets not to be hidden from suggestions.
  • Does not alter keybindings, word boundaries, file associations, or formatting.
  • Only selects shellscript and zsh; Markdown behavior is untouched.
  • Does not provide Zsh language identification, syntax checking, or a language server.
  • Does not parse Shell syntax: a backslash may trigger suggestions inside strings or comments too. Press Escape to dismiss them.

Performance and privacy

Activates only when Shell Script or Zsh is opened. Registers one completion provider returning no additional items; VS Code supplies existing snippets. No runtime dependencies, subprocesses, network requests, telemetry, file watchers, timers, or workspace scans.

Remote workspaces and sync

Declared as a UI extension, so it runs locally even when editing WSL/SSH workspace documents. Once published to Marketplace, its local installation can be synchronized through VS Code Settings Sync's Extensions category. Enable Snippets separately to synchronize your user templates. This does not synchronize other remote language servers.

中文说明

在 Shell/Zsh 中注册单个反斜杠作为补全触发字符,复用现有 snippets。你可以继续使用双反斜杠前缀,例如 \\fn。不修改 Enter/Tab 习惯,不附带模板,不扫描工作区。仅有本地 VSIX 时不能依靠 Settings Sync 分发安装包;发布到 Marketplace 后才有正常的跨设备安装渠道。

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft