use selection as default search query
This commit is contained in:
parent
e862cb5b78
commit
dc6d0a504e
1 changed files with 5 additions and 1 deletions
|
@ -137,6 +137,10 @@ Switches:
|
|||
fzf -params .. %{ evaluate-commands %sh{
|
||||
fzf_impl="${kak_opt_fzf_implementation}"
|
||||
|
||||
if [ $(printf "%s" "${kak_selection}" | wc -m) -gt 1 ]; then
|
||||
default_query="-i -q ${kak_selection}"
|
||||
fi
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
(-kak-cmd) shift; kakoune_cmd="$1" ;;
|
||||
|
@ -191,7 +195,7 @@ fzf -params .. %{ evaluate-commands %sh{
|
|||
printf "%s\n" "SHELL=${shell_path}"
|
||||
fi
|
||||
# compose entire fzf command with all args into single file which will be executed later
|
||||
printf "%s\n" "cd \"${PWD}\" && ${preview_position} ${items_cmd} ${fzf_impl} ${fzf_args} ${preview_cmd} ${filter} > ${result}"
|
||||
printf "%s\n" "cd \"${PWD}\" && ${preview_position} ${items_cmd} ${fzf_impl} ${default_query} ${fzf_args} ${preview_cmd} ${filter} > ${result}"
|
||||
printf "%s\n" "rm ${fzfcmd}"
|
||||
) >> ${fzfcmd}
|
||||
chmod 755 ${fzfcmd}
|
||||
|
|
Loading…
Reference in a new issue