Reformat a Python file to have 4 space indentations

前端 未结 7 1471
灰色年华
灰色年华 2020-12-23 16:39

I\'m editing a Python file that uses two spaces for programmatic indents - I prefer 4 spaces. In my .vimrc I have the following settings related to indentation:

<         


        
7条回答
  •  無奈伤痛
    2020-12-23 16:52

    In order to double the number of spaces at the beginning of every line (and only at the beginning):

    :%s/^\s*/&&/g
    

    & in replacement pattern is the matched pattern.

    Probably it will not have any side-effect for you.

提交回复
热议问题