mirror of
https://github.com/denisidoro/navi
synced 2024-11-21 19:13:07 +00:00
finished/working with extra comments
This commit is contained in:
parent
b756573be8
commit
38f807c1f6
1 changed files with 14 additions and 18 deletions
|
@ -17,30 +17,26 @@ function navi-widget -d "Show cheat sheets"
|
||||||
end
|
end
|
||||||
|
|
||||||
function smart_replace
|
function smart_replace
|
||||||
set -l current_buffer (commandline -b)
|
# 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)
|
set -l best_match (navi --print --best-match --query $current_process)
|
||||||
echo $best_match $current_process
|
|
||||||
|
|
||||||
if [ $current_process != $best_match ]
|
if [ $current_process = $best_match ]
|
||||||
echo "true"
|
# if [ $current_process != $best_match ]
|
||||||
commandline -i $best_match
|
# echo "true"
|
||||||
|
set -l new_process (navi --print --query $current_process)
|
||||||
|
# echo $new_process
|
||||||
|
commandline -p $new_process
|
||||||
|
commandline -f repaint
|
||||||
else
|
else
|
||||||
echo "false"
|
# echo "false"
|
||||||
navi-widget
|
commandline -p $best_match
|
||||||
|
commandline -f repaint
|
||||||
|
# commandline -p ' '$best_match
|
||||||
|
# navi-widget
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#cli_buffer = commandline -
|
|
||||||
# split at last | left/right str
|
|
||||||
# set $user_input
|
|
||||||
# if query = answer : call Navi-widget
|
|
||||||
# else smart_replace :
|
|
||||||
# set output (navi --print --best-match --query $user_input)
|
|
||||||
# replace userinput string in clibuff or left string += output
|
|
||||||
# commandline append repaint
|
|
||||||
|
|
||||||
bind \cg smart_replace
|
bind \cg smart_replace
|
||||||
if bind -M insert > /dev/null 2>&1
|
if bind -M insert > /dev/null 2>&1
|
||||||
|
|
Loading…
Reference in a new issue