mirror of
https://github.com/jimeh/zsh-peco-history.git
synced 2026-02-19 05:36:38 +00:00
1b3a8549450abdd545dad3d7c8a4c956719a78e4
zsh-peco-history
Search shell history with peco when pressing ctrl+r.
Based on zsh-history-search snippet from percol.
Usage
- Press ctrl+r while in a zsh shell and it should load up peco with your shell's history.
- Start typing to filter history down.
- Press enter/return to pick a command from history.
Requirements
Installation
Manual
-
Clone this repo to your machine. This guide uses
~/.zsh/zsh-peco-history:git clone https://github.com/jimeh/zsh-peco-history.git ~/.zsh/zsh-peco-history -
Add the following to your
.zshrc:source ~/.zsh/zsh-peco-history/zsh-peco-history.zsh -
Start a new terminal session.
Zplug
-
Add a zplug definition for zsh-peco-history to your
.zshrc:zplug "jimeh/zsh-peco-history" -
Start a new terminal session.
Antigen
-
Add a antigen bundle definition for zsh-peco-history to your
.zshrc:antigen bundle jimeh/zsh-peco-history -
Start a new terminal session.
Oh My Zsh
-
Clone this repository into
$ZSH_CUSTOM/plugins(by default~/.oh-my-zsh/custom/plugins)git clone https://github.com/jimeh/zsh-peco-history.git $ZSH_CUSTOM/plugins/zsh-peco-history -
Add the plugin to the list of plugins for Oh My Zsh to load:
plugins=(zsh-peco-history) -
Start a new terminal session.
Recommended Peco Config
You don't have to use this config, it's simply what I personally use. So here's
what my ~/.peco/config.json file looks like:
{
"Keymap": {
"M-v": "peco.ScrollPageUp",
"C-v": "peco.ScrollPageDown",
"C-g": "peco.Cancel",
"M-Space": "peco.ToggleRangeMode",
"M-c": "peco.CancelRangeMode"
},
"Style": {
"Basic": ["on_default", "default"],
"Matched": ["cyan"],
"Query": ["default"],
"SavedSelection": ["on_blue", "white"],
"Selected": ["on_magenta", "default"]
}
}
License
Languages
Shell
100%
