避免把 dos ending 的 ^M 顯示出來,
所以在檢查一個 檔案 是不是 有 ending mark 時,會看不出來。
可以在 自己 home 的 .vimrc 加上:
:set ffs=unix強制以 unix format 開啟檔案,這樣就可以顯示出 ^M 了。
實際測試,開啟檔案後再下 command 沒效,要加在 .vimrc 裡才行。
:set ffs=unix ^M :%s/search-word/replace-word/g:%s/^M//g Control-V Control-M