add first match to grep buffer
This commit is contained in:
parent
19032114d5
commit
e847c9effa
1 changed files with 11 additions and 8 deletions
|
@ -43,14 +43,17 @@ define-command -hidden fzf-sk-grep %{ evaluate-commands %sh{
|
||||||
printf "%s\n" "fzf -kak-cmd %{fzf-sk-grep-handler} -fzf-impl %{sk -m -i -c '$kak_opt_fzf_sk_grep_command {}'} -fzf-args %{--expect ctrl-w $additional_flags} -multiple-cmd %{fzf-sk-populate-grep} -post-action %{buffer %opt{fzf_sk_first_file}}"
|
printf "%s\n" "fzf -kak-cmd %{fzf-sk-grep-handler} -fzf-impl %{sk -m -i -c '$kak_opt_fzf_sk_grep_command {}'} -fzf-args %{--expect ctrl-w $additional_flags} -multiple-cmd %{fzf-sk-populate-grep} -post-action %{buffer %opt{fzf_sk_first_file}}"
|
||||||
}}
|
}}
|
||||||
|
|
||||||
define-command -hidden fzf-sk-grep-handler -params 1 %{ evaluate-commands %sh{
|
define-command -hidden fzf-sk-grep-handler -params 1 %{
|
||||||
|
evaluate-commands %sh{
|
||||||
printf "%s\n" "$1" | awk '{
|
printf "%s\n" "$1" | awk '{
|
||||||
file = $0; sub(/:.*/, "", file); gsub("&", "&&", file);
|
file = $0; sub(/:.*/, "", file); gsub("&", "&&", file);
|
||||||
line = $0; sub(/[^:]+:/, "", line); sub(/:.*/, "", line)
|
line = $0; sub(/[^:]+:/, "", line); sub(/:.*/, "", line)
|
||||||
print "edit -existing %&" file "&; execute-keys %&" line "gxvc&"
|
print "edit -existing %&" file "&; execute-keys %&" line "gxvc&"
|
||||||
print "set-option global fzf_sk_first_file %&" file "&"
|
print "set-option global fzf_sk_first_file %&" file "&"
|
||||||
}'
|
}'
|
||||||
}}
|
}
|
||||||
|
fzf-sk-populate-grep %arg{1}
|
||||||
|
}
|
||||||
|
|
||||||
define-command -hidden fzf-sk-populate-grep -params 1 %{
|
define-command -hidden fzf-sk-populate-grep -params 1 %{
|
||||||
try %{
|
try %{
|
||||||
|
|
Loading…
Reference in a new issue