remove buffer from tmp
This commit is contained in:
parent
de6af42b6e
commit
981c5e8bbf
1 changed files with 8 additions and 8 deletions
16
rc/fzf.kak
16
rc/fzf.kak
|
@ -153,8 +153,7 @@ define-command -hidden fzf-tag %{
|
||||||
[ ! -z "${kak_client_env_TMUX}" ] && additional_keybindings="
|
[ ! -z "${kak_client_env_TMUX}" ] && additional_keybindings="
|
||||||
<c-s>: open tag in horizontal split
|
<c-s>: open tag in horizontal split
|
||||||
<c-v>: open tag in vertical split"
|
<c-v>: open tag in vertical split"
|
||||||
message="Jump to a symbol''s definition.
|
message="Jump to a symbol''s definition.<ret>: open tag in new buffer.
|
||||||
<ret>: open tag in new buffer.
|
|
||||||
<c-w>: open tag in new window $additional_keybindings"
|
<c-w>: open tag in new window $additional_keybindings"
|
||||||
echo "info -title '$title' '$message'"
|
echo "info -title '$title' '$message'"
|
||||||
[ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect ctrl-v --expect ctrl-s"
|
[ ! -z "${kak_client_env_TMUX}" ] && additional_flags="--expect ctrl-v --expect ctrl-s"
|
||||||
|
@ -176,12 +175,13 @@ define-command -hidden fzf-buffer-search %{
|
||||||
title="fzf buffer search"
|
title="fzf buffer search"
|
||||||
message="Search buffer with fzf, and jump to result location"
|
message="Search buffer with fzf, and jump to result location"
|
||||||
echo "info -title '$title' '$message'"
|
echo "info -title '$title' '$message'"
|
||||||
current_line=$kak_cursor_line
|
line=$kak_cursor_line
|
||||||
tmp=$(mktemp $(eval echo ${TMPDIR:-/tmp}/kak-curr-buff.XXXXXX))
|
char=$(expr $kak_cursor_char_column - 1)
|
||||||
echo "execute-keys %{%<a-|>cat<space>><space>$tmp<ret>}"
|
buffer_content=$(mktemp ${TMPDIR:-/tmp}/kak-curr-buff.XXXXXX)
|
||||||
# echo "execute-keys %{$current_line g}"
|
echo "execute-keys %{%<a-|>cat<space>><space>$buffer_content<ret>;}"
|
||||||
echo "fzf \"execute-keys \$1 gx\" \"(nl -b a -n ln $tmp\" \"--reverse | cut -f 1)\""
|
echo "execute-keys $line g $char l"
|
||||||
rm -rf $tmp
|
echo "fzf \"execute-keys \$1 gx\" \"(nl -b a -n ln $buffer_content\" \"--reverse | cut -f 1)\""
|
||||||
|
echo "nop %sh{rm $buffer_content}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue