For example, if you look at this code, notice that the < li > tag is preceded by three spaces, and my vim settings are as follows
set tapstop=4 set softtabstop=4 set shiftwidth=4
The reason why the < li > tag has three spaces before it is because I changed someone else’s code, and I don’t want to mess up the original indentation.
<ul> <li>**光标所在处，在此处回车** </li> </ul>
Press enter at the position marked above, < li > the three spaces in front of this label will be replaced by tab, as shown in the figure
How can I solve the problem of changing the indent of the previous line?
“Spaces replace tab, this is the point
“Indent 3 characters
set shiftwidth=3 softtabstop=3
“The following is about the control of automatic indentation. If you don’t like automatic indentation, you can turn it off.
” Smart indet
” C-style indeting
You can also use modeline without modifying your vim configuration. Please refer to:http://vim.wikia.com/wiki/Modeline_ma …