mirror of
https://github.com/denisidoro/navi
synced 2024-11-13 23:37:10 +00:00
19 lines
408 B
Bash
19 lines
408 B
Bash
#!/usr/bin/env zsh
|
|
|
|
_call_navi() {
|
|
local selected
|
|
if [ -n "$LBUFFER" ]; then
|
|
if selected="$(printf "%s" "$(navi --print --fzf-overrides '--no-select-1' --query "${LBUFFER}" </dev/tty)")"; then
|
|
LBUFFER="$selected"
|
|
fi
|
|
else
|
|
if selected="$(printf "%s" "$(navi --print </dev/tty)")"; then
|
|
LBUFFER="$selected"
|
|
fi
|
|
fi
|
|
zle redisplay
|
|
}
|
|
|
|
zle -N _call_navi
|
|
|
|
bindkey '^g' _call_navi
|