Table of Contents
shearch wants to be easier to use shell’s history. It is highly customizable meaning you can add your own commands, quickly navigate through them and recall them simply by entering a few key tags. It offers you in-place editing of command’s arguments by pressing TAB key to cycle through them. When satisfied hitting RETURN will push chosen command to the command line without executing it! The most convenient way to use shearch is by binding it to a shortcut key. By default F12 is used.
Share your commands with the rest of us. How? Look at add your own commands section. When you are ready to share follow this steps:
$ cd ~
$ git clone git@github.com:myusername/shearch.git # Replace myusername with your username on github
$ cd .shearch
$ git remote add upstream git://github.com/shearch/shearch.git
$ git branch mycommands # name of your branch
$ git checkout mycommands # move to your branch
$ git add ~/.shearch/src/db/mycommands.json
$ git commit ~/.shearch/src/db/mycommands.json -m "Added commands to list directories."
$ git commit -a -m "Final commit before push."
$ git checkout master # Move to your master branch.
$ git fetch upstream # Get latest code.
$ git merge upstream/master # Merge upstream master with your local master.
$ git push origin master # Merge upstream master with your remote fork.
$ git checkout mycommands # Move back to your mycommands branch.
$ git merge master # Update your mycommands branch with latest code.
$ git push origin mycommands # Push mycommands to your remote fork.
$ curl -o install.sh -L https://github.com/shearch/shearch/raw/master/tools/install.sh && . ./install.sh
$ wget --no-check-certificate https://github.com/shearch/shearch/raw/master/tools/install.sh && . ./install.sh
$ cd ~
$ git clone git://github.com/shearch/shearch.git ~/.shearch
$ . ~/.shearch/tools/install.sh
Python. Currently bash and zsh shells are supported.
Press F12, choose a command and press RETURN.
shearch uses standard EMACS(?) style navigation:
ALT_B: Back, left one word.
ALT_F: Forward, right one word.
CTRL_A: Beginning of the line (Home).
CTRL_B: Back one character.
CTRL_D: Delete.
CTRL_E: End of the line (End).
CTRL_F: Forward one character.
CTRL_H: Backspace.
CTRL_K: Cut line after cursor to clipboard.
CTRL_U: Cut line before cursor to clipboard.
CTRL_W: Cut word before cursor to clipboard.
CTRL_Y: Yank (paste). DSUSP, delayed suspend on BSD-based systems.
Cycle through arguments.
TAB: Cycle through command arguments. SHIFT_TAB: Reverse cycle through command arguments.
{
"command" : "find . -name \"*.txt\"",
"description" : "Finds all txt files in current directory.",
"nix_edit" : {
"mask": "find %s -name \"%s\"",
"args": [".", "*.txt"]
},
"tag" : ["find", "search", "locate", "text", "files"]
}
JSON database structure. Single item contains:
command - plain command typed in a command line,
description - Describe what command does.
nix_edit - Mask marks edible arguments. Args is an array providing default values for those arguments.
tag - comma separated tags
Please see provided sample files curl and example to make it clearer.