choco - Move around directories and files intuitively.
直感的な操作でファイル/ディレクトリを操作します。
-
Download a repository or the script
choco.pl. -
Edit .bashrc
function choco {
local path=$(perl /path/to/choco/choco.pl $@)
local basename=${path##*/}
local dirname=""
if [ -f "$path" ]; then
dirname="${path%%$basename}"
elif [ -d "$path" ]; then
dirname="$path"
fi
cd "$dirname"
}- Add alias (example)
# use peco
alias j=choco
alias ja="choco -a"
# use cho
alias s="choco -s cho"
alias sa="choco -s cho -a"
# use peco & open target file
## `open` command is for Mac only.
alias jo="choco -c open"
alias jao="choco -a -c open"Copyright (C) Hiroaki Kadomatsu.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Hiroaki Kadomatsu (@note103)

