[Feature request]: Requests history
Background
[ x] I have checked ytfzf(1) and ytfzf(5) or the wiki before creating this.
Problem
I want to have requests history.
Feature
Main point is to have requests history in shell promt before fzf is on screen.
> ytfzf
Search
>
It would be cool to have ability to press ctrl-r like in bash to have history of requests with fzf-history widget.
You can use the -q option to see the search history, however this is not exactly the same as what you are proposing.
You can add the below to ~/.config/ytfzf/conf.sh, and you'll be able to press the up/down arrow keys to cycle through history, you'll also be able to use ctrl-r
search_prompt_menu () {
[ -z "$cache_dir" ] && cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/ytfzf"
HISTFILE="$cache_dir/bash_search_hist"
printf "Search\n"
history -r
read -p "> " -er _search
#uncomment the line below to enable history expansion
#_search="$(history -p "$_search")"
history -s "$_search"
history -a
printf "\033[1A\033[K\r%s\n" "> $_search" > /dev/stderr
}
If you want you can also uncomment the line before history -s "$_search" to be able to do things like !! to mean the last search.
Edit:
Forgot to mention that /bin/sh has to point to bash for this to work
As of version 2.5.0 you can copy the bsm addon to ~/.config/ytfzf/extension then add load_extension bsm to conf.sh, and you will get this feature.