Add fzf config

This commit is contained in:
Henrik Lissner 2015-12-21 03:11:28 -05:00
parent f2294ab3f0
commit 5290b2291c
3 changed files with 39 additions and 8 deletions

20
bash/fzf Normal file
View file

@ -0,0 +1,20 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == */usr/local/opt/fzf/bin* ]]; then
export PATH="$PATH:/usr/local/opt/fzf/bin"
fi
# Man path
# --------
if [[ ! "$MANPATH" == */usr/local/opt/fzf/man* && -d "/usr/local/opt/fzf/man" ]]; then
export MANPATH="$MANPATH:/usr/local/opt/fzf/man"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/usr/local/opt/fzf/shell/completion.bash" 2> /dev/null
# Key bindings
# ------------
source "/usr/local/opt/fzf/shell/key-bindings.bash"

16
zsh/fzf Normal file
View file

@ -0,0 +1,16 @@
local fzf_path="/usr/local/opt/fzf"
export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_DEFAULT_OPTS='--reverse --inline-info'
if [[ ! "$PATH" == *$fzf_path/bin* ]]; then
export PATH="$PATH:$fzf_path/bin"
fi
if [[ ! "$MANPATH" == *$fzf_path/man* && -d "$fzf_path/man" ]]; then
export MANPATH="$MANPATH:$fzf_path/man"
fi
is-interactive && source "$fzf_path/shell/completion.zsh" 2> /dev/null
source "$fzf_path/shell/key-bindings.zsh"

11
zshrc
View file

@ -19,22 +19,17 @@ if ! zgen saved; then
zgen load hlissner/zsh-autopair "autopair.zsh"
zgen load zsh-users/zsh-history-substring-search
is-ssh || zgen load zsh-users/zsh-syntax-highlighting
zgen load zsh-users/zsh-completions src
is-ssh || zgen load zsh-users/zsh-syntax-highlighting
zgen save
fi
cache rbenv init - --no-rehash
cache pyenv init - --no-rehash
if is-interactive; then
cache fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install
export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_DEFAULT_OPTS='--reverse --inline-info'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
fi
is-interactive && cache fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install
iload zsh/fzf
load zsh/config
iload zsh/keybinds
iload zsh/prompt