add fasd config/init
This commit is contained in:
parent
a772e6b180
commit
8bf2a9bcdb
25
fasd.zsh
Normal file
25
fasd.zsh
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# @author Sebastian Tramp <mail@sebastian.tramp.name>
|
||||||
|
# @license http://opensource.org/licenses/gpl-license.php
|
||||||
|
#
|
||||||
|
# fasd integration
|
||||||
|
# https://github.com/clvv/fasd
|
||||||
|
#
|
||||||
|
|
||||||
|
# init fasd, the autojump successor
|
||||||
|
#eval "$(fasd --init auto)"
|
||||||
|
eval "$(fasd --init zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install)"
|
||||||
|
|
||||||
|
# fasd_cd + outputs directory
|
||||||
|
fasd_cd() {
|
||||||
|
if [ $# -le 1 ]; then
|
||||||
|
fasd "$@"
|
||||||
|
else
|
||||||
|
local _fasd_ret="$(fasd -e 'printf %s' "$@")"
|
||||||
|
[ -z "$_fasd_ret" ] && return
|
||||||
|
[ -d "$_fasd_ret" ] && print "$_fasd_ret" && cd "$_fasd_ret" || printf %s\n "$_fasd_ret"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# as an autojump user, i need only this for now
|
||||||
|
alias j=' fasd_cd -d'
|
||||||
|
|
5
zshrc
5
zshrc
|
@ -32,9 +32,14 @@ sources+="$ZSH_CONFIG/private.zsh"
|
||||||
# completion config needs to be after system and private config
|
# completion config needs to be after system and private config
|
||||||
sources+="$ZSH_CONFIG/completion.zsh"
|
sources+="$ZSH_CONFIG/completion.zsh"
|
||||||
|
|
||||||
|
# fasd integration and config
|
||||||
|
sources+="$ZSH_CONFIG/fasd.zsh"
|
||||||
|
|
||||||
# Private aliases and adoptions added at the very end (e.g. to start byuobu)
|
# Private aliases and adoptions added at the very end (e.g. to start byuobu)
|
||||||
sources+="$ZSH_CONFIG/private.final.zsh"
|
sources+="$ZSH_CONFIG/private.final.zsh"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# try to include all sources
|
# try to include all sources
|
||||||
foreach file (`echo $sources`)
|
foreach file (`echo $sources`)
|
||||||
if [[ -a $file ]]; then
|
if [[ -a $file ]]; then
|
||||||
|
|
Loading…
Reference in a new issue