gvim - The problem of the indentation of the previous line changing after a new line when vim edits the html file
世界只因有你
世界只因有你 2017-05-16 16:42:52
0
1
719

For example, take this code. Note that there are three spaces in front of the <li> tag, and my vim settings are as follows

set tapstop=4
set softtabstop=4
set shiftwidth=4

The reason why there are three spaces in front of the <li> tag is because I am changing someone else’s code and I don’t want to mess up the original indentation

<ul>
   <li>**光标所在处,在此处回车**
   </li>
</ul>

Enter at the marked position above, <li>the three spaces in front of this label will be replaced with tabs, as shown in the figure

How to solve this problem of changing the indentation of the previous line by changing the line?

世界只因有你
世界只因有你

reply all(1)
左手右手慢动作

" Use spaces instead of tabs, this is the key point
set expandtab

" 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.
"Auto indent
set ai

" Smart index
set si

" C-style indeting
set cindent

You can also use modeline form without modifying your vim configuration, refer to: http://vim.wikia.com/wiki/Modeline_ma...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!