Customize the vi editor in linux

Source: Internet
Author: User
In linux, customize the vi Editor-general Linux technology-Linux technology and application information. For more information, see the following. In each user's home directory, there is a vi Configuration File ". vimrc" (if not, you can manually create it ). You can edit it to make its settings a valid parameter every time you start vi. For example:

Set nu ---- display the row number

Set nonu ---- do not display the row number

Set ic ---- case-insensitive when searching

Set noic ---- case sensitive when searching

Set smartindent ---- automatic indent

Vim setting options

Option description
: Set all view all set options
: Set display current set settings
: Filetype on checks the file type through $ VIMRUNTIME/filetype. vim.
Ai/noai auto indent, the new line and the previous line Keep-caused automatic space/not automatic space (default)
Aw/noaw write automatically, transfer to shell or use: n when editing other files,
The current buffer is written/not written
Flash/noflash flash flashes in the error but does not sound (default)/uses the sound instead of flashing
When querying and matching modes, the ic/noic is case insensitive/case insensitive (default)
Lisp/nolist: Set automatic spaces when editing the lisp program to arrange text/set spaces automatically in the previous line
Magic/nomagic use all the special delimiters for pattern matching/restrict the special delimiters only to "^" and "$"
Mesg/nomesg allow/do not allow other users to write to the terminal
Nu/nonu display line number on the left side of the screen/do not show line number (default)
Ro/noro read-only. File Modification/normal read/write mode is not allowed unless it is explicitly set to w.
Remap/noremap allows you to map macros directly to the edited command line (default)/define macros explicitly
Showmatch displays parentheses. When you type,
Matching brackets for High Brightness Display/not highlighted by default
Mode indicator in the highlighted button bar when showmode is in text input mode/the current mode is not indicated by default
Ts = n: Set the span of the TAB key to n delimiter spacing. The default value is 8.
After the text is modified by warn/nowarn, the system displays the text when the shell is left (default)
Ws/nows when searching, if it reaches the end of the file, it bypasses the file header and continues searching.
Wrap/nowrap long line display auto-fold
Wm = n retains the blank edge, and n represents the number of characters for the blank edge at the rightmost of the display.
Si smart indent bracket auto alignment
Fe = prc: Set Chinese Font Processing
The augroup displays that an auto command group exists.
Nobackup cancel Automatic Backup
Encoding = prc sets Chinese Character Processing; otherwise, backspace deletes half Chinese Characters
Cindent: Specifies the C-format indent. The indentation is based on the shiftwidth value,
Instead of using the tabstop Value
Cino = string defines cindent behavior for special requirements,
See h cinoptions-values: h cinkeys, 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.