Vi editor environment settings 1. environment option settings (after exiting Vi, these settings are discarded) require the command status in the Vi editor before the settings, use the set command starting with a colon. [Note that the following settings are only valid temporarily and are discarded after you exit Vi .] 1.1 Set New... information & Vi editor environment settings 1. environment option setting (after exiting Vi, these settings are discarded) requires that the command is in the Vi editor state before the setting, and use the set command starting with a colon. [Note that the following settings are only valid temporarily and are discarded after you exit Vi .] 1.1 set the starting alignment of the new line and the previous line: set autoident abbreviation: set ai cancel: set noai1.2 set display line number: set number abbreviation: set nu cancel: set nonumber1.3 set ignore case when searching: set ignorecase abbreviation: set ic cancel: set noignorecase 2. the abbreviation replacement setting requires the command status in the Vi editor before the setting. the command format is AB [SP] shortname [SP] longname. [SP indicates a space] [Similarly, the following settings are only valid temporarily. after exiting Vi, they are discarded .] For example, run the following command to set los to the abbreviation of Linux Operating System: AB los Linux Operating System to cancel this abbreviation. use: unab los in the preceding example, when the Vi editor is in text input mode, when you enter los and enter a space before closing Vi, Vi will replace los with the full name of Linux Operating System. If los is only part of a word, Vi will not change it. Vi determines whether it is an abbreviation by checking whether there are spaces before and after los. In the preceding example, the lose, close, and other words are not replaced. the replacement only occurs when [SP] los [SP] appears. [SP indicates a space] 3. make the setting valid for a long time. the common defect of the preceding setting is that it is only valid temporarily. you have to reset the setting every time you open Vi. To set long-term validity, you can save the set command to a file named. exrc. A file named after a vertex is a hidden file .] The setting command in the. exrc file does not start with ":" (colon). you can simply write it directly. The location where the. exrc file is stored determines its scope. If it is stored in a directory of a source file, the setting in Vi is valid only when it is opened in this directory. if it is stored in the user's main directory, it is valid when the user uses Vi. When there are multiple. exrc files, the Vi editor only uses one of them, and the current working directory has a higher priority than the user's main directory. If the. exrc file does not exist, use the default option.
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