基于Vim语法的PHP折叠 [英] Vim syntax based folding with php
问题描述
我已经下载了php.vim文件,其中包含基于PHP的语法信息.它应该能够提供基于语法的折叠,但是由于某种原因我无法使其工作.
I have downloaded php.vim file, which contains PHP-based syntax information. It should be able to provide syntax based folding, but I can't make it work for some reason.
我设置了:let g:php_folding 2
和:set foldmethod=syntax
,但无济于事.我很确定文件在正确的位置并且可以被vim读取,因为我可以做到:let g:php_sql_query=1
正常工作.
I have set :let g:php_folding 2
and :set foldmethod=syntax
but for no avail. I'm pretty sure the file is in right place and is read by vim, since I can do :let g:php_sql_query=1
which works.
php.vim
文件位于~/.vim/syntax/php.vim
推荐答案
显然我的VIM没有运行:syntax enable.
Apparently my VIM didn't run :syntax enable.
使用:syntax启用可解决此问题,但我还对.vimrc添加了:syntax
Doing :syntax enable fixed the problem, but I also added :syntax on to .vimrc
这篇关于基于Vim语法的PHP折叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!