π Glimpse - Interactive Code Search
A lightning-fast, beautiful terminal-based code search tool with real-time results and instant editor integration.
β¨ Features
-
π Real-time Search - Results update as you type
-
π¨ Beautiful TUI - Modern, colorful interface with split-pane layout
-
β‘ Lightning Fast - Optimized search with smart file filtering
-
π― Instant Editor Integration - Press Enter to open files in VS Code, Vim, or your preferred editor
-
π± Responsive Design - Clean, compact interface that works in any terminal size
-
π§ Smart Filtering - Automatically skips binary files and build directories
-
β¨οΈ Vim-like Navigation - Use ctrl+j/ctrl+k or arrow keys for navigation
-
π€ Case Toggle - Ctrl+I to switch between case-sensitive and case-insensitive search
-
π§Ή Auto-cleanup - Clears terminal after use for a clean workspace
heavily inspired by https://github.com/nvim-telescope/telescope.nvim
π― Why Glimpse?
Traditional tools like grep and find are powerful but:
- β Results are static and hard to navigate
- β No preview of file contents
- β Require complex command syntax
- β Don't integrate with modern editors
Glimpse solves this with:
- β
Interactive, real-time search
- β
File preview with syntax context
- β
One-key editor opening
- β
Beautiful, intuitive interface
π Installation
Prerequisites
Install from source
git clone https://github.com/pixelknightdev/Glimpse.git
cd glimpse
go build -o glimpse cmd/main.go
cp glimpse $(go env GOPATH)/bin/
Install directly
go install github.com/pixelknightdev/Glimpse/cmd/gimpse@latest
π Usage
Interactive Mode (Default)
# Launch interactive search
glimpse
# Then:
# - Type to search in real-time
# - Use β/β or ctrl+j/ctrl+k to navigate results
# - Press Enter to open file in editor
# - Press ctrl+c to quit
CLI Mode
# Traditional grep-like output
glimpse --cli "search term"
# Case-insensitive search
glimpse --cli -i "search term"
β¨οΈ Keyboard Controls
| Key |
Action |
Type |
Search in real-time |
β/β or ctrl+j/ctrl+k |
Navigate through results |
Enter |
Open selected file in editor |
Ctrl+I |
Toggle case sensitivity |
Ctrl+C |
Quit |
π¨ Video demo
https://github.com/user-attachments/assets/48c9256d-5faf-45b8-b541-4ab7fbe473a3
π Technical Details
Architecture
glimpse/
βββ cmd/main.go # CLI interface and mode routing
βββ internal/
β βββ search/ # Core search engine
β β βββ search.go # File traversal and pattern matching
β βββ tui/ # Terminal user interface
β βββ model.go # Bubbletea TUI implementation
β βββ editor.go # Cross-platform editor integration
βββ go.mod # Dependencies
βββ README.md
- Concurrent file processing with goroutines
- Smart binary file detection by extension and content
- Result limiting to prevent memory issues
- Directory exclusion for common build/cache folders
- Early termination when sufficient results found
Supported Editors
- VS Code (
code command)
- Vim/Neovim
- System default editor
- Cross-platform support (macOS, Linux, Windows)
π― Use Cases
- π Code exploration - Quickly find function definitions, imports, or patterns
- π Debugging - Locate error messages, variable usages, or specific logic
- π Learning codebases - Navigate unfamiliar projects with ease
- π§ Refactoring - Find all instances of code that needs updating
- π Documentation - Search for comments, TODOs, or documentation strings
π€ Contributing
We welcome contributions! Here are some ways to help:
- π Bug Reports - Found an issue? Open a GitHub issue
- π‘ Feature Requests - Have an idea? Let's discuss it
- π Code Contributions - Submit a pull request
- π Documentation - Help improve our docs
- π Spread the word - Star the repo and share with others
Development Setup
git clone https://github.com/pixelknightdev/Glimpse.git
cd glimpse
go mod tidy
go run cmd/main.go
π Roadmap
- π¦ Package managers - Homebrew, apt, chocolatey
- π¨ Themes - Customizable color schemes
- π§ Config files - User preferences and settings
- π Regex support - Advanced pattern matching
- π File filtering - Include/exclude by file type
- π Git integration - Search only modified files
- πΎ Search history - Remember recent searches
- π Fuzzy search - More flexible matching
π Comparison
| Tool |
Real-time |
Interactive |
Editor Integration |
Preview |
Performance |
| Glimpse |
β
|
β
|
β
|
β
|
β‘ |
| grep |
β |
β |
β |
β |
β‘ |
| ripgrep |
β |
β |
β |
β |
β‘β‘ |
| fzf |
β |
β
|
β οΈ |
β |
β‘ |
| VS Code Search |
β |
β
|
β
|
β
|
π |
π Acknowledgments
Built with these amazing tools:
π License
MIT License - see LICENSE file for details.
π Star History
