-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to delete buffers in :Buffers command #1239
base: master
Are you sure you want to change the base?
Add support to delete buffers in :Buffers command #1239
Conversation
d17b80d
to
a54fcbc
Compare
return | ||
endif | ||
|
||
let b = buffer_numbers[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When multiple buffers are selected we open only the first one, not sure if this is the right/desired behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we can delete multiple buffer at once? just like we open multiple files using tab in :Files
or there's a different mechanism here?
Would it be possible to also include Ctrl-W for buffer-wipe and also the possibility to delete/wipe the current (%) buffer which is currently unfortunately unselectable ? |
Hi @dav-dev! I tried to make this patch as small as possible to increase the probability of being merged (easier to review, no big changes, etc). Let's first hear what the maintainers have to say and then we can improve upon (if gets merged haha). WDYT? |
a54fcbc
to
6609189
Compare
By pressing the CTRL-D keybinding
6609189
to
58fbfd3
Compare
Hey peeps 👋 Is this something that could be added in config via " Delete a buff
function! s:delete_buffer(args)
" Delete buffer here...
endfunction
let g:fzf_action = {
\ 'ctrl-q': function('s:build_quickfix_list'),
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit',
\ 'ctrl-d': function('s:delete_buffer'),
\ }
https://github.com/perrupa/dotfiles/blob/master/vim/plugin/fzf.vim#L13-L17 I found this PR trying to add something like above in my .vimrc and would love to help if possible. 👌 |
I was looking for this feature and found this PR. It's exactly what I'm missing, any potential to get it merged? |
Sending my encouragement to get this exact functionality merged into fzf.vim. Would absolutely love it. |
@mracos, I think it would be a really nice touch if |
I too think this is the ideal behavior. I have been thinking about this feature for a long time, and after reading the changes here and the source code a bit, I think it'll require rather large rewrites to The problem is that currently this PR uses the The current implementation is great never the less, thanks for putting the hard work! |
Hey folks, thank you so much for the investigation and interest. It's been a while since I've last touched this PR and I have stopped using So if anyone wants feel free to pick up this PR from there or even redo it from scratch, given that it's stale it might be easier |
This commit extends the :Buffers command with --multi to allow <Tab> selection of multiple buffers that can then be deleted with CTRL-D or opened into separate tabs/splits/vertical splits with CTRL-T/CTRL-X/CTRL-V.
See PR above as a proposed solution. I have just a few comments on the thread:
While it is possible and relatively easy to use fzf's
Adapting this PR to allow CTRL-W to execute |
BTW I use https://github.com/ibhagwan/fzf-lua which has this feature. |
By pressing the CTRL-D keybinding.
Also enabled the
-m
multi select option to be able to delete multiple buffers.