Coder Social home page Coder Social logo

Comments (7)

junegunn avatar junegunn commented on August 15, 2024

ag -l -g "" only returns the list of files, not including directories. That was the main reason why CTRL-T was coded to use find command. So this leaves me with a question. I agree that making the command configurable is preferable, but should we use the same FZF_DEFAULT_COMMAND for CTRL-T as well? Should we introduce another env variable? At first I assumed that a user would edit fzf.bash or zsh file after the installation (e.g. use different key binding, CTRL-XT instead of CTRL-T, etc.), but I guess very few actually do that. What do you think we should do about this?

from fzf.

junegunn avatar junegunn commented on August 15, 2024

Simply put, the problem is the inconsistency between fzf command and CTRL-T key binding:

  • fzf w/o FZF_DEFAULT_COMMAND: list of files
  • CTRL-T: list of files and directories

from fzf.

stephenh avatar stephenh commented on August 15, 2024

At first I assumed that a user would edit fzf.bash or zsh file after the installation

Yes, this is what I ended up doing. :-)

That said, you're right, after filing this issue I realized that ag only lists files, and not directories. That doesn't seem ideal.

Here is an issue for adding that to ag:

ggreer/the_silver_searcher#215

But the ag issue tracker is pretty full, so I don't get the impression it will be implemented anytime soon.

Perhaps the easiest thing for now would be to explicitly document that FZF_DEFAULT_COMMAND only applies to explicit fzf invocations, and not to Ctrl-T, due to this ag issue.

That is too bad though, as ag respecting .gitignore/etc. is awfully useful.

from fzf.

junegunn avatar junegunn commented on August 15, 2024

I've checked other similar projects, ack and pt, but they all show the same behavior, which is quite understandable since their main responsibility is to search for pattern in file contents and not to display the list of files and directories. I actually found something relevant called friendly-find but unfortunately it seems to be much slower than vanilla find. I'll let you know if I find a better alternative.

And I updated the doc to encourage customization of the generated scripts.

from fzf.

junegunn avatar junegunn commented on August 15, 2024

You might want to check out this small wrapper script I wrote which extends the output of ag -g "" to print the directories as well. The overhead is negligible.

from fzf.

jez avatar jez commented on August 15, 2024

It'd be awesome if you added documentation for this variable at https://github.com/junegunn/fzf/blob/master/README.md#respecting-gitignore-hgignore-and-svnignore

Didn't realize this was a feature until I found this issue.

from fzf.

junegunn avatar junegunn commented on August 15, 2024

@jez Will do, thanks.

from fzf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.