Reputation: 6971
I want to do something like:
let b = bufnr('%')
" do something that adds (potentially loads of) new buffers
buffer b
But I get the error
"No matching buffer for b"
How can "expand" the variable b, or work around this in some other way?
Upvotes: 3
Views: 238
Reputation: 32926
Have you tried:
:exe "buffer ".b
For more information:
:h :exe
Upvotes: 2