aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/buffer-delete/autoload
AgeCommit message (Collapse)Author
2020-10-21Add 'buffer-delete' pluginTeddy Wing
I was having trouble with slow `<C-p>` completion, and figured out it was due to the fact that I had about 300 buffers open. Many of these buffers weren't being actively used, and were just loaded in from Vim sessions past. When I removed the unloaded buffers, completion sped up like a whistle. Thanks to 'sidyll' (https://stackoverflow.com/users/557306/sidyll) on Stack Overflow for explaining how to get "all" buffer numbers (or at least all possible buffer numbers up to the highest one open), as well as the filtering logic: https://stackoverflow.com/questions/17931507/vimscript-number-of-listed-buffers/17933352#17933352 I leveraged the above to get the buffer numbers of all unloaded buffers, then delete the buffers by number. It was originally a temporary command-mode line, but I decided it could be beneficial to save the code just in case I need it again.