Reputation: 377
I am a beginner in vim.
The following code is just a piece of code that i have. How to add line break between "just" and "an".
call append(line('.') - 1, 'This' .'is' .'just' . "\r" . 'an' . selected_content . 'example')
This code is not working. and got junk like (^M)
Upvotes: 0
Views: 967
Reputation: 32966
Split your string into a |List|, and then, it'll work.
call append('.', ['This' .'is' .'just', 'an' . selected_content . 'example'])
If as I suspect the string is built, then is won't be difficult to use a list instead of a string in your code. Otherwise, you'll need to use split(line, "\n")
Upvotes: 2