summaryrefslogtreecommitdiff
path: root/bashrc
diff options
context:
space:
mode:
authorJohannes Ranke <johannes.ranke@jrwb.de>2025-10-25 11:13:19 +0200
committerJohannes Ranke <johannes.ranke@jrwb.de>2025-10-25 11:13:19 +0200
commitdd4940ac218890ddd0537af9250470f50eb77099 (patch)
treee6836b87f44413b86cfc1f0d79f23b966ef25a87 /bashrc
parentdf181679b4935848537e6a4ff0197a7973450c8a (diff)
Some changes from the last monthsHEADmain
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc19
1 files changed, 19 insertions, 0 deletions
diff --git a/bashrc b/bashrc
index 01dde1a..eca50d7 100644
--- a/bashrc
+++ b/bashrc
@@ -95,3 +95,22 @@ source /usr/local/bin/virtualenvwrapper.sh
export RETICULATE_PYTHON=/usr/bin/python3
export RETICULATE_AUTOCONFIGURE=FALSE
# }}}
+# ripgrep->fzf->vim [QUERY] from https://junegunn.github.io/fzf/tips/ripgrep-integration/
+rfv() (
+ RELOAD='reload:rg --column --color=always --smart-case {q} || :'
+ OPENER='if [[ $FZF_SELECT_COUNT -eq 0 ]]; then
+ vim {1} +{2} # No selection. Open the current line in Vim.
+ else
+ vim +cw -q {+f} # Build quickfix list for the selected items.
+ fi'
+ fzf --disabled --ansi --multi \
+ --bind "start:$RELOAD" --bind "change:$RELOAD" \
+ --bind "enter:become:$OPENER" \
+ --bind "ctrl-o:execute:$OPENER" \
+ --bind 'alt-a:select-all,alt-d:deselect-all,ctrl-/:toggle-preview' \
+ --delimiter : \
+ --preview 'bat --style=full --color=always --highlight-line {2} {1}' \
+ --preview-window '~4,+{2}+4/3,<80(up)' \
+ --query "$*"
+)
+

Contact - Imprint