mirror of
https://github.com/denisidoro/navi
synced 2024-11-21 19:13:07 +00:00
Update navi.plugin.fish
This commit is contained in:
parent
38f807c1f6
commit
5e3215466d
1 changed files with 24 additions and 16 deletions
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env fish
|
|
||||||
|
# navi widget fish | source
|
||||||
|
|
||||||
function __call_navi
|
function __call_navi
|
||||||
navi --print
|
navi --print
|
||||||
|
@ -16,25 +17,32 @@ function navi-widget -d "Show cheat sheets"
|
||||||
commandline -f repaint
|
commandline -f repaint
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# set -g navi_last_cmd ""
|
||||||
|
|
||||||
function smart_replace
|
function smart_replace
|
||||||
# set -l current_buffer (commandline -b)
|
|
||||||
set -l current_process (commandline -p)
|
set -l current_process (commandline -p)
|
||||||
# set -l current_job (commandline -j)
|
|
||||||
set -l best_match (navi --print --best-match --query $current_process)
|
if [ $current_process = "" ]
|
||||||
|
commandline -p (navi --print)
|
||||||
if [ $current_process = $best_match ]
|
|
||||||
# if [ $current_process != $best_match ]
|
|
||||||
# echo "true"
|
|
||||||
set -l new_process (navi --print --query $current_process)
|
|
||||||
# echo $new_process
|
|
||||||
commandline -p $new_process
|
|
||||||
commandline -f repaint
|
commandline -f repaint
|
||||||
else
|
else
|
||||||
# echo "false"
|
set -l best_match (navi --print --best-match --query $current_process)
|
||||||
commandline -p $best_match
|
# if [ $navi_last_cmd = $current_process ]
|
||||||
commandline -f repaint
|
if [ $best_match = "" ]
|
||||||
# commandline -p ' '$best_match
|
# set navi_last_cmd (commandline -p)
|
||||||
# navi-widget
|
# commandline -p $current_process
|
||||||
|
commandline -p (navi --print --query $current_process)
|
||||||
|
commandline -f repaint
|
||||||
|
# else
|
||||||
|
else if [ $current_process != $best_match ]
|
||||||
|
commandline -p $best_match
|
||||||
|
commandline -f repaint
|
||||||
|
else if [ $current_process = $best_match ]
|
||||||
|
commandline -p (navi --print --query $current_process)
|
||||||
|
commandline -f repaint
|
||||||
|
# else
|
||||||
|
# commandline -p $current_process
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue