Skip to content

Commit

Permalink
git-fzf, gh-fzf: highlight grep matches in bold black on yellow bg
Browse files Browse the repository at this point in the history
  • Loading branch information
mgnsk committed Jan 7, 2025
1 parent c2f6fdd commit caa7f25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bin/gh-fzf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ function highlight {
# shellcheck disable=SC2001
query=$(echo "$1" | sed "s/\s\+/|/g")

# Bold black on yellow background.
export GREP_COLORS='ms=1;30;103'

grep --color=always --perl-regexp -i "$query$grepsuffix"
}

Expand Down
3 changes: 3 additions & 0 deletions .bin/git-fzf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ trap cleanup EXIT
function highlight {
grepsuffix=$(cat "$tmpdir/grep_suffix")

# Bold black on yellow background.
export GREP_COLORS='ms=1;30;103'

grep --color=always --perl-regexp -i "$1$grepsuffix"
}

Expand Down

0 comments on commit caa7f25

Please sign in to comment.