How to set php auto indent to 4 spaces in VIM _ PHP Tutorial

Source: Internet
Author: User
How to set php auto indent to 4 spaces in VIM. The code is naturally indispensable to the text editing tool vim. 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 makes the code indispensable to text editing tool vim. Automatic indentation uses TABs. even if you delete the tabs and change them to four spaces, the tabs will 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 ciIndentation similar to C language programs
(No) smartindent siImprovements based on autoindent

Variable name AbbreviationsDescription
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 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.

...

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.