Reformat a Python file to have 4 space indentations

前端 未结 7 1498
灰色年华
灰色年华 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:41

    try the following substitution command:

    :%s/  /    /g
    

    (To clarify: there are two spaces between the first and second '/' and four the second and third '/'.)

    One helpful command when working with whitespace issues is also the set list command which will visually show all whitespace. Use set nolist to unset.

提交回复
热议问题