Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tip] the power of fzf and ag and vim #429

Closed
xieyunzi opened this issue Nov 24, 2015 · 2 comments
Closed

[tip] the power of fzf and ag and vim #429

xieyunzi opened this issue Nov 24, 2015 · 2 comments
Labels

Comments

@xieyunzi
Copy link

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

simple but powerful for me 馃槃

@junegunn junegunn added the tip label Nov 27, 2015
@junegunn
Copy link
Owner

Good stuff, thanks :)
It's worth noting that there is a vim plugin that should make the processing slightly simpler.

@srid
Copy link

srid commented Feb 27, 2020

Using ripgrep:

# search.sh
rg --no-heading --no-line-number /your/path/*.md | \
  fzf --tac | \
  awk -F: '{printf "%s", $1}'

Then: nvim $(search.sh).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants