summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--zsh/.config/zsh/.zshrc14
1 files changed, 14 insertions, 0 deletions
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc
index 32cc41b..36c6c64 100644
--- a/zsh/.config/zsh/.zshrc
+++ b/zsh/.config/zsh/.zshrc
@@ -67,5 +67,19 @@ command -v fd >/dev/null 2&>1 && _fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}
+command -v rga >/dev/null 2&>1 && rgi() {
+ RG_PREFIX="rga --files-with-matches"
+ local file
+ file="$(
+ FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \
+ fzf --sort --preview="[[ ! -z {} ]] && rga --pretty --context 5 {q} {}" \
+ --phony -q "$1" \
+ --bind "change:reload:$RG_PREFIX {q}" \
+ --preview-window="70%:wrap"
+ )" &&
+ echo "opening $file" &&
+ xdg-open "$file"
+}
+
command -v starship >/dev/null 2&>1 && source <(starship init zsh)
command -v sheldon >/dev/null 2&>1 && source <(sheldon source)