Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Snippets by patternNew to Visual Studio Code? Get it now.
Snippets by pattern

Snippets by pattern

aki77

|
374 installs
| (0) | Free
Snippets by specific pattern
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Snippets by pattern

Snippets by specific pattern.

Motivation

Snippets: Scope by specific file or pattern · Issue #75955 · microsoft/vscode

Extension Settings

For example settings.json

{
  "snippetsByPattern.snippets": {
    "**/db/migrate/*.rb": {
      "add_index": {
        "prefix": "add_index",
        "body": ["add_index :${1:table_name}, :${2:column_name}"]
      },
      "remove_index": {
        "prefix": "remove_index",
        "body": ["remove_index :${1:table_name}, :${2:column_name}"]
      }
    },
    "**/*_spec.rb": {
      "it": {
        "prefix": "it",
        "body": "it '$1' do\n  $2\nend"
      },
      "describe": {
        "prefix": "describe",
        "body": "describe '$1' do\n  $2\nend"
      },
      "context": {
        "prefix": "context",
        "body": "context '$1' do\n  $2\nend"
      }
    }
  }
}

User and Workspace settings are merged.

Commands

snippetsByPattern.copySnippetToClipboard

demo

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft