Created
November 29, 2021 09:48
-
-
Save yevgenko/4d099008d89a3443951acfe3e4b58a9e to your computer and use it in GitHub Desktop.
fzp (FuzzyPreview): FuzzyFinder with interactive ripgrep and preview with highlights
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
INITIAL_QUERY="" | |
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case " | |
FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \ | |
fzf --bind "change:reload:$RG_PREFIX {q} || true" \ | |
--ansi --disabled --query "$INITIAL_QUERY" \ | |
--height=50% --layout=reverse \ | |
-m --delimiter : \ | |
--preview "rg {q} --color always --line-number --passthrough {1}" \ | |
--preview-window +{2}-5 \ | |
--bind ctrl-y:preview-half-page-up,ctrl-e:preview-half-page-down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment