[](https://joknarf.github.io/joknarf-tools)
[]()
[](https://shields.io/)
# redo
bash/zsh interactive history menu / autocompletion
replacement for bash/zsh CtlR and Esc/ to search in history and re-execute/re-edit commands.
## demo

## features
on command line:
* ShiftTab or Esc/ or CtlR to access history menu
* you can put pattern on command line + ShiftTab or Esc/ or CtlR to filter and access history menu
* in menu enter pattern to filter/re-filter history
* select command line with arrows or enter number and press enter
* you can then edit the command line before execution
## install
You can use a shell plugin manager like the famous [thefly](https://github.com/joknarf/thefly) :
```
fly add joknarf/redo
```
or just clone it:
```shell
git clone https://github.com/joknarf/redo
source redo/redo.plugin.
```
## keys in menu
|key | action |
|--------------------------------|-------------------------------------------------------|
|▼ | select next item |
|▲ | select prev item |
|End/▶ | select last item |
|Home/◀ | select first item |
|PgUp/CtlF| next page |
|PgDn/CtlB| previous page |
|Esc | exit |
|CtrlA | use all screen to display menu |
|Enter/Tab | put selected on command line |
|Tab | apply filter/new filter |
|Del/F8 | delete item from history file |
* filter pattern can be applied entering text
* selection can be done entering item number
## delete history commands
Using Del/F8 when using redo bind key (Esc/ or CtlR) will remove command from current shell history and $HISTFILE.
## limitations
* zsh on ubuntu 22 : in vi mode, to have Esc/ correctly binded, you need to put in `~/.zshenv`:
```
skip_global_compinit=1
```