Why :execute is not working as expected in Vim: LearnVimscriptTheHardWay
vim
Solution
You need to escape the `<cr>` with a backslash: `exe "norm! iHello\<cr>World"`
Problem
I am trying to learn Vimscript from `LearnVimscriptTHW` and I came across the use of `:execute and :normal`. Example from LVSTHW: ``` :normal! gg/a<cr> ``` From book: The problem is that `normal!` doesn't recognize "special characters" like `<cr>`. There are a number of ways around this, but the easiest to use and read is `execute`. Now when I use `:execute "normal! gg/a<cr>"` it doesn't work for me. It doesn't search for `a(char)` in my current file instead of that it just executes `gg` and than do nothing but if is use `:execute "normal! gg/a\r"` it works and successfully highlights the `char a` in my file. I also tried the below following ways but none of them worked. ``` :execute "normal! gg/a"<cr> :execute normal! gg/a<cr> :execute "normal! gg/a<cr>"<cr> ``` From the book it seems that `execute` internally converts `<cr> to \r`. So, why it is not happening in my case.