I'm trying to insert a filename into text as below:
:put=expand("%")
but I've the following errors:
E116: Invalid arguments for function expand(
E15: Invalid expression: expand(
Why this doesn't work?
What's most surprising thing is that it works when using single-quote instead, e.g.:
:put=expand('%')
So I'm trying to understand:
- Is there any differences between using double-quotes or single-quotes? If so, what kind?
I'm using Vim v7.4.
let
keyword.let put=expand("%")
:help :put
.:call append(line('.'), expand("%"))
it put result ofexpand()
line bellow cursor.:put
puts text from register like this:let @x=expand("%") | put x
put=expand('%')
.