From 5290b2291cb45c88e2dda7d9f20f4c8e9c4174fe Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 21 Dec 2015 03:11:28 -0500 Subject: [PATCH] Add fzf config --- bash/fzf | 20 ++++++++++++++++++++ zsh/fzf | 16 ++++++++++++++++ zshrc | 11 +++-------- 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 bash/fzf create mode 100644 zsh/fzf diff --git a/bash/fzf b/bash/fzf new file mode 100644 index 00000000..6f43718b --- /dev/null +++ b/bash/fzf @@ -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" + diff --git a/zsh/fzf b/zsh/fzf new file mode 100644 index 00000000..071c1eb6 --- /dev/null +++ b/zsh/fzf @@ -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" diff --git a/zshrc b/zshrc index 6921e448..600614e5 100644 --- a/zshrc +++ b/zshrc @@ -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