fish: Add shortcuts for searching with ripgrep within in a file
This is primarily to help us with grepping in gstreamer logs.
This commit is contained in:
parent
a493297cae
commit
a148531d3f
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue