Can someone explain to me what sil exe ":sb " . current_buffer does in a vimscript. I’m trying to learn how to use it, but finding documentation on vimscript seems nearly impossible.
Can someone explain to me what sil exe :sb . current_buffer does in a
Share
That’s a combination of several commands, and all of them are abbreviated.
The commands being used there are
:silent,:execute, and:sbuffer. Youcan get information on those commands by using
:help :silentfrom within vim,and the same for the other commands.
The
.operator is also being used to do string concatenation.First the
.operator is used to concatenate:sbwith the value of thecurrent_buffervariable. The resulting string is evaluated as if you’d typedit by the
:exeportion, which will supresss messages because it’s part of the:silcommand.So, the effect is as if you’d typed
:sb 4, from normal mode (using 4 there asthe value of
current_buffer). This would split the current window and use thenew window to edit buffer number 4.