added fzy history shortcut
This commit is contained in:
parent
d446bf51c4
commit
5fd15e5b07
2 changed files with 13 additions and 2 deletions
|
@ -8,14 +8,16 @@ set --notify-le
|
|||
set --le-no-conv-meta
|
||||
set --le-predict
|
||||
! [ -d ~/.cache/yash ] && mkdir -p ~/.cache/yash
|
||||
HISTRMDUP=50
|
||||
HISTFILE=~/.cache/yash/history
|
||||
HISTSIZE=100000
|
||||
HISTSIZE=50000
|
||||
PS1P="\fi"
|
||||
FCEDIT=hx
|
||||
|
||||
# prompt and z
|
||||
# yash extension scripts
|
||||
. ~/skynet/yash/polyglot.sh
|
||||
. ~/skynet/yash/z.sh
|
||||
. ~/skynet/yash/fzy-hist.sh
|
||||
|
||||
# environment setup
|
||||
export PURE_GIT_PULL=0
|
||||
|
|
9
yash/fzy-hist.sh
Normal file
9
yash/fzy-hist.sh
Normal file
|
@ -0,0 +1,9 @@
|
|||
h() {
|
||||
input="$*"
|
||||
SED_ARG='s/^[[:digit:]]*[[:space:]]*//'
|
||||
if [ -n "$input" ]; then
|
||||
history | sed '$d' | sort --reverse --numeric-sort | fzy -q"$input" | sed "$SED_ARG" | tr -d '\n' | wl-copy 2>/dev/null
|
||||
else
|
||||
history | sed '$d' | sort --reverse --numeric-sort | fzy | sed "$SED_ARG" | tr -d '\n' | wl-copy 2>/dev/null
|
||||
fi
|
||||
}
|
Loading…
Add table
Reference in a new issue