From 3674d75886b201c12ed6d0f3e34bdb0f561087c4 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 1 Jun 2020 08:34:32 +0000 Subject: [PATCH] Show a way to delete buffers with `D` from `:Buffers`. --- Examples-(vim).md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Examples-(vim).md b/Examples-(vim).md index b7801d5..86829d4 100644 --- a/Examples-(vim).md +++ b/Examples-(vim).md @@ -326,4 +326,23 @@ command! -bang -nargs=* LoadTemplate call fzf#run({ \ 'down': 20, \ 'sink': function('read_template_into_buffer') \ }) +``` + +### Delete buffers from `:Buffers` + +This customization for `:Buffers` makes `D` delete buffers, and it reloads the list of available buffers upon deletion, while allowing to delete multiple buffers as well. The requirements are: + +- https://github.com/mhinz/neovim-remote . +- fzf.vim with this PR merged: +- fzf 19.0 or later. + +```vim +command! -bar -bang -nargs=? -complete=buffer Buffers call + \ fzf#vim#buffers( + \ , + \ {'options': [ + \ '--bind=D:execute@nvr -c "bw $(echo {+1} | sed "s/\[\([0-9]\)\]/\1/g")"@+reload@nvr --remote-expr "join(map(fzf#vim#buflisted_sorted(), \"fzf#vim#format_buffer(v:val)\"), \"\n\")"@', + \ '--multi' + \ ]}, + \ 0) ``` \ No newline at end of file