My Vim configuration (with comments)

Source: Internet
Author: User

My Vim configuration (with annotations) is relatively simple and practical, and will be updated continuously in the future based on the function addition.

If you need to copy the following content to the. vimrc file in the user's home directory, restart vim. For example, if the current Linux user name is Andy, the default home directory is/home/Andy. You can also use CD ~ in the command line ~ Command to enter; 2. the. vimrc file is a hidden file, which can be viewed through the LS-l command in the home directory.

"Begin "-------------------------------------------------------------------------------------
"General
"Begin "-------------------------------------------------------------------------------------
Set nocompatible "cancel compatibility mode
Set history = 50 "Number of historical records
Set number "display row number
Set confirm "when processing unsaved or read-only files, a confirmation prompt is displayed.

"Begin "-------------------------------------------------------------------------------------
"Colors
"Begin "-------------------------------------------------------------------------------------
Syntax on "syntax highlighting
Set cursorline "highlights the current row, and the current row displays a long line
Set background = Dark "Dark Background display

"Begin "-------------------------------------------------------------------------------------
"Vim UI
"Begin "-------------------------------------------------------------------------------------
Set rcursor "displays the cursor position in the status bar
Set mouse = A "with the mouse function, you can use the mouse to position the cursor
Set lazyredraw "Do not redraw while executing macros (much faster)
Set minimum height = 2 "the height of the command line used to enter the command at the bottom. The default value is 1.
Set backspace = 2 "enable the backspace key to process indent, start, and so on.
Set scroloff = 10 "the number of rows retained at the top/Bottom of the screen when the cursor is down. If the cursor is equal to this function, the page will scroll.
Set laststatus = 2 "display status bar Information

"Begin "-------------------------------------------------------------------------------------
"Text Formatting/Layout
"Begin "-------------------------------------------------------------------------------------
Set ai "autoindent (inheriting the indent method of the previous line, applicable to multiline comments)
Set Si "smartindent (provides automatic indentation for C Programs)
Set cindent "C style indent
Set tabstop = 4 "tab key width
Set shiftwidth = 4 "unified indent
Set softtabstop = 4 "unified indent
Set noexpandtab "actually uses TAB characters. Do not replace them with spaces.
Set smarttab "automatically uses the tab at the beginning of the line

"Begin "-------------------------------------------------------------------------------------
"Text searching/Matching
"Begin "-------------------------------------------------------------------------------------
Set showmatch "shows matching symbols, such as (), {}, etc.
Set matchtime = 5 "1/10 second to show the matching Paren
Case Insensitive for set ignorecase search
Set nohlsearch "Do not highlight search strings (I .e., after you press Enter)
Set incsearch "highlight when searching for input strings (that is, if you do not press Enter)

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.