Search entire history with fzf in Ctrl-R
This commit is contained in:
parent
d12bc6f756
commit
a3ca92e2a6
7
zshrc
7
zshrc
@ -150,8 +150,11 @@ fi
|
||||
function fzf-history-search() {
|
||||
local selected
|
||||
selected=$(
|
||||
history | sed 's/ *[0-9]* *//' |
|
||||
fzf --layout=reverse --tac --info=hidden --border=rounded --height=50%
|
||||
cat $HISTFILE | # get entire history
|
||||
sed 's/ *[0-9]* *//' | # remove cruft
|
||||
awk '!seen[$0]++' | # remove duplicates
|
||||
fzf --layout=reverse --tac --cycle --info=hidden \
|
||||
--border=rounded --height=50%
|
||||
)
|
||||
if [[ -n "$selected" ]]; then
|
||||
BUFFER="$selected"
|
||||
|
Loading…
x
Reference in New Issue
Block a user