# Code Search & File Tree Browsing Fast, efficient utilities for searching code and browsing file hierarchies. ## Tools Overview ### ripgrep (rg) Ultra-fast grep alternative that respects .gitignore by default. **Common usage:** ```bash rg [] # Search for pattern in files rg -t # Search files of specific type rg --no-ignore # Search ignoring .gitignore rg -w # Match whole word rg -C # Show context lines ``` ### fd Faster, simpler alternative to `find` with better defaults and colorized output. **Common usage:** ```bash fd [] # Find files matching pattern fd -e # Find by extension fd -t f # Find files only fd -t d # Find directories only fd --follow # Follow symlinks ``` ### bat Syntax-highlighting cat with git integration and line numbers. **Common usage:** ```bash bat # View file with syntax highlighting bat --line-range # Show specific line range rg | bat --file-name # Syntax highlight search results ``` ### fzf Fuzzy filtering and pattern matching for command pipelines. **Common usage:** ```bash | fzf --filter # Filter output by pattern (non-interactive) echo -e "file1\nfile2\nfile3" | fzf --filter "file" # Match lines containing "file" rg | fzf --filter # Further filter search results ``` ### tree Display directory structure in tree format. **Common usage:** ```bash tree [] # Show tree structure tree -L [] # Limit depth tree -I '' # Exclude pattern tree -a # Include hidden files ``` ## Common Workflows ### Filter search results by secondary pattern ```bash rg | fzf --filter ``` ### Search code and show context ```bash rg -C 3 ``` ### Search specific file types ```bash rg -t ts # TypeScript files rg -t py # Python files rg -t go # Go files ``` ### List directory tree ```bash tree -L 3 ```