Get rid of those stupid ^M’s from your code.

Posted 1 year, 5 months ago at 4:21 pm. 5 comments

Yes i’m geek and i’m using VI. I found tons of ^M’s in wordpress files while i was coding this blog.

Here’s how to get rid of them:

Open your file in vi

# vi file.php

then press “:” and type this:

:%s/[ctrl+v][ctrl+m]//g

[ctrl+v] … hold control and press v
[ctrl+m] … hold control and press m

Voila, there’s no more ^M’s and your code is clean in the way it should be!

5 Replies

  1. Thanks dali ;-) and nice blog !

  2. U’re welcome! ;-) And thank you :-P

  3. Dalibor has a noo blog!

    R u saying that you use vi for coding just because it sounds geeky or are you truly a uber terminal junkie?

  4. @tomaz: It’s all about speed and usability! :-) Just think about editor in which you don’t need mouse at all ;-)

  5. @dalibor - nah … I prefer nano for the terminal and Kate for non IDE coding


Leave a Reply