我无法让我的VIM正确语法突出显示php短标签。
let php_sql_query=1
let php_htmlInStrings=1
let php_noShortTags=0
let php_folding=0
let php_baselib=1
let php_asp_tags=0
let php_parent_error_close=1
let php_parent_error_open=1
"let php_sync_method=10 " Sync only 10 lines backwards
let php_alt_comparisons=1
let php_alt_assignByReference=1
已经在我的vimrc文件中全部设置了。我在noShortTags上找不到任何帮助,但是从0变为1没有任何效果。
:scriptnames
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim72/debian.vim
3: /usr/share/vim/vim72/syntax/syntax.vim
4: /usr/share/vim/vim72/syntax/synload.vim
5: /usr/share/vim/vim72/syntax/syncolor.vim
6: /usr/share/vim/vim72/filetype.vim
7: /usr/share/vim/vim72/ftplugin.vim
8: /usr/share/vim/vim72/colors/elflord.vim
9: /etc/vim/toggle.vim
10: /etc/vim/plugin/NERD_tree.vim
11: /home/rwalsh/.vim/plugin/camelcasemotion.vim
12: /usr/share/vim/vim72/plugin/getscriptPlugin.vim
13: /usr/share/vim/vim72/plugin/gzip.vim
14: /usr/share/vim/vim72/plugin/matchparen.vim
15: /usr/share/vim/vim72/plugin/netrwPlugin.vim
16: /usr/share/vim/vim72/plugin/rrhelper.vim
17: /usr/share/vim/vim72/plugin/spellfile.vim
18: /usr/share/vim/vim72/plugin/tarPlugin.vim
19: /usr/share/vim/vim72/plugin/tohtml.vim
20: /usr/share/vim/vim72/plugin/vimballPlugin.vim
21: /usr/share/vim/vim72/plugin/zipPlugin.vim
22: /usr/share/vim/vim72/syntax/php.vim
23: /usr/share/vim/vim72/syntax/html.vim
24: /usr/share/vim/vim72/syntax/javascript.vim
25: /usr/share/vim/vim72/syntax/vb.vim
26: /usr/share/vim/vim72/syntax/css.vim
27: /usr/share/vim/vim72/syntax/sql.vim
28: /usr/share/vim/vim72/syntax/sqloracle.vim
29: /usr/share/vim/vim72/ftplugin/php.vim
30: /usr/share/vim/vim72/ftplugin/html.vim
31: /etc/vim/nerdtree_plugin/exec_menuitem.vim
32: /etc/vim/nerdtree_plugin/fs_menu.vim
33: /home/rwalsh/.vim/autoload/camelcasemotion.vim
我希望php(第22行)能够处理它。我拍摄了一个屏幕截图(下图),显示了如何用长标签(第60行)和短标签(第61,62,89-92行)突出显示。
答案 0 :(得分:3)
reddit上的用户发现VIM的php sytntax只检查php_noShortTags
是否存在。只需将其注释掉或从我的.vimrc文件中删除就可以修复它。