mirror of
https://github.com/denisidoro/navi
synced 2024-11-22 03:23:05 +00:00
navi fish plugin with ability to edit commandline
This commit is contained in:
parent
cc2e3f7832
commit
f278212132
1 changed files with 13 additions and 17 deletions
|
@ -1,21 +1,17 @@
|
||||||
function navi-widget -d 'Call navi'
|
function navi_key_bindings
|
||||||
set -q NAVI_USE_FZF_ALL_INPUTS; or set -l NAVI_USE_FZF_ALL_INPUTS "true"
|
function navi-widget -d "Show cheat sheet"
|
||||||
begin
|
set -q FZF_TMUX_HEIGHT; or set FZF_TMUX_HEIGHT 40%
|
||||||
navi --print | while read -l r; set result $result $r; end
|
begin
|
||||||
|
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT $FZF_DEFAULT_OPTS --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS +m"
|
||||||
if [ -n "$result" ]
|
stty sane
|
||||||
echo $result
|
env NAVI_USE_FZF_ALL_INPUTS=true navi --print query (commandline) | perl -pe 'chomp if eof' | read -lz result
|
||||||
|
and commandline -- $result
|
||||||
# Remove last token from commandline.
|
|
||||||
commandline -t ""
|
|
||||||
end
|
end
|
||||||
|
commandline -f repaint
|
||||||
end
|
end
|
||||||
|
|
||||||
# commandline -f repaint
|
bind \cg navi-widget
|
||||||
end
|
if bind -M insert > /dev/null 2>&1
|
||||||
|
bind -M insert \cg navi-widget
|
||||||
bind \cg navi-widget
|
end
|
||||||
|
|
||||||
if bind -M insert > /dev/null 2>&1
|
|
||||||
bind -M insert \cg navi-widget
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue