2020-03-04 21:01:23 +00:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
|
|
|
_call_navi() {
|
2020-04-07 04:55:42 +00:00
|
|
|
local selected
|
2020-08-05 09:43:07 +00:00
|
|
|
if [ -n "$LBUFFER" ]; then
|
2020-09-14 18:30:25 +00:00
|
|
|
if selected="$(printf "%s" "$(navi --print --fzf-overrides '--no-select-1' --query "${LBUFFER}" </dev/tty)")"; then
|
2020-08-05 09:43:07 +00:00
|
|
|
LBUFFER="$selected"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if selected="$(printf "%s" "$(navi --print </dev/tty)")"; then
|
|
|
|
LBUFFER="$selected"
|
|
|
|
fi
|
2020-04-07 04:55:42 +00:00
|
|
|
fi
|
|
|
|
zle redisplay
|
2020-03-04 21:01:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
zle -N _call_navi
|
|
|
|
|
|
|
|
bindkey '^g' _call_navi
|