Skip to content
Discussion options

You must be logged in to vote

You can re-define the cd function AFTER you source the shell key-bindings.
For example, for bash you can just redirect the output to /dev/null:

__fzf_cd__() {
  local dir
  dir=$(
    FZF_DEFAULT_COMMAND=${FZF_ALT_C_COMMAND:-} \
    FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --walker=dir,follow,hidden --scheme=path" "${FZF_ALT_C_OPTS-} +m") \
    FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd)
  ) && printf 'builtin cd -- %q' "$(builtin unset CDPATH && builtin cd -- "$dir" && builtin pwd)" >/dev/null
}

Source: https://github.com/junegunn/fzf/blob/master/shell/key-bindings.bash#L72

EDIT: for zsh it is more involved, this seems to work:

fzf-cd-widget() {
  setopt localoptions pipefail no_aliases 2>

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@omnigenous
Comment options

@moritzdietz
Comment options

@moritzdietz
Comment options

@moritzdietz
Comment options

Answer selected by omnigenous
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants