How to set the tab indent---Configuration initialization settings in VIM

Source: Internet
Author: User

Problem:

Linux System, Tab key defaults to 8 characters, you need to change it to 4 characters in a way that uses

Steps:

1. Create a system file with a. vimrc file name under the user's root

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/77/ED/wKioL1ZxQ3zxjVhEAAAVaoxBUfE164.png "title=" 1.PNG " Style= "Float:none;" alt= "Wkiol1zxq3zxjvheaaavaoxbufe164.png"/>

[Email protected] ~]# CD ~

[Email protected] ~]# pwd

/root

[[email protected] ~]# vim. VIMRC

2. Enter the following contents in the file and save

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/77/ED/wKioL1ZxQ3zTphd_AAAFPdle50w416.png "title=" 2.PNG " Style= "Float:none;" alt= "Wkiol1zxq3ztphd_aaafpdle50w416.png"/>

Input content:

Set tabstop=4

Set shiftwidth=4

Description

TabStop represents the length of a tab that shows how many spaces are, by default, 8.

Shiftwidth indicates the length of each level indent

Summarize:

1.vim configuration files need to be built themselves, as hidden files

2. the . VIMRC configured under the current user is valid only for the current user

3. in .VIMRC file We can customize a variety of initialization settings, each time you open vim is reading the configuration file

1). Line number: Set Number,set nu ;

2). parentheses match highlighting: set Showmatch, set SM ;

3). Auto Indent: set AI ;

4). Highlight Search results: Set Hlsearch ;

5). syntax Highlighting: Syntax on ;

6). Ignore character case: s et ICS ;




This article is from the "Xu Ding blog" blog, make sure to keep this source http://xuding.blog.51cto.com/4890434/1725376

How to set the tab indent---Configuration initialization settings in VIM

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.