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

FZF_COMPLETION_TRIGGER doesn't use FZF_DEFAULT_COMMAND as input #406

Closed
thomcom opened this issue Nov 4, 2015 · 5 comments
Closed

FZF_COMPLETION_TRIGGER doesn't use FZF_DEFAULT_COMMAND as input #406

thomcom opened this issue Nov 4, 2015 · 5 comments

Comments

@thomcom
Copy link

thomcom commented Nov 4, 2015

I've updated my FZF_DEFAULT_COMMAND='ag -g ""' in order to respect .gitignore. It works fine using CTRL-T, but if I use **<TAB> completion, I still see node_modules. How do I use ag -g "" with FZF_COMPLETION_TRIGGER?

@junegunn
Copy link
Owner

junegunn commented Nov 5, 2015

Unfortunately it's not configurable at the moment. ag -g "" is not an ideal command since it does not list the names of directories. If you see the source code of fuzzy completion, you'll notice that the command used is context-dependent (e.g. rmdir ** will only give the list of directories). And I haven't decided how to make them configurable. Currently you'll have to copy and edit the code directly.

@thomcom
Copy link
Author

thomcom commented Nov 5, 2015

Ok, thanks! That explained it clearly enough that it was easy to add locally. I see why you haven't decided how to configure it yet! :)

@junegunn
Copy link
Owner

junegunn commented Nov 5, 2015

Alright, I'll close this for now.

@junegunn junegunn closed this as completed Nov 5, 2015
junegunn added a commit that referenced this issue Jan 19, 2016
Notes:
- You can now override _fzf_compgen_path and _fzf_compgen_dir functions
  to use custom commands such as ag instead of find for listing
  completion candidates.
    - The first argument is the base path to start traversal
- Removed file-only completion in bash, i.e. _fzf_file_completion.
  Maintaining a list of commands that only expect files, not
  directories, is cumbersome (there are too many) and error-prone.

TBD:
- Added $FZF_COMPLETION_DIR_COMMANDS to customize the list of commands
  which use directory-only completion. The default is "cd pushd rmdir".
  Not sure if it's the best approach to address the requirement, I'll
  leave it as an undocumented feature.

Related: #406 (@thomcom), #456 (@frizinak)
@jasonkuhrt
Copy link

jasonkuhrt commented Oct 21, 2016

I just encountered this issue too. Would be nice to have a solution. Using fzf to navigate from high-level folders (e.g. /projects) is nifty but unusable without ignoring git ignored files. Maybe this should be opened and closed only once an interface for configuration has been designed?

Most of all though thanks for fzf!!

@junegunn
Copy link
Owner

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

No branches or pull requests

3 participants