LoginSignup
5
6

More than 5 years have passed since last update.

vimでwindowsの改行コードを消す

Posted at

windowsユーザからもらったファイルに改行コード ^M が入っていたので消したい.

vimをバイナリモードで開く.
(なお, behatのfeatureファイルは通常モードのvimで開くと ^M が表示される)

# vim -b hoge.txt

hogehoge^M

不穏な空気が漂っている.

vimのコマンドモードで以下を入力
^M は Ctrl+v+m で入力できる.

:%s/^M//g

確認

hogehoge

削除できた.

5
6
0

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
5
6