
# Rifler
Fast file search extension for VS Code. Rifle through your codebase with dynamic search, regex support, file masking, and full file preview.
Features
- Dynamic Search - Results appear as you type (no Find button needed)
- 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)
- Search Options
- Match Case - Case-sensitive search
- Words - Match whole words only
- Regex - Use regular expressions
- File Mask - Filter by file patterns (e.g.,
*.ts, *.js, *.py)
- 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
- Keyboard Navigation
↑/↓ - Navigate results
Enter - Open selected result
Option+Shift+F (Mac) / Alt+Shift+F - Toggle Replace mode
Escape - Focus search box
Usage
- Press
Cmd+Shift+F (Mac) or Ctrl+Shift+F (Windows/Linux)
- Type your search query
- Toggle search options as needed
- Select scope (Project/Module/Directory)
- Navigate results and preview files
Replace
- Press
Option+Shift+F (Mac) or Alt+Shift+F (Windows/Linux) to toggle replace mode
- Enter replacement text
- Press
Enter to replace current match, or Cmd+Enter to replace all
Installation
From VSIX
- Download the
.vsix file
- Open VS Code
- Press
Cmd+Shift+P → "Extensions: Install from VSIX..."
- Select the downloaded file
From Marketplace
Search for "Rifler" in the VS Code Extensions marketplace.
Benchmark results on a typical codebase:
| Scenario |
Matches |
Time |
| Search for "function" keyword |
34 |
5ms |
| Search for import statements |
3 |
6ms |
| Search for "if" keyword |
66 |
3ms |
| Search for variable declarations |
115 |
4ms |
Average search time: 5ms | Max results: 5000
Comparison with Native VS Code Search
| Tool |
Average Search Time |
Notes |
| Rifler |
~5ms |
Direct filesystem search, optimized for speed |
| VS Code Native |
~50-200ms |
Uses ripgrep, more features but slower |
| grep |
~36ms |
Command-line baseline |
Why Rifler is faster:
- ⚡ Direct filesystem access (no process spawning)
- 🎯 Smart exclusions (node_modules, .git, binaries)
- 🚀 Early termination at 5000 results
- 💾 Memory efficient (1MB file size limit)
Run node benchmark.js in your own project to test performance
Requirements
License
MIT
| |