update with a few tweaks

- Use `$HOMEBREW_PREFIX` since it's already there
- Don't `chruby ruby` automatically since it messes with `$PATH`
- Try using fzf's builtins
Alpha Chen 3 years ago
parent dc7c6a64c5
commit 118d08f67d

@ -35,23 +35,13 @@ alias tmux="direnv exec / tmux"
function eject { command hdiutil eject `df | grep Volumes | grep -i "$@" | ruby -ne 'puts $_[/^[^ ]*/]'`; } function eject { command hdiutil eject `df | grep Volumes | grep -i "$@" | ruby -ne 'puts $_[/^[^ ]*/]'`; }
if [ -e /opt/homebrew/bin/brew ]; then eval "$($HOMEBREW_PREFIX/bin/brew shellenv)"
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
if [ -e /usr/local/bin/brew ]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
brew_prefix=$(brew --prefix)
if [ $commands[chruby] ]; then
chruby ruby
fi
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
if [ -e $brew_prefix/opt/fzf/shell/completion.zsh ]; then if [ -e $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh ]; then
source $brew_prefix/opt/fzf/shell/key-bindings.zsh source $HOMEBREW_PREFIX/opt/fzf/shell/key-bindings.zsh
source $brew_prefix/opt/fzf/shell/completion.zsh source $HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh
fi fi
[ -x "$(command -v kubectl)" ] && source <(kubectl completion zsh) [ -x "$(command -v kubectl)" ] && source <(kubectl completion zsh)
@ -62,9 +52,9 @@ fi
if [ $commands[fzf] ]; then if [ $commands[fzf] ]; then
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border' export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
export FZF_DEFAULT_COMMAND="rg --files" # export FZF_DEFAULT_COMMAND="rg"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" # export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="find . -type d" # export FZF_ALT_C_COMMAND="find . -type d"
# alias fzf=fzf-tmux # alias fzf=fzf-tmux
# https://github.com/junegunn/fzf/issues/164#issuecomment-581837757 # https://github.com/junegunn/fzf/issues/164#issuecomment-581837757

Loading…
Cancel
Save