Closed blueyed closed 6 years ago
The noautocmd was to ensure this happens swiftly, with autocmds this may become time consuming
Also, :%bw
is not right, it needs to be something like exec '1,'.bufnr('$').'bwipe'
Reason being :%
is a special range that represents the start - end of the current files lines, which has no correlation with the number of buffers loaded within vim.
%
is used with buffer commands to mean "all buffers". Please see :h :bw
, which mentions this:
:%bwipeout " wipe out all buffers
The noautocmd was to ensure this happens swiftly, with autocmds this may become time consuming
Correctness should be preferred over speed - Neomake uses BufWipeOut
for example to clean caches etc.
I've tested :%b
with 1000 buffers (:for i in range(1000) | exe 'badd '.i | endfor
), and it took ~1s with my rather huge config (using a lot of plugins).
With nvim -u NORC
creating 10000 buffers takes ~5s, and wiping them less than 1s.
So speed/performance is not really an issue here.
Thanks, looks like I missed the change for :%bw
good to know.
Also removes the
noautocmd
, so that plugins can handle removal of buffers properly.