Fzf: can't find dot files?

Created on 6 Aug 2016  路  11Comments  路  Source: junegunn/fzf

  • Category

    • [x] fzf binary

    • [x] fzf-tmux script

    • [ ] Key bindings

    • [ ] Completion

    • [ ] Vim

    • [ ] Neovim

    • [ ] Etc.

  • OS

    • [x] Linux

    • [ ] Mac OS X

    • [ ] Windows

    • [ ] Etc.

  • Shell

    • [x] bash

    • [ ] zsh

    • [ ] fish

I can't find any dot files as .vimrc, .bashrc. Is it supported?

2016-08-06-175459_1920x1080_scrot

question

Most helpful comment

The default commands fzf uses do not include hidden files. If you want hidden files in the list, you have to define your own $FZF_DEFAULT_COMMAND or $FZF_CTRL_T_COMMAND depending on the context.

For example:

export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'

All 11 comments

The default commands fzf uses do not include hidden files. If you want hidden files in the list, you have to define your own $FZF_DEFAULT_COMMAND or $FZF_CTRL_T_COMMAND depending on the context.

For example:

export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'

When I try export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""' fzf stops working in bash shell and lists no files at all (not only dot files, but nothing at all) but it works as expected in vim. I modified the default command and tried export FZF_DEFAULT_COMMAND="find . -path '*/\.*' -type d -prune -o -type f -print -o -type l -print 2> /dev/null | sed s/^..//" and fzf worked as expected both in bash and in vim. I guess this is related to how ag generates its output?

@nimamo Have you checked the command itself (ag --hidden --ignore .git -g "") works in bash?

@junegunn Yes and it works as expected.

@nimamo How about ag --hidden --ignore .git -g "" | cat? If it fails, upgrade ag.

@junegunn This command works. I tried the same procedure ( export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""' ) on a different Linux installation and it just worked fine. This doesn't seem to be a bug in fzf, yet seeing different results from fzf in bash and :FZF in Vim is worth noticing.

@nimamo Please make sure you have the latest version of ag installed. Probably related: #573

The command to use rg (ripgrep) instead of ag (the_silver_searcher):

export FZF_DEFAULT_COMMAND='rg --hidden --no-ignore -l ""'

I get the following [Command failed: ag --hidden --ignore .git -g ""] even though I do have ag installed

See if $SHELL -c 'ag --hidden --ignore .git -g ""' works on you shell because that's what fzf does.

A faster command for ripgrep is

export FZF_DEFAULT_COMMAND='rg --hidden --no-ignore --files'

which does not search the content of files.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

firedev picture firedev  路  3Comments

ahmedelgabri picture ahmedelgabri  路  3Comments

jberglinds picture jberglinds  路  3Comments

ghost picture ghost  路  3Comments

aleclarson picture aleclarson  路  3Comments