Wednesday, November 24, 2010

 

Getting rid of ^M (Ctrl-M) characters in Windows text using Vim

Since early days of Vim, I was always able to use and to build the ^M character (and other special control characters) whenever necessary from Vim's command mode.

This trick still works today on my Windows PC running Vim 6.4.

However, starting with Vim 7.2 on a Fedora 10 Linux PC, is somehow been mapped to "paste" command. And all of a sudden, I can no longer enter control characters in Vim's command mode.

Thanks grok2, I now know that should be used (^Q in place of ^V to do the trick when using GVim). This trick does NOT apply to Vim.

The original post can be found here (http://www.grok2.com/blog/2010/04/21/getting-rid-of-m-ctrl-m-characters-in-windows-text-using-vim/).

For Vim, a more primitive method, i.e. using \r (backslah r) to represent ^M, can be used. (see Vim wiki at this link).

Labels: ,


Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?