100
100

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VIMで、行末の余分な改行コード(^M)をすべて取り除く

Last updated at Posted at 2012-06-21

たまに使うけれど、よく忘れるのでメモ。

VIMで、行末の余分な改行コード(^M)をすべて取り除くには、以下のコマンドを実行します。

:%s/^M//g
  • % はバッファ全体に対して適用
  • s/~/~/g は、置換(g=同じ行に何個あってもすべて置き換え)

^M を入力するには、<c-v>``<c-m>を押します。

100
100
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
100
100

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?