https://github.com/joknarf/redo
bash/zsh interactive history menu
https://github.com/joknarf/redo
bash bindkey command command-line command-line-tool completion history interactive menu plugin redo search shell suggestions widget zsh
Last synced: 11 days ago
JSON representation
bash/zsh interactive history menu
- Host: GitHub
- URL: https://github.com/joknarf/redo
- Owner: joknarf
- License: mit
- Created: 2023-12-29T17:17:36.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-08T10:21:00.000Z (about 1 year ago)
- Last Synced: 2024-09-09T10:07:10.717Z (about 1 year ago)
- Topics: bash, bindkey, command, command-line, command-line-tool, completion, history, interactive, menu, plugin, redo, search, shell, suggestions, widget, zsh
- Homepage:
- Size: 67.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://joknarf.github.io/joknarf-tools)
[]()# redo
bash/zsh interactive history menu / autocompletion
replacement for bash/zsh CtlR and Esc/ to search in history and re-execute/re-edit commands.## usage
```shell
$ git clone https://github.com/joknarf/redo
$ source redo/redo
```
or direct source from github repository:
```shell
$ source <(curl -Ls https://raw.githubusercontent.com/joknarf/redo/main/redo)
```Then 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
## 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
To delete command from current shell history and `$HISTFILE` use `redodel` command then chose command and press Del or F8.
Using Del/F8 when using redo bind key (Esc/ or CtlR) will not remove command from current shell history (line editing limitation), but the `$HISTFILE` will be purged from the command.
When deleting history in `$HISTFILE` using redo bind key, set the following options to ensure the history is not written later in `$HISTFILE` by shell.
* zsh options to set :
```zsh
setopt appendhistory
setopt incappendhistory
```* bash options to set :
```
shopt -s histappend cmdlist
PROMPT_COMMAND='history -a'
```## limitations
* zsh on ubuntu 22 : in vi mode, to have Esc/ correctly binded, you need to put in `~/.zshenv`:
```
skip_global_compinit=1
```