further simplifications of main script
This commit is contained in:
parent
29782b25b8
commit
b8bcbc33c7
1 changed files with 17 additions and 17 deletions
26
rc/fzf.kak
26
rc/fzf.kak
|
@ -157,28 +157,28 @@ fzf -shell-script-completion %{echo "-kak-cmd\n-items-cmd\n-fzf-args\n-post-acti
|
||||||
cmd="terminal %{${fzfcmd}}"
|
cmd="terminal %{${fzfcmd}}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(
|
printf "%s\n" "${cmd}"
|
||||||
printf "%s\n" "${cmd}" | kak -p ${kak_session}
|
|
||||||
while [ -e ${fzfcmd} ]; do
|
( while [ -e ${fzfcmd} ]; do
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
if [ -s ${result} ]; then
|
if [ -s ${result} ]; then
|
||||||
(
|
(
|
||||||
read action
|
while read line; do
|
||||||
case ${action} in
|
case ${line} in
|
||||||
ctrl-w) wincmd="fzf-window" ;;
|
ctrl-w) wincmd="fzf-window" ;;
|
||||||
ctrl-s) wincmd="fzf-vertical" ;;
|
ctrl-s) wincmd="fzf-vertical" ;;
|
||||||
ctrl-v) wincmd="fzf-horizontal" ;;
|
ctrl-v) wincmd="fzf-horizontal" ;;
|
||||||
*) if [ -n "${action}" ]; then
|
*) item=${line} ;;
|
||||||
printf "%s\n" "evaluate-commands -client ${kak_client} '${kakoune_cmd}' '${action}'" | kak -p ${kak_session}
|
|
||||||
[ -n "${post_action}" ] && printf "%s\n" "evaluate-commands -client ${kak_client} ${post_action}" | kak -p ${kak_session}
|
|
||||||
fi ;;
|
|
||||||
esac
|
esac
|
||||||
while read item; do
|
if [ -n "${item}" ]; then
|
||||||
printf "%s\n" "evaluate-commands -client ${kak_client} ${wincmd} %{${kakoune_cmd} %{${item}}}" | kak -p ${kak_session}
|
printf "%s\n" "evaluate-commands -client ${kak_client} ${wincmd} %{${kakoune_cmd} %{${item}}}"
|
||||||
[ -n "${post_action}" ] && printf "%s\n" "evaluate-commands -client ${kak_client} ${post_action}" | kak -p ${kak_session}
|
fi
|
||||||
done
|
done
|
||||||
) < ${result}
|
if [ -n "${post_action}" ]; then
|
||||||
|
printf "%s\n" "evaluate-commands -client ${kak_client} %{${post_action}}"
|
||||||
|
fi
|
||||||
|
) < ${result} | kak -p ${kak_session}
|
||||||
fi
|
fi
|
||||||
rm -rf ${fzf_tmp}
|
rm -rf ${fzf_tmp}
|
||||||
) > /dev/null 2>&1 < /dev/null &
|
) > /dev/null 2>&1 < /dev/null &
|
||||||
|
|
Loading…
Reference in a new issue