I see from :h printf
that there's a print function in vim:
printf({fmt}, {expr1} ...)
printf() Return a String with {fmt}, where "%" items are replaced by the formatted form of their respective arguments. Example: printf("%4d: E%d %.30s", lnum, errno, msg)
However, when I try doing something basic like:
:printf('Hello, %s', 'name')
I get the following error:
E492: Not an editor command: printf('Hello, %s', 'name')
What would be the correct usage, if any, of the printf
command, and where can it be used?