Shell script tool to use peco
without keymap or alias.
For all peco
lovers.
Many commands can be generated simply by selecting three items(scope, target, and action) via peco
.
For example, you can change directory to a git repository using ghq
.
Other example, you can select a process via peco
and kill it.
You can also use docker command (ex.docker top) to docker container
i.e. if you select scope, target, and action via peco
according to your purpose, then the command is generated automaically. The scenario is predefined by the shell script in pecorian.d/*.sh
.
Purpose | Scope | Target | Action | Command ex. |
---|---|---|---|---|
cd after selecting repository via ghq |
Git repository(ghq) | repository | cd | cd repository |
kill running process | Process | PID | kill | kill PID |
show top on a docker container | Docker a container | container | top | docker top ID |
show log on docker-compose | Docker containers/images | container managed by Compose | logs | docker-compose logs -tf |
select file and vi | Current dir | file | vi | vi file |
Many other commands can be created.
- Support bash and zsh
- Multi platform for some commands
- Special keymap is defined for frequently used scenario
Ctrl + r
: search historyCtrl + h
: search change directory
- Item list is depends on the context. For example, if docker is not installed, docker scope is not shown in the list.
- Install peco.
apt install peco
- Copy
.pecorian.sh
to any directory. - Run source command. For example.
source ~/.pecorian.sh
$ go get github.com/kenji0x02/pecorian
$ echo 'source $GOPATH/src/github.com/kenji0x02/pecorian/.bashrc.pecorian' >> ~/.bashrc
$ go get github.com/kenji0x02/pecorian
$ echo 'source $GOPATH/src/github.com/kenji0x02/pecorian/.zshrc.pecorian' >> ~/.zshrc
After installation, Ctrl + j
to start pecorian.
- peco>=0.4.8
- Error handling when docker is not installed in WSL2
- Add operations to Git repository