Correct indentation of HTML and PHP using Vim

前端 未结 10 487
悲&欢浪女
悲&欢浪女 2020-11-29 20:02

I\'ve been using Vim for a while, and I can\'t get proper HTML indentation working in PHP files.

For example, what I want is for each child to be indented one tab mo

10条回答
  •  醉话见心
    2020-11-29 20:14

    In your ~/.vimrc file:

    set expandtab
    set sw=4
    set ts=4
    

    The expandtab option will convert tabs to spaces, the sw option sets your shift width to 4 and the ts sets tab stop to 4 spacs.

提交回复
热议问题