Writing code is naturally 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 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:
Variable name |
Abbreviations |
Description |
(No) autoindent |
AI |
Auto indent: the new line is automatically added with the same indentation as the current row. |
(No) cindent |
Ci |
Indentation similar to C Language Programs |
(No) smartindent |
Si |
Improvements based on autoindent |
Variable name |
Abbreviations |
Description |
Tabstop = x |
TS |
The number of spaces occupied by a Tab character during editing. |
Shiftwidth = x |
SW |
Number of spaces Indented by each layer. |
(No) expandtab |
(No) et |
Whether to automatically expand the input tab into spaces. Enter a tab after enabling. CTRL-v <tab> is required. |
Softtabstop = x |
STS |
After et is enabled, the backspace key is used to delete x spaces. |
(No) smarttab |
(No) sta |
When it is enabled, tab at the beginning of the line will add SW spaces, otherwise add ts spaces. |