Combine ANSI results with a syntax-highlighted preview.

Section: File and code recipes

Preview ripgrep matches with context

bash
bash
rg --line-number --no-heading --color=always 'auth' | fzf --ansi --delimiter=':' --preview 'bat --color=always --highlight-line {2} {1}'
Explanation

The delimiter lets preview commands reference filename and line number separately.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing File and code recipes
Search with ripgrep then open in Vim
Use ripgrep for content search and fzf for interactive selection.
OpenIn sheetbashsame section
Browse recent commits
Preview commit details while selecting a hash.
OpenIn sheetbashsame section
Find project files with fd and fzf
Use fd as the file source for faster recursive listing.
OpenIn sheetbashsame section
Pick and switch branches
Use fzf to choose a Git branch interactively.
OpenIn sheetbashsame section
Select and kill a process
Pick a process from ps output and send it a signal.
OpenIn sheetbashsame section
Jump to a recent directory
Use a list of tracked directories as an interactive jump menu.