Nick Triantafillou
Nick Triantafillou

Reputation: 585

Using ^M in a vim -s script

I'm trying to use a vim script to clean up some subtitle files.

When I paste these commands into vim, they work fine. However the lines with ^M in them aren't working when being used by vim -s script.txt filename.srt.

This is the contents of script.txt (image, because ^M's break things):

script.txt

Is what I'm trying to do possible? or should I attack it in a different way?

Upvotes: 0

Views: 97

Answers (1)

Nick Triantafillou
Nick Triantafillou

Reputation: 585

The solution was to replace the ^M with \r. This works with vim -s.

Upvotes: 1

Related Questions