How can I get the buffer type of a buffer given its buffer id? I know I can switch to that buffer and use :set buftype?
to get the type.
But how can I do it without jumping to that buffer?
(I would expect to have something like buftype(id)
working similarly to bufname(id)
)
You're looking for :h getbufvar()
:echo getbufvar(bufid, '&buftype', 'ERROR')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With