Any way to ignore ^ M carriage returns in VIM?

Most of the files that I edit in VIM have a carriage return, so I often see every line with the ^ M character at the end. The only thing I used was to replace them with a type command +e ff=dos, but when I commit with git, it thinks I changed the whole file. So, I'm just wondering if there is a way to keep everyone here happy, is it changing the VIM parameter, changing the editing method, or changing the git configuration?

+4
source share
2 answers

You can:

:hi! link SpecialKey Ignore 

which will hide them. They will still be in your text and can be deleted accordingly, but at least they are not visually intrusive.

, , (, , ), , , , . - ,

:%s/\r//g 
:w! ++ff=dos 

- .

+2

Git . , Git, LF Unix CRLF Windows. , ( ).

Unix, core.autocrlf input; Windows true.

.

+4

All Articles