Vim practice manual (1) Basic personalized configuration of your vim

Source: Internet
Author: User

Reprinted please indicate this blog from "LIU Da csdn blog": http://blog.csdn.net/poechant

1. What is Vim?


Vim is VI improved, an enhanced version of the editor VI. It is extremely powerful and complies with SE (software)
Engineer, Software Engineer) used editor. If you are a professional se, you must be looking for an excellent editor that can be customized and flexibly edited. The answer is vim or Emacs. This continuous blog will introduce you to the vim editor. As for another powerful editor Emacs, we will see it in a series of blog posts in the future.

2. Where is the configuration file?

If you are using Windows, the configuration file is the vimrc file under your vim installation directory.


If you are using a Linux system and installed with APT-Get by default, your configuration file is/usr/share/Vim/vimrc.


If you are using Mac OS X, the configuration file is/usr/share/Vim/vimrc.

3. What does RC in vimrc mean?


Why is this meaningless question also listed? The reason is very simple, that is, the second question I want to ask at the beginning of my exposure to VIM is this (the first is the above "1 "). Generally, when running a software, environment, or tool, some commands that need to be initially executed are called run
Commands, that is, RC. According to wikipedia.org, the RC abbreviation is derived from MIT's compatible time-based operating system (compatible ).
Time-sharing system, ctss) [Reference 1]. So if you see systemrc or screenrc later, you will know why.

4. Three basic modes


In "everyone learns Vim", we mentioned that Vim has 6 + 5 models. However, apart from the degree of subdivision, there are actually only three common modes: normal.
Mode, insert mode, and command-line mode.


From normal mode to insert mode, you can press I, I, a, a, O, O, R, R. I and I represent insert, R and R represent replace ).


From insert mode to normal mode, you only need to press ESC.


From normal mode to command-line mode, you can press ":", "/", and "?". ":" Indicates the vim command, "/" indicates the string to be searched down, "?" Indicates that the string to be searched up is entered later.


From command-line mode to normal mode, you only need to press ESC.

You can understand normal mode as normal. To enter any other mode, you need a special method, while returning from other special modes to normal.
Press the ESC key.

5. The most common configurations in VIM


When you try to Google the vimrc configurations of some other people, you will find an article called
The article ultimate Vim configuration, but its author amix later mentioned in his blog [Reference 2]. This article will rank among the top 10 Vim configuration files in Google's search for vimrc, now it is out of date, so he provides some updates.

(1) color settings

Syntax on "Enable code highlighting syntax off" disable code highlighting syntax enable "Enable code highlighting

(2) Search Settings

Set hlsearch "enable search highlight set nohlsearch" Disable search highlight set incsearch "Enter search strings and search for set ignorecase" Case Insensitive during search

(3) User Interface

Set showmode "enable Mode show set Ru" enable cursor position prompt set number "show row number set Nonu" do not show row number set cursorline "emphasize that the row where the cursor is located set depth Height = 1" command part height is 1

(4) edit the auxiliary Configuration

Set autoindent "automatic indent set noautoindent" set smartindent "smart indent set autoread" when the file is changed externally, VIM automatically updates and loads set showmatch "displays matching parentheses

Refer:

[1] Run commands, http://en.wikipedia.org/wiki/Run_commands

[2] The ultimate Vim configuration (vimrc), http://amix.dk/blog/post/19486

Reprinted please indicate this blog from "LIU Da csdn blog": http://blog.csdn.net/poechant

-

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.