Use site-functions directory for all zsh plugins

This commit is contained in:
Eric Torres
2019-03-01 15:59:17 -08:00
parent fc101fb30b
commit 13257f07e6
10 changed files with 55 additions and 24 deletions

33
zsh/_fuzzy_cd Normal file
View File

@@ -0,0 +1,33 @@
#compdef fcd
# Fuzzy cd from anywhere
# Dependencies
# * fzf
# * mlocate
# ========== Shortcuts ==========
cf() {
[[ -z "${*}" ]] && return 1
[[ ! -x /usr/bin/fzf ]] && return 1
dir="$(locate --all --ignore-case --null -- "${@}" | fzf --read0 --select-1 --exit-0)"
[[ -z "${dir}" ]] && return 1
if [[ -f "${dir}" ]]; then
cd "${dir%/*}"
else
cd "${dir}"
fi
}
autoload -Uz cf
# ========== Completions ==========
local arguments
arguments=(
$argument_list
'*:filename:_files'
)
_arguments -s $arguments