Ⅰ. 插件描述
The bleeding edge PHP syntax file!Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'joshtronic/php-vim-come-back-be-here'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'joshtronic/php-vim-come-back-be-here'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'joshtronic/php-vim-come-back-be-here'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/joshtronic/php.vim
Ⅳ. 文档说明
# php.vim
This project is a fork of php.vim which is an improved version
of php.vim--Garvin which in turn is an update of the
php.vim script which in turn is an updated version of the php.vim
syntax file distributed with Vim.
The point of this fork is to embrace the latest and greatest PHP has to offer
and constantly update against the latest PHP release.
Last updated against 5.5.17
Improvements
- Spell checking was enabled in strings and comments (both single and
multi-line). - Spell checking was enabled in heredocs, e.g.,
<<<EOD. - The PHP built-in and extension-provided functions list was updated for
PHP 5.3. - Compatibility with html5.vim.
- Support for not-so-common extensions was turned off, e.g.,
mssql_*. - Basic support for PHP 5.4 syntax was added.
- Support was added for PHP 5.5.7
- New modules added: memcache, memcached, redis, test_helpers and xdebug
- Support for static classes and docblock parameters (patched by @kris89)
Customising
A script update_syntax.php is provided to re-generate the syntax file.
A single variable $allowed_extensions can be customised to
turn on/off certain extensions.
When re-generating the syntax file, you must have allowed extensions
installed.
Original README
This is an updated version of the php.vim syntax file distributed with VIM.
The list of PHP constants, functions, and classes was updated to be current
with PHP 5.3. Many new classes were added in the 5.2 branch and the
distributed version only covers up to 5.1.4. In addition I simplified the
file, removing several sections that are not often used (at least by me)
such as automatic folding of all control structures and ASP tags support. I
also removed several switches designed for b/c with VIM 5.X and 6.X. As an
addition I have included the PHP file I used to generate the constant,
function, class list. It uses reflection to mine out these items from your
PHP installation and generate part of the php.vim script. Before running
open up the file and adjust the output file location and the list of
extensions to generate syntax for. Then run "php php_vimgen.php" from your
shell.