Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>YAML Key SearchNew to Visual Studio Code? Get it now.
YAML Key Search

YAML Key Search

Gargi Chaurasia

|
10 installs
| (0) | Free
Search and replace YAML keys using dot notation across all YAML files in your workspace. Professional UI with bulk operations, file exclusions, and smart navigation.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

YAML Key Search & Replace

A VS Code extension for searching and replacing YAML keys across your workspace using dot notation with exact matching!

Features

  • ** Exact Match Search** - Only finds keys that match exactly (no partial or false positives)
  • ** Dot Notation Support** - Search using familiar paths like database.connection.timeout
  • ** Find and Replace** - Replace values across multiple YAML files
  • ** Smart Navigation** - Jump directly to matching keys
  • ** Bulk Operations** - Replace all or selectively choose which matches to update

How It Works

This extension uses a tree-based flattening algorithm to ensure 100% accurate matching

What Gets Matched

# Searching for "database.host" will find:

# Example 1: Direct dot notation
database.host: "localhost"  -> MATCH

# Example 2: Hierarchical structure
database:
  host: "localhost"  -> MATCH (flattened as "database.host")

# Example 3: Multi-level nesting
app:
  database:
    host: "localhost"  -> NO MATCH (this is "app.database.host", not "database.host")

What WON'T Match

The extension will NOT match these false positives:

# Searching for "database.host" will NOT find:

database_host: "value"        -> Different key (underscore vs dot)
database.hostname: "value"    -> Different key (hostname vs host)
host: "value"                 -> Missing parent (this is just "host")
database: "value"             -> Incomplete path (no .host)

# Wrong hierarchical context
wrong:
  database:
    host: "value"             -> This is "wrong.database.host", not "database.host"

parent:
  database:
    host: "value"             -> This is "parent.database.host", not "database.host"

Usage

Search Only

Keyboard Shortcut:

  1. Press Cmd+Shift+Y (Mac) or Ctrl+Shift+Y (Windows/Linux)
  2. Enter the key path (e.g., database.connection.timeout)
  3. Press Enter to see all exact matches
  4. Click any result to jump to that location

Right-Click Menu:

  1. Select text or place cursor on a word
  2. Right-click → "Search Selected YAML Key"

Find & Replace

Keyboard Shortcut:

  1. Press Cmd+Shift+H (Mac) or Ctrl+Shift+H (Windows/Linux)
  2. Enter the key path to search
  3. Enter the new value
  4. Review and approve changes using the professional interface

Right-Click Menu:

  1. Select text or place cursor on a word
  2. Right-click → "Find and Replace Selected YAML Key"

Replace Interface Options

The replace modal provides several options:

  • 📋 View All Matches - See file paths, line numbers, and current values
  • ☑️ Selective Replacement - Use checkboxes to choose which matches to replace
  • 👁️ Preview - Click any match to view it in the editor
  • 🔄 Review Each - Git diff-style review for individual changes
  • ⚡ Bulk Actions - Replace Selected, Replace All, or Cancel

Key Path Format

Use dot notation to represent nested YAML keys:

database:
  connection:
    host: 'localhost'
    port: 5432
    timeout: 30
  pool:
    max-connections: 10

spring:
  application:
    name: 'my-app'

Valid search paths:

  • database.connection.host → finds "localhost"
  • database.connection.port → finds 5432
  • database.connection.timeout → finds 30
  • database.pool.max-connections → finds 10
  • spring.application.name → finds "my-app"

What makes a valid search:

  • Must be the complete path from root to leaf
  • Path must match exactly (no partial matches)
  • Case-sensitive matching

Commands

Command Shortcut Description
Search YAML Key Cmd+Shift+Y / Ctrl+Shift+Y Search for exact key path matches
Find & Replace YAML Key Cmd+Shift+H / Ctrl+Shift+H Find and replace key values
Search Selected YAML Key Right-click menu Search for selected text
Find & Replace Selected Key Right-click menu Find and replace selected text

Configuration

File Exclusion Patterns

Configure which files/directories to exclude from searches:

Settings UI:

  1. Open Settings (Cmd+, / Ctrl+,)
  2. Search for "YAML Key Search"
  3. Modify "Exclude Patterns"

settings.json:

{
  "yamlKeySearch.excludePatterns": [
    "**/node_modules/**",
    "**/.git/**",
    "**/target/**",
    "**/build/**",
    "**/dist/**",
    "**/test/**",
    "**/*test*.yml",
    "**/*test*.yaml"
  ],
  "yamlKeySearch.includePatterns": [
    "**/*.yml",
    "**/*.yaml"
  ]
}

Default Exclusions

By default, these directories are excluded:

  • **/node_modules/**
  • **/.git/**
  • **/target/**
  • **/build/**
  • **/dist/**
  • **/out/**
  • **/.vscode/**

Supported File Types

  • .yml files
  • .yaml files

License

MIT


Note: This extension uses exact matching to ensure accuracy. If you need fuzzy search or partial matching, please use VS Code's built-in search functionality.

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