loading...

fzf + ag fuzzy grep

matsuikazuto profile image matsuikazuto ・1 min read

In my environment, the vg () function described in the official fzf wiki did not work well.
Specifically, a new file with a line number added opens.

I searched and found this issue.

fag(){
  local line
  line=`ag --nocolor "$1" | fzf` \
    && vim $(cut -d':' -f1 <<< "$line") +$(cut -d':' -f2 <<< "$line")
}    

This function works well. It was very helpful.

Discussion

pic
Editor guide