Create your own vim-how to configure Vim

Source: Internet
Author: User

Are you tired of setting the line number, indentation, and highlighting every time you open Vim. Have you ever thought about creating your own Vim so that every time you open your vim, it can be the configuration you want? It is actually very simple, just a few steps.

Before talking about the location and basic results of the vim configuration file. If you just want to configure your own vim, you don't need to understand the vim script at all. You just need to perform the following operations. Otherwise, you need Baidu's vim script. First, after you install vim, A Vim configuration file named vimrc will be located in the/etc directory. You can run the command to check whether the file exists in LS vimrc. (I use fedora in this location. It may not be used by default in different Linux systems. Some are in the/etc/Vim/vimrc file ). This file is the vim settings of the entire system. If you change it here, the vim configurations of all users will be affected. This is what we do not want, because others' preferences may be different from yours, we only need to build our own. So in your user root directory ~ Directory. vimrc is your vim configuration file. All the changes here will only affect you. If you do not have this file in your user directory, you only need to touch it.

After explaining the location of the vim configuration file, we only need to understand the configuration rules. In the. vimrc file, the line starting with double quotation marks is followed by a comment. Commands are the same as the commands in VIM command mode. For example, if I want my vim to display the row number when I open it, I just need to add a set nu line in this file, which is easy. The following is my.. vimrc configuration. For more information, see create your own vim.

 

 

 

"Syntax high light <br/> syntax on <br/>" show the line number <br/> set nu <br/> "Let the tabstop equal 4 <br/> set tabstop = 4 <br/> "set the autoindent on <br/> set autoindent <br/>" set the match time is one tenth second <br/> set matchtime = 1 <br/> "high light the search <br/> set hlsearch <br/>" set the C language indent format <br/> set cindent <br/> "set the indent width <br/> set shiftwidth = 4 <br/> "set show status on <br/> set ruler <br/>" set show mode on <br/> set showmode <br /> 

Command sorting CLICK:

Http://www.360disk.com/file-37059.html

From smart phone recommendation Network

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.