Correct indentation of HTML and PHP using Vim

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

    inside your .vimrc:

    :function IndentPHPHTML()
    :  set ft=html
    :  normal gg=G
    :  set ft=php
    :endfunction
    

    use ctrl-shift-L (or whatever) to indent

    nnoremap  :call IndentPHPHTML()
    

提交回复
热议问题