Detailed explanation of how to set PHP automatic indentation to 4 spaces in VIM_PHP Tutorial

WBOY
Release: 2016-07-21 15:06:30
Original
884 people have browsed it

The code is naturally indispensable for the text editing tool vim. Automatic indentation uses tab characters. Even if you delete the tab characters and change it to 4 spaces, the tab characters will continue to be used in the next level of indentation, which results in spaces. Mixing

with tab characters can modify the etc/vimrc information:

The meaning of the relevant variables:
Variable name Abbreviation Meaning
(no)autoindent ai Automatic indentation, that is New lines automatically add the same indent as the current line.
(no)cindent ci Similar to the indentation of C language programs
(no)smartindent si Some improvements based on autoindent

Variable name
Abbreviation Meaning
tabstop=X ts How many spaces does a TAB character occupy during editing.
shiftwidth=X sw Use the number of spaces per level of indentation.
(no)expandtab (no)et Whether to automatically expand the input TAB into spaces. To enter TAB after opening, you need Ctrl-V
softtabstop=X sts It is convenient to use backspace after opening et. key, each backspace will delete X spaces
(no)smarttab sw spaces, otherwise add ts spaces.

http://www.bkjia.com/PHPjc/327616.html

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327616.htmlTechArticleThe code is naturally indispensable for the text editing tool vim. Automatic indentation uses tabs, even if you delete the tabs yourself If the tab character is changed to 4 spaces, the tab character will continue to be used in the next level of indentation, which creates...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template