"Go" vim modify file format, view invisible string, etc.

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.