Vim Set the PHP automatic indent to 4 spaces method detailed _php tips

Source: Internet
Author: User
The code naturally without the text editor vim, automatic indentation is tab, even if you delete the tab changed to 4 spaces, the next level indent will continue to use tabs, which caused the Space and tab mix

Information that can be modified, ETC/VIMRC:

The meaning of the related variables:
variable name abbreviation meaning
(NO) autoindent ai Auto indent, which automatically adds the same indentation as the current row for the new row.
(NO) cindent ci Similar to C language program indentation
(NO) smartindent si Some improvements based on autoindent

variable name abbreviation Meaning
tabstop=x ts The position of how many spaces a tab character occupies when editing.
shiftwidth=x SW        Use the number of spaces indented per layer.
(NO) expandtab (NO) et Whether to automatically expand the input tab into spaces. To enter TAB after opening, you need to ctrl-v<tab>
softtabstop=x sts Easy to use the BACKSPACE (BACKSPACE) key after the ET is turned on, each backspace will remove x spaces
(NO) smarttab (NO) STA When opened, press TAB at the beginning of the line to add SW spaces, or add TS spaces.
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.