浏览代码

fix(fzf): consistently ignore .git directory in `FZF_DEFAULT_COMMAND` (#9421)

Be consistent and ignore contents of `.git` directory no matter how FZF_DEFAULT_COMMAND is set.
Elyézer Rezende 4 年之前
父节点
当前提交
fa780867d9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins/fzf/fzf.plugin.zsh

+ 2 - 2
plugins/fzf/fzf.plugin.zsh

@@ -154,10 +154,10 @@ unset -f setup_using_opensuse_package setup_using_debian_package setup_using_bas
 
 
 if [[ -z "$FZF_DEFAULT_COMMAND" ]]; then
 if [[ -z "$FZF_DEFAULT_COMMAND" ]]; then
     if (( $+commands[rg] )); then
     if (( $+commands[rg] )); then
-        export FZF_DEFAULT_COMMAND='rg --files --hidden'
+        export FZF_DEFAULT_COMMAND='rg --files --hidden --glob "!.git/*"'
     elif (( $+commands[fd] )); then
     elif (( $+commands[fd] )); then
         export FZF_DEFAULT_COMMAND='fd --type f --hidden --exclude .git'
         export FZF_DEFAULT_COMMAND='fd --type f --hidden --exclude .git'
     elif (( $+commands[ag] )); then
     elif (( $+commands[ag] )); then
-        export FZF_DEFAULT_COMMAND='ag -l --hidden -g ""'
+        export FZF_DEFAULT_COMMAND='ag -l --hidden -g "" --ignore .git'
     fi
     fi
 fi
 fi