1
0
Fork 0
This commit is contained in:
Andrey Orst 2018-11-27 09:06:10 +03:00
parent 6b49595ffc
commit ec107f4c49

View file

@ -12,6 +12,11 @@ map global fzf -docstring "open buffer" 'b' '<esc>: fzf-buffer<ret>'
define-command -hidden fzf-buffer %{ evaluate-commands %sh{
printf "%s\n" "info -title %{fzf buffer} %{Set buffer to edit in current client.}"
buffers=$(printf "%s\n" "$kak_buflist" | sed "s/^'//;s/'$/\n/;s/' '/\n/g")
printf "%s\n" "fzf %{buffer} %{printf \"%s\n\" \"$buffers\"}"
buffers=$(mktemp ${TMPDIR:-/tmp}/kak-fzf-buffers.XXXXXX)
eval "set -- $kak_buflist"
while [ $# -gt 0 ]; do
printf "%s\n" "$1" >> $buffers
shift
done
printf "%s\n" "fzf %{buffer} %{(cat $buffers; rm $buffers)}"
}}