Skip to content

Commit

Permalink
Set global fd default options
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Aug 23, 2024
1 parent 7502fa2 commit e0356d3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions dotfiles/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,18 @@ fpath=( ~/.zfunc "${fpath[@]}" )
# See: https://github.com/Aloxaf/fzf-tab/issues/61
zpcompinit; zpcdreplay

# Configure fzf and its Zsh integration.
# Source: https://mike.place/2017/fzf-fd/
export FZF_DEFAULT_COMMAND="fd --one-file-system --type f --hidden . $HOME"
# Default options for fd, a faster find.
# XXX Replace FD_DEFAULTS with proper standard envvar in the future: https://github.com/sharkdp/fd/issues/362
export FD_DEFAULTS="--one-file-system --follow --unrestricted --exclude .git --exclude node_modules"
alias fd="fd $FD_DEFAULTS"

# Configure fzf and its Zsh integration. Sources:
# https://github.com/sharkdp/fd?tab=readme-ov-file#using-fd-with-fzf
# https://github.com/junegunn/fzf?tab=readme-ov-file#respecting-gitignore
export FZF_DEFAULT_COMMAND="fd $FD_DEFAULTS --type file"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --one-file-system --type d --hidden --exclude .git . $HOME"
export FZF_ALT_C_COMMAND="fd $FD_DEFAULTS --type directory"
export FZF_DEFAULT_OPTS="--ansi"
zinit light Aloxaf/fzf-tab

zinit light zdharma-continuum/fast-syntax-highlighting
Expand Down Expand Up @@ -294,9 +301,6 @@ find() {
} 3>&2 2>&1
}

# Default options for fd, a faster find.
alias fd='fd --one-file-system --hidden'

# Extract most know archives with one command
extract () {
if [ -f "$1" ]; then
Expand Down

0 comments on commit e0356d3

Please sign in to comment.