Ⅰ. 插件描述
Vim compiler/makegreen integration for LettuceⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'striglia/vim-lettuce'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'striglia/vim-lettuce'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'striglia/vim-lettuce'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/striglia/vim-lettuce
Ⅳ. 文档说明
Basic integration for vim-makegreen and lettuce
The most basic installation requires:
- vim-makegreen installed in ~/.vim/plugin/makegreen.vim
- lettuce.vim installed in ~/.vim/compiler/lettuce.vim
- lettuce installed (pip install lettuce)
- lettuce tests written and living in ./features and its subdirectories
- the lettuce_tests script is accessible via your current system PATH
- the lines from the attached .vimrc in your .vimrc
Then, if vim is currently editing a file matching *.py, you can hit <leader>l to run lettuce automatically. This will report either a green bar (success) or red bar (one or more failures) at the bottom of vim. You can then open the quickfix window which will be populated with the relevant errors.
Caveats:
- Lettuce currently assumes that you are standing in your code's base directory and all lettuce feature/step files lie in ./feature and its subdirectories. This is obnoxious.
- The contents of lettuce_tests are hacky and could almost certainly be improved. The goal was simply to avoid returning a line inside lettuce's core files for every error.