What does charcter ^ G mean in vim?

I open an XML file in Vim and found that there are a lot of symbols ^M

and ^G

. So I'm trying to use dos2unix

to strip characters ^M

, but he told me that the file is a binary file, which makes it skip the file. After that, in manunally, the ^G

symbol dos2unix

successfully processes that file. My question is: what does it mean ^G

here? ^G

Does this in the file make it a binary file?

+3


source to share


2 answers


^G

- bell symbol. When the file is displayed on a traditional terminal, you will hear a beep when you reach that character. There is really no difference between "binary" and "text" files, so it’s dos2unix

just guessing, in which case it’s wrong. You can use the option -f

to force it to convert files it thinks are binary.



+5


source


To add to the above answer, Ctrl-M is also usually the end-of-line / line character corresponding to the "\ r \ n" carriage return used by Windows.



You can read more in the answers to this question, including some ways to convert them to unix-style line endings (if you need to): What does the ^ M character mean in Vim?

+1


source







All Articles