diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 652f9be..8e8c66f 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -306,6 +306,18 @@ function ffr --description "Git restore a file using fzf" git restore $argv -- (git ls-files --modified --exclude-standard | fzf -m) end +function grf --description "Search within a file with grep with context" + grep --color=always -C 10 --group-separator="---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" $argv | less -R +end + +function rgf --description "Search within a file with ripgrep" + rg --color always $argv | nvim -R +AnsiEsc +end + +function rgc --description "Search within a file with ripgrep with context" + rg --color always -C 10 --context-separator="---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" $argv | nvim -R +AnsiEsc +end + fzf_key_bindings starship init fish | source