Vim Modify file format, view invisible characters, etc.Category: Weapon Spectrum 2013-10-29 22:26 2125 people read review (0) favorite report
- : Set fileformats=unix,dos ==>unix file format as the first choice, DOS format as a second choice, especially to note that the shell, Python and other scripts need to be saved in UNIX format, Because otherwise, you'll be prompted to run directly under Linux: No such file or directory, because Linux also treats line breaks as part of the Scripting interpreter.
- : Set fileformat ==> view file format
- : Set Fileformat=unix/dos ==> setting (conversion) file format
- : Set Endofline/noendofline ==> Sets the end of the file to automatically increase the line break
- : Set List/nolist ==> sets whether to display invisible characters, note that this option is constrained by the set Listchars.
- :%s/\n//g ==> Delete line break
- : Set textwidth=78 ==> Sets the width of the column to wrap, and when formatted with the GQ command, wraps the text at the end of the word as long as it is set.
The summary is shown in the following table:
:set fileformat |
Set file format |
:set endofline |
Set file Terminator |
:set noendofline |
Cancel file Terminator |
:set list |
Go to list Mode |
:set nolist |
Exit list Mode |
:%s/\n//g |
Remove line breaks |
:set textwidth |
Set line width |
:set textwidth |
Set line margins |
:join |
Merging multiple rows |
J |
Merge two rows |
Reference Links:
Special symbols such as carriage return and newline characters are displayed under Vim.
"Go" vim modify file format, view invisible string, etc.