Fast file search extension for VS Code. Rifle through your codebase with dynamic search, regex support, file masking, and full file preview with inline editing.
⭐ Rated 5.0 on VS Code Marketplace | ⬇️ 100+ installs and growing
- Dynamic Search - Results appear as you type (no Find button needed)
- QuickPick Search - A keyboard-first QuickPick search mode with live results, inline filters, and a "Show all results in Rifler" overflow for larger queries
- Search From Selection - Select text in the editor, then open Rifler and it will be used as the initial search query
- Fresh State - Automatically clears search results and state when switching workspaces
- High Performance
- Virtualized Results - Smooth scrolling with 10,000+ results
- Configurable Limit - Adjust max results via
rifler.maxResultssetting - Path Tooltips - Hover truncated paths to see full file path
- Search Duration - Real-time performance metrics displayed with results
- Multiple Scopes
- Project - Search entire workspace
- Module - Search in detected modules (package.json, tsconfig.json, etc.)
- Directory - Search in a specific directory (with editable path)
- File - Search in a specific file (auto-enabled when file is opened from results)
- Search Options
- Match Case - Case-sensitive search
- Words - Match whole words only
- Regex - Use regular expressions
- Usage-Aware (LSP) - Semantic symbol search using Language Server Protocol
- Finds actual symbol references, not just text matches
- Supports References, Definitions, Implementations, and Type Definitions
- Language-aware search (like JetBrains "Find Usages")
- Clear indication when LSP mode is active
- Graceful fallback when language server unavailable
- File Mask - Filter by file patterns (e.g.,
*.ts,*.js)- Supports PyCharm-style include/exclude masks: comma/semicolon separated;
!to exclude. Examples:*.py;main.py, util.py;!*.txt;*.tsx,!*.test.tsx,!*.stories.tsx;*test*.
- Supports PyCharm-style include/exclude masks: comma/semicolon separated;
- Smart Excludes - Toggle to control automatic exclusion of common directories
- ON (default) - Excludes node_modules, .git, dist, build, and other common directories
- OFF - Searches all directories including node_modules (useful for searching dependencies)
- State persists across sessions
- Context Filters - Filter matches by code context (inspired by JetBrains IDEs)
- Code - Include matches in code
- Comments - Include matches in comments
- Strings - Include matches in string literals
- Configure default filters via settings (
rifler.searchContext.*) - Helps avoid false positives in documentation and user-facing strings
- Makes Replace operations safer and more trustworthy
- Search & Replace
- Replace One - Replace current match and move to next
- Replace All - Replace all occurrences in search results
- Undo Support - Full undo support for all replacements
- Full File Preview
- View entire file with all matches highlighted
- Syntax Highlighting - Code highlighting for 50+ languages in both results and preview (powered by highlight.js)
- Click to Edit - Click anywhere in preview to start editing inline
- Auto-save - Changes auto-save as you type
- Responsive Sidebar
- Layout flexes to the default VS Code sidebar width with wrapping controls (no overflow on first open)
- Restores your last search, results, and preview when reopening
- Flexible Panel Location
- Open Rifler in the sidebar, bottom panel, or a separate editor tab via
rifler.panelLocation
- Open Rifler in the sidebar, bottom panel, or a separate editor tab via
- Inline File Editing
- Edit files directly in the preview panel
- Real-time syntax highlighting while editing
- Integrated search & replace within the file
- Line numbers with synchronized scrolling
- Keyboard Navigation
↑/↓- Navigate resultsEnter- Open selected result in editorDouble-click- Open file at clicked lineCmd+Alt+R(Mac) /Ctrl+Alt+R(Windows/Linux) - Open Replace modeAlt+R- Open Replace in File widgetCmd+S/Ctrl+S- Save current file (in edit mode)
Cmd+Shift+F12(Mac) /Ctrl+Shift+F12(Windows/Linux) - Find Usages (LSP)Cmd+Alt+P(Mac) /Ctrl+Alt+P(Windows/Linux) - QuickPick searchCmd+Alt+Y(Mac) /Ctrl+Alt+Y(Windows/Linux) - QuickPick replaceEscape- Exit edit mode or focus search box
- Rifler sends anonymous usage telemetry to improve the extension.
- It follows the global VS Code telemetry setting; disable VS Code telemetry to stop sends.
- Search query text is not sent—only metadata like query length, filters, and result counts.
- A one-time notice appears on first run with a link to view the telemetry output channel.
Press Cmd+Alt+F (Mac) or Ctrl+Alt+F (Windows/Linux) to toggle Rifler open/close.
-
If you have text selected in the editor when you open Rifler, that selection becomes the initial search query (and searches immediately for queries with 2+ characters).
-
By default, Rifler opens in the sidebar (Activity Bar)
-
To change where Rifler opens, set
rifler.panelLocationto one of:"sidebar"(default)"bottom""window"(opens as a separate editor tab)
-
Legacy setting:
rifler.viewMode("sidebar" | "tab") is still supported for backwards compatibility, butrifler.panelLocationis the preferred setting.
- Open Rifler with
Cmd+Alt+F(Mac) orCtrl+Alt+F(Windows/Linux) - Type your search query (results appear dynamically after 2+ characters)
- Toggle search options as needed (Match Case, Words, Regex, Usage-Aware)
- Use File Mask to filter results (e.g.,
*.ts, *.js) - Toggle Smart Excludes (ON by default) to include/exclude common directories like node_modules
- Use Context Filters to search only in code, comments, or strings
- Select scope (Project/Module/Directory)
- Navigate results with arrow keys and preview files
- Click on preview to edit inline, or double-click to open in main editor
Use Rifler: Search in Files (QuickPick) for a lightweight, keyboard-first search flow:
- Press
Cmd+Alt+P(Mac) orCtrl+Alt+P(Windows/Linux) - Type your query (results appear as you type)
- Toggle Match Case, Whole Word, and Regex using the QuickPick buttons
- If results hit the cap, select Show all results in Rifler to open the full panel with the same query
- Press
Enterto open the selected result in the editor
Use Rifler: Replace in Files (QuickPick) for a fast replace flow:
- Run Rifler: Replace in Files (QuickPick) from the Command Palette
- Type your query (results appear as you type)
- Toggle Match Case, Whole Word, and Regex using the QuickPick buttons
- If results hit the cap, select Show all results in Rifler to open the full panel in replace mode
- Select a match, enter replacement text, then choose Replace One or Replace All
Usage-Aware Search uses VS Code's Language Server Protocol to find actual symbol references, not just text matches. This is similar to JetBrains' "Find Usages" feature.
When to use:
- Finding where a function, class, or variable is actually used
- Refactoring with confidence (avoids matching strings or comments with the same name)
- Understanding symbol relationships across files
How to use:
- Open Rifler
- Type the symbol name you want to find (or select text in editor before opening)
- Click the Usage-Aware (LSP) toggle button (device_hub icon)
- Choose the LSP mode:
- Refs - Find all references to the symbol
- Defs - Find definitions of the symbol
- Impl - Find implementations
- Types - Find type definitions
Example:
class User {
name: string; // Definition
}
const user = "name"; // String (not found in LSP)
user.name; // Reference (found in LSP)Text search finds all 3 occurrences. Usage-Aware search finds only the actual field definition and reference.
Note: Results depend on your language server. Dynamic languages may have incomplete results.
Context Filters allow you to search only in specific parts of your code: code, comments, or strings. This helps avoid false positives and makes replacements safer.
How to use:
- Open Rifler
- Click the filter button (tune icon) to show filters
- Toggle the context filters:
- Code (code icon) - Include matches in code
- Comments (comment icon) - Include matches in comments
- Strings (S icon) - Include matches in string literals
Example:
# TODO: rename foo
print("foo")
foo()- With Code only: Finds only
foo() - With Code + Comments: Finds
foo()and the TODO comment - With all filters: Finds all 3 occurrences
Default behavior: You can configure which filters are enabled by default in settings:
rifler.searchContext.includeCode(default: true)rifler.searchContext.includeComments(default: true)rifler.searchContext.includeStrings(default: true)
- Press
Cmd+Alt+R(Mac) orCtrl+Alt+R(Windows/Linux) to open replace mode - Enter replacement text
- Press
Enterto replace current match, orCmd+Enter/Ctrl+Enterto replace all
Click anywhere in the file preview to enter edit mode:
- Edit directly with full syntax highlighting
- Changes auto-save after 1 second of inactivity
- Press
Escapeto exit edit mode - Press
Cmd+S/Ctrl+Sto save immediately
Rifler can open in three locations:
- Sidebar (Default) - Activity Bar sidebar
- Bottom Panel - VS Code panel at the bottom
- Window - A separate editor tab
Configure via your settings.json:
{
"rifler.panelLocation": "sidebar" // or "bottom" or "window"
}Rifler includes the rifler.toggleView command to switch between sidebar and window. There is no default keybinding; bind it via Keyboard Shortcuts by searching for rifler.toggleView.
While editing a file in the preview panel:
- Press
Alt+Ror the configured keybinding (default:Ctrl+Shift+R) to open the replace widget - Use
↑/↓arrows orEnter/Shift+Enterto navigate between matches - Press
Enterto replace current match, orCmd+Enter/Ctrl+Enterto replace all - Press
Escapeor✕to close the replace widget
The keybinding to open the replace widget while editing in the preview can be customized via VS Code settings:
- Open Settings (
Cmd+,on Mac /Ctrl+,on Windows/Linux) - Search for "rifler"
- Change Rifler: Replace In Preview Keybinding to your preferred keybinding
Or add to your settings.json:
{
"rifler.replaceInPreviewKeybinding": "ctrl+shift+r"
}Format: modifier+key (e.g., ctrl+shift+r, cmd+r, alt+h, ctrl+h)
To customize the main Rifler keybindings, open Keyboard Shortcuts (Cmd+K Cmd+S) and search for "rifler":
| Command | Default (Mac) | Default (Windows/Linux) |
|---|---|---|
| Rifler: Toggle Open/Close | Cmd+Alt+F |
Ctrl+Alt+F |
| Rifler: Open Replace Mode | Cmd+Alt+R |
Ctrl+Alt+R |
| Rifler: Find Usages (LSP) | Cmd+Shift+F12 |
Ctrl+Shift+F12 |
| Rifler: Toggle View (sidebar/window) | (not bound by default) | (not bound by default) |
To change where Rifler opens by default, add to your settings.json:
{
"rifler.panelLocation": "sidebar" // or "bottom" or "window"
}Or change it in Settings UI:
- Open Settings (
Cmd+,on Mac /Ctrl+,on Windows/Linux) - Search for "rifler panelLocation"
- Choose either "sidebar", "bottom", or "window"
To change the maximum number of search results, add to your settings.json:
{
"rifler.maxResults": 10000 // default, minimum: 100
}With virtualized rendering, Rifler efficiently handles large result sets without UI lag.
- Download the
.vsixfile - Open VS Code
- Press
Cmd+Shift+P→ "Extensions: Install from VSIX..." - Select the downloaded file
Search for "Rifler" in the VS Code Extensions marketplace.
Rifler uses ripgrep (same engine as VS Code) for fast, async searches.
Recent benchmark on a large monorepo (~112k matches, query "test"):
| Engine | Avg Time | Matches |
|---|---|---|
| Rifler bundled rg | ~0.63s | ~112k |
| VS Code rg | ~0.67s | ~112k |
Max results: 10,000 (configurable). Smaller codebases typically respond in <100ms.
Optimizations:
- 🎯 Smart exclusions (node_modules, .git, binaries, hidden folders)
- 🚀 Early termination at configurable max results (default: 10,000)
- 💾 Memory efficient (skips files > 1MB)
- ⚡ Parallel async I/O with concurrency limiter
- 🖥️ Virtualized results list for smooth scrolling with large result sets
Benchmarks:
- Legacy traversal benchmark:
node benchmark.js [path] - Ripgrep benchmark (current engine):
node ripgrep-benchmark.js [path] [query] [runs]
Run the unit test suite:
npm testGenerate test coverage:
npm run test:coverageRun automated E2E tests that simulate user interactions using the official VS Code testing CLI:
npm run test:e2eWatch E2E tests live (like Selenium browser testing):
npm run test:e2e:visibleThis opens VS Code windows where you can see the tests running in real-time, perfect for debugging and understanding test behavior.
Debug E2E tests with inspector:
npm run test:e2e:debugAnalyze E2E test coverage (feature coverage analysis):
npm run test:e2e:coverageRun combined coverage (unit tests + E2E tests):
npm run test:combined-coverageThe E2E tests automatically:
- Download and launch the specified version of VS Code
- Load your extension in development mode
- Test command registration and execution
- Verify webview panel creation
- Test configuration handling
- Validate search and replace functionality
- Run on Windows, macOS, and Linux via GitHub Actions
Tests are configured using .vscode-test.js for maximum flexibility and CI/CD compatibility.
Tests run automatically on:
- Every push to master/develop branches
- All pull requests
- Multiple operating systems (Windows, macOS, Linux)
View test results and coverage in the Actions tab.
- VS Code 1.85.0 or higher
MIT
If Rifler helps you, a quick ⭐ or review goes a long way 🙏