Fast history searching tool for zsh / bash.
Rewrite of this script using ncurses for blazing fast speed, hence the 2.
Using asdf to search for a command and running it:
Using asdf to search for a command, and edit it before running:
Using asdf to delete a command from the history:
ncurses development headers/libraries (you need to do something like
sudo apt-get install ncurses-devon Ubuntu, or
brew install ncurseson Mac, or install the
libncurses-develpackage on Windows/Cygwin)
zsh or bash 4 (Mac install instructions)
You should be able to just run
make, and it should build fine assuming you have ncurses installed.
After you've built it simply run
./asdf. You can add it to your
PATH to be able to use it from anywhere. Certain shell commands (like
cd some/path) won't run correctly because this will be inside of a subshell, which then exits, losing your changes. In order to get around that you can source
asdf instead of just running it. Simply add
alias asdf="source /path/to/asdf" to your
<Down>-> select different commands
<Enter>-> runs the selected command
<C-Space>-> edit the selected command before running it
<C-\>-> remove the selected command (and any copies) from your HISTFILE
Not required, but if you're using bash, adding the following to your
.bashrc can make interacting with your history a little bit nicer:
# make history virtually unlimited export HISTSIZE=1000000 export HISTFILESIZE=$HISTSIZE # make it so that asdf doesn't show up in the history export HISTIGNORE="$HISTIGNORE:asdf*" # append commands to the history as they're run (instead of after the shell exits) shopt -s histappend PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
Clean up the code. It's kind of a mess right now. Manageable, but a mess.
Add support for bash movement hotkeys (like
^Wdeleting a word)
Add regex support (assuming it doesn't slow things down too much)