Closed losnappas closed 5 years ago
there was this feature at some point, but I've removed it because it was making implementation complex. Although, Idid a refactoring so maybe I could bring it back. I'll see if I can do it
I'm not sure that this is possible with current implementation without duplication of fzf
comand source code into fzf-buffer
command for single feature. The problem is that keypresses are handled in this case
statement:
case ${line} in
${kak_opt_fzf_window_map}) wincmd="fzf-window" ;;
${kak_opt_fzf_vertical_map}) wincmd="fzf-vertical" ;;
${kak_opt_fzf_horizontal_map}) wincmd="fzf-horizontal" ;;
*) item=${line} ;;
esac
In order to make it work for deleting buffers I need to add new arm here like this:
case ${line} in
${kak_opt_fzf_window_map}) wincmd="fzf-window" ;;
${kak_opt_fzf_vertical_map}) wincmd="fzf-vertical" ;;
${kak_opt_fzf_horizontal_map}) wincmd="fzf-horizontal" ;;
${kak_opt_fzf_bufdelete_map}) "action that deletes the buffer here and restarts fzf-buffer" ;;
*) item=${line} ;;
esac
But this means that all other commands will attempt to delete buffer if this key is pressed, which is not good. I could wrap it with if
s but it will make fzf
command non generic.
I'll think about it for some more.
Right, I see the problem.
One option could be to make a new "extra" keybind that would run a user-specified command, so it would be at least a bit more generic. Then I could run fzf-buffers "db | fzf-buffer"
, for example, but idk if that would see any real use besides this.
~And speaking of that example command, I'd have to do the run (){ ... } run
trick like with linters.~ nvm I'd just make a normal define-command, because this isn't shell side, I suppose.
I've just pushed new command with the fzf-buffer.kak
module: fzf-delete-buffer
mapped to <a-b>
in fzf-mode
. See if it works for you
How about a delete buffer hotkey into the buffer menu?