【问题标题】:Vim auto indent of HTML in PHP filetype not workingPHP文件类型中HTML的Vim自动缩进不起作用
【发布时间】:2011-06-01 05:12:43
【问题描述】:

我已经使用 Vim 很长时间了,我从不担心自动缩进,而且它总是关闭。但现在我需要尝试自动缩进并启用它。

我遇到一个奇怪的问题,即 .php 文件中的 HTML 自动缩进无法正常工作。它确实适用于 .html 文件,但不适用于 .php 文件。我已经尝试了所有可以在 Google 或 Stack Overflow 上找到的解决方案。

我尝试了以下方法:

对我有用的唯一解决方案是以下,但它破坏了 php 自动缩进:

http://www.vim.org/scripts/script.php?script_id=604

Vim 版本为:VIM - Vi IMproved 7.2(2008 年 8 月 9 日,编译 2010 年 9 月 28 日 07:11:04)

这些是我打开 php 文件时加载的缩进脚本:

  • 47: /usr/share/vim/vim72/indent/html.vim
  • 48: /usr/share/vim/vim72/indent/php.vim

我也尝试了 spf-13 vim 包,但它也没有在 php 中缩进 html。

【问题讨论】:

    标签: php html vim auto-indent


    【解决方案1】:

    尝试以下链接,它似乎对我有用:

    https://github.com/2072/PHP-Indenting-for-VIm - 纯 PHP

    如果你想尝试 PHP + HTML,那么

    http://vim.wikia.com/wiki/Better_indent_support_for_php_with_html

    【讨论】:

    猜你喜欢
    • 2011-04-25
    • 1970-01-01
    • 2011-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-24
    • 2023-04-01
    相关资源
    最近更新 更多