I would like to correctly intepret the <cr>
in a command that is created based on user input.
For example, this function runs correctly and it will split the line a the location where the cursor is.
function NewLine()
execute "normal! r\<cr>"
endfunction
But if I convert it to accept user input:
function NewLine()
let l:cmd = input('Your command: ')
execute "normal! " . l:cmd
endfunction
if the input is r\<cr>
then it just replaces the character the current cursor is on, with \
instead of spliting the line.
How to make it interpret the whole thing, as it seems it stops at \
.
r
CTRL-V
ENTER
in your input