Ⅰ. 插件描述
Vim PhpSpec integration which reads phpspec.ymlⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'rafi/vim-phpspec'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'rafi/vim-phpspec'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'rafi/vim-phpspec'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/rafi/vim-phpspec
Ⅳ. 文档说明
# vim-phpspec
Vim PhpSpec integration which reads phpspec.yml file from current-working
directory.
Features
- Reads phpspec.yml
- Switch to spec/class
- Run current/all specs
- Uses vimproc if available
- Tiny. ~200LoC
Dependencies
- vim +python - Verify with
:echo has('python')(output should be1) - [python2-yaml]
Installation
Use your favorite plugin manager.
Commands
:PhpSpecRun- Runs all spec suites. (_Default mapping:_<Leader>spr):PhpSpecRunCurrent- Runs current spec. (_Default mapping:_<Leader>spc):PhpSpecSwitch- Switch to spec or class file, confirms spec creation if- (_Default mapping:_
<Leader>sps)
- (_Default mapping:_
Options
Put any of the following options into your ~/.vimrc in order to overwrite the default behaviour.
| Option | Default | Description |
|---|---|---|
g:phpspec_executable | Auto-detect | Path to phpspec executable |
g:phpspec_default_mapping | 1 | Set to 0 to disable default key-mappings |
Credits & Contribution
Inspiration:
- [Herzult/phpspec-vim]
- [shawncplus/phpcomplete.vim]
This plugin was developed by Rafael Bodill under the [MIT License].