how to write value of variable into current edit file in vim script -
i variable's value in vim's script, , how write file i'm editing now.
e.g.
"=== date let todaydate=system("date")
you can use :put
put contents of variable (or expression) current buffer
:put =todaydate
the :h :put
:pu :put :[line]pu[t] [x] put text [from register x] after [line] (default current line). works linewise, command can used put yanked block new lines. cursor left on first non-blank in last new line. register can '=' followed optional expression. expression continues until end of command. need escape '|' , '"' characters prevent them terminating command. example: :put ='path' . \",/test\" if there no expression after '=', vim uses previous expression. can see ":dis =".
for mappings , editing <c-r>=
better :put
since allows use expression register , output contents @ cursor location. (take @ :h <c-r>
)
Comments
Post a Comment