Mac 装机

Mac 配置 Quick Move Folder

2020-08-16  本文已影响0人  wealon

把如下配置放入 ~/.zshrc 或你正在用的zsh文件中

#quick move folder setting
export MARKPATH=$HOME/.marks
function go {
        cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}
function mark {
        mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}
function unmark {
        rm -i "$MARKPATH/$1"
}
function marks {
        \ls -l "$MARKPATH" | tail -n +2 | sed 's/  / /g' | cut -d' ' -f9- | awk -F ' -> ' '{printf "%-10s -> %s\n", $1, $2}'
}

function _completemarks {
      reply=($(ls $MARKPATH))
}

compctl -K _completemarks go
compctl -K _completemarks unmark
上一篇下一篇

猜你喜欢

热点阅读