I have a function that I want returning pre-indented xml:
function! InsertStep()
let stepTemplate = "<step index=\"\">\n
\ <description></description>\n
\ <update>\n
\ <label></label>\n
\ <value></value>\n
\ <type>Expression</type>\n
\ </update>\n
\</step>"
return stepTemplate
endfunction
And here is my mapping for it:
imap <silent> <C-S><C-S> <C-R>=InsertStep()<CR>
But when I'm in insert mode and press my ctrl+s, ctrl+s hotkey, the result is not formatted:
<step index="">
<description></description>
<update>
<label></label>
<value></value>
<type>Expression</type>
</update>
</step>
Looking at this, it seems to drop my cursor down with smart indentation or something for every newline in the returned text or something. I have smart indent off btw. I would expect, if I'm just inserting the function's result at the cursor location, that there should not be any auto-indent shenanigans.
Help!
join([long list], "\n")
instead--then you can also use single-quotes and avoid some escaping.