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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new command counsel-fzf #1151

Closed
wants to merge 1 commit into from
Closed

Add new command counsel-fzf #1151

wants to merge 1 commit into from

Conversation

@jojojames
Copy link
Contributor

@jojojames jojojames commented Aug 11, 2017

I have something like this in my exports.

# This can be anything else that can pipe to fzf.
export FZF_DEFAULT_COMMAND='(git ls-files --exclude-standard --others --cached ||
        find . -path "*/\.*" -prune -o -type f -print -o -type l -print |
           sed s/^..//) 2> /dev/null'

Can use this to pull that env in (probably another better way too).

(setenv "FZF_DEFAULT_COMMAND"
        (string-trim (shell-command-to-string ". ~/.zshrc; echo -n $FZF_DEFAULT_COMMAND")))

Along with a fast update time,

  (setq counsel-async-filter-update-time 100000)

provides a pretty good searching experience.

Not too sure about the projectile integration but seemingly reasonable.

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Sep 11, 2017

Sorry for late reaction. Can you explain to me what fzf is and how to install it for Ubuntu?

@jojojames
Copy link
Contributor Author

@jojojames jojojames commented Sep 11, 2017

I use it primarily as a fuzzy file finder but it's better generalized as a fuzzy list filtering tool. Very very fast and accurate (moreso than flx in my opinion).

https://github.com/junegunn/fzf

It's been a while since I installed it on Ubuntu but IIRC I just git cloned it and ran the install script.

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
@agsdot
Copy link

@agsdot agsdot commented Oct 7, 2017

@bling did an implementation in emacs here as well: https://github.com/bling/fzf.el

@Alexander-Shukaev
Copy link

@Alexander-Shukaev Alexander-Shukaev commented Oct 29, 2017

Any plans to merge this?

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Oct 29, 2017

@jojojames I'd like to merge this, but I don't see you on copyright.list. Can you get an Emacs Copyright Assignment?

@jojojames
Copy link
Contributor Author

@jojojames jojojames commented Oct 29, 2017

@abo-abo I have the copyright assignment from a previous pull request with company-mode.

company-mode/company-mode#524

I have the papers somewhere on my computer, not sure how to check that copyright.list you mentioned though.

@abo-abo abo-abo closed this in 8ab8400 Oct 29, 2017
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Oct 29, 2017

@jojojames Thanks. I didn't see you on the list at first, because you used a different email. I suggest you update it to your main one; you can email assign@gnu.org for that, I think.

@jojojames
Copy link
Contributor Author

@jojojames jojojames commented Oct 29, 2017

Cool, will do.

@agsdot
Copy link

@agsdot agsdot commented Oct 29, 2017

👍

@agsdot agsdot mentioned this pull request Oct 31, 2017
@sandric
Copy link

@sandric sandric commented Nov 6, 2017

Just wanted to say thanks to all involved, thats a killer feature, to use fzf inside my emacs I have pretty big config with smth like 8 shell files and it all works inside term mode, hope now I can get rid of it finally!

@Alexander-Shukaev
Copy link

@Alexander-Shukaev Alexander-Shukaev commented Nov 24, 2018

Using either rg or fd (whichever is available):

  (when (zerop (length (getenv "FZF_DEFAULT_COMMAND")))
    (setenv "FZF_DEFAULT_COMMAND"
            (and (executable-find "rg")
                 (concat "rg"
                         " "
                         "--files"
                         " "
                         "--hidden"
                         " "
                         "--no-ignore"
                         " "
                         "--smart-case"
                         " "
                         "--glob"
                         " "
                         "'!.git/*'"))))
  (when (zerop (length (getenv "FZF_DEFAULT_COMMAND")))
    (setenv "FZF_DEFAULT_COMMAND"
            (and (executable-find "fd")
                 (concat "fd"
                         " "
                         "--type"
                         " "
                         "'file'"
                         " "
                         "--hidden"
                         " "
                         "--no-ignore"
                         " "
                         "--ignore-case"
                         " "
                         "--exclude"
                         " "
                         "'.git/*'"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants