Correct indentation of HTML and PHP using Vim

前端 未结 10 474
悲&欢浪女
悲&欢浪女 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:38

    There is a set of vimrc instructions on the Vim Wiki called Better indent support for PHP with HTML that will use the correct plugin depending on the block.

    There is also a Vundle/Pathogen Plugin that uses the same code but is easier to install and keeps your .vimrc clean.

    Pathogen

    cd ~/.vim/bundle
    git clone https://github.com/captbaritone/better-indent-support-for-php-with-html.git
    

    Vundle

    Place in .vimrc

    Bundle 'captbaritone/better-indent-support-for-php-with-html'
    

    Run in vim

    :BundleInstall
    

提交回复
热议问题