Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (38 sloc) 1.07 KB
#!/usr/bin/env bash
# `.external` handles all external tools.
#
# This file is used as a part of `.shell_env`
# === Autocomplete ===
source <(npm completion) # adds normal autocomplete to `npm` commands
# === fzf ===
# https://github.com/junegunn/fzf
if [[ ! "$PATH" == */usr/local/opt/fzf/bin* ]]; then
export PATH="$PATH:/usr/local/opt/fzf/bin"
fi
# Auto-completion
[[ $- == *i* ]] && source "/usr/local/opt/fzf/shell/completion.zsh" 2> /dev/null
# Key bindings
source "/usr/local/opt/fzf/shell/key-bindings.zsh"
# Setting ag as the default source for fzf
export FZF_DEFAULT_COMMAND='ag -g ""'
# To apply the command to CTRL-T as well
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
_fzf_compgen_path() {
ag -g "" "$1"
}
# === z ===
# https://github.com/rupa/z
source "/usr/local/etc/profile.d/z.sh"
# === nnn ===
# https://github.com/jarun/nnn
export NNN_TMPFILE="/tmp/nnn"
export NNN_SHOW_HIDDEN=1
export NNN_USE_EDITOR=1
export DISABLE_FILE_OPEN_ON_NAV=1
n() {
nnn "$@"
if [ -f "$NNN_TMPFILE" ]; then
source "$NNN_TMPFILE"
rm -f "$NNN_TMPFILE"
fi
}