I wrote short macro that helps me grep for the word under the cursor. Here it is in my .vimrc:
let @a=":! git grep ^R^W^M"
However, when I open vim and run
:reg a, I see the following:
"a :! git grep ^R^W^M^J
You can see an ^J has been added to the macro.
If I remove the ^M in my script, then the ^J disappears also.
It seems the ^J acts similar to ^M. So, it's like I have two ^M. This isn't what I want, because I can't see the result of my command. The window just flashes before I can read it.
I have gotten my script to work by pasting and then copying it. The problem only arises when I try to load it using my .vimrc.