Skip to content
No description, website, or topics provided.
Perl
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
README.md
choco.pl

README.md

NAME

choco - Move around directories and files intuitively.

DESCRIPTION

直感的な操作でファイル/ディレクトリを操作します。

DEMO

move by peco

choco_peco

move by cho

choco_cho

Installation

  1. Download a repository or the script choco.pl.

  2. 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"
}
  1. 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"

REQUIREMENT

LICENSE

Copyright (C) Hiroaki Kadomatsu.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Hiroaki Kadomatsu (@note103)

You can’t perform that action at this time.