Skip to content

Allows interactively incrementally search history/checkout git branches and other stuff

Notifications You must be signed in to change notification settings

robturtle/percol.plugin.zsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 

Repository files navigation

percol

Maintainer: @robturtle

It provides two functionalities that allows you search history and resume background jobs with interactively incremental searching utility powered by percol.

Usage

  1. Use Ctrl-R to search the history.

interactively search history

  1. User Ctrl-H to search aliases

  2. Use Ctrl-T to switch to another git branch

  3. Use Ctrl-Q to resume background jobs.

interactively resume background jobs

Installation

  1. Install percol by running the following:

    pip install percol
    
  2. Clone the repository into your custom folder. Assuming your custom folder is at ~/.oh-my-zsh/custom

mkdir -p ~/.oh-my-zsh/custom/plugins
git clone https://github.com/robturtle/percol.plugin.zsh.git ~/.oh-my-zsh/custom/plugins/percol
  1. Enable the plugin by adding it to your plugins definition in ~/.zshrc.
plugins=(percol)
  1. Enable Emacs-like keyboard shortcuts
mkdir -p ~/.percol.d
touch ~/.percol.d/rc.py

And copy-paste the contents into ~/.percol.d/rc.py.

# file: ~/.percol.d/rc.py
# Emacs like
percol.import_keymap({
    "C-h" : lambda percol: percol.command.delete_backward_char(),
    "C-d" : lambda percol: percol.command.delete_forward_char(),
    "C-k" : lambda percol: percol.command.kill_end_of_line(),
    "C-y" : lambda percol: percol.command.yank(),
    "C-t" : lambda percol: percol.command.transpose_chars(),
    "C-a" : lambda percol: percol.command.beginning_of_line(),
    "C-e" : lambda percol: percol.command.end_of_line(),
    "C-b" : lambda percol: percol.command.backward_char(),
    "C-f" : lambda percol: percol.command.forward_char(),
    "M-f" : lambda percol: percol.command.forward_word(),
    "M-b" : lambda percol: percol.command.backward_word(),
    "M-d" : lambda percol: percol.command.delete_forward_word(),
    "M-h" : lambda percol: percol.command.delete_backward_word(),
    "C-n" : lambda percol: percol.command.select_next(),
    "C-p" : lambda percol: percol.command.select_previous(),
    "C-v" : lambda percol: percol.command.select_next_page(),
    "M-v" : lambda percol: percol.command.select_previous_page(),
    "M-<" : lambda percol: percol.command.select_top(),
    "M->" : lambda percol: percol.command.select_bottom(),
    "C-m" : lambda percol: percol.finish(),
    "C-j" : lambda percol: percol.finish(),
    "C-g" : lambda percol: percol.cancel(),
})

Upgrade

cd ~/.oh-my-zsh/custom/plugins/percol && git pull && cd -

About

Allows interactively incrementally search history/checkout git branches and other stuff

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages