How to Set PHP auto indent to 4 spaces in VIM

Source: Internet
Author: User

CodeNaturally, the text editing tool Vim is indispensable. Automatic indentation uses tabs. Even if you delete the tabs and change them to four spaces, the tabs will continue to be used in the next level of indentation, this causes a mix of spaces and tabs.

You can modify the ETC/vimrc information:

Meanings of related variables:
Abbreviation of variable nameDescription
(No) autoindent AIAuto indent: the new line is automatically added with the same indentation as the current row.
(No) cindent CiSimilar to C LanguageProgramIndent
(No) smartindent SiImprovements based on autoindent

Variable nameAbbreviationsDescription
Tabstop = x TSThe number of spaces occupied by a Tab character during editing.
Shiftwidth = x SWNumber of spaces Indented by each layer.
(No) expandtab (NO) etWhether to automatically expand the input tab into spaces. Enter a tab after enabling. CTRL-v <tab> is required.
Softtabstop = X STSAfter et is enabled, the backspace key is used to delete x spaces.
(No) smarttab (NO) staWhen it is enabled, tab at the beginning of the line will add SW spaces, otherwise 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.