Ⅰ. 插件描述
Snippets for React +ES7 +MochaⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'alexbyk/vim-ultisnips-react'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'alexbyk/vim-ultisnips-react'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'alexbyk/vim-ultisnips-react'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/alexbyk/vim-ultisnips-react
Ⅳ. 文档说明
# vim-ultisnips-react
Vim UltiSnips snippets for React using modern ES6 syntax
You must follow the convention: MyComponent's source file is MyComponent.js and the test for it is MyComponent.spec.js or MyComponent.test.js in the same directory. This allows to generate variables and classes
Snippets r...
Snippets for react components
rc- boilerplate for React Componentrcf- boilerplate for React Component as pure Functionrfdn- React.findDOMNoderpt... - PropTypes records
rptr- PropTypes.[$1].isRequiredrptar- PropTypes.array.isRequiredrptbr- PropTypes.bool.isRequiredrptfr- PropTypes.func.isRequiredrptnr- PropTypes.nnumber.isRequiredrptor- PropTypes.object.isRequiredrptsr- PropTypes.string.isRequiredrpter- PropTypes.element.isRequired
Other types will be (or won't be) implemented soon. Pull requests are welcome
Snippets rt...
Snippets for react tests.
rtc- creates test boilerplate for Componentrtr- TestUtils.renderIntoDocumentrtfrdct- TestUtils.findRenderedDOMComponentWithTagrtfrdcc- TestUtils.findRenderedDOMComponentWithClassrtfrct- TestUtils.findRenderedComponentWithTypertsrdct- TestUtils.scryRenderedDOMComponentsWithTagrtsrdcc- TestUtils.scryRenderedDOMComponentsWithClassrtsrct- TestUtils.scryRenderedComponentsWithType
Installation
Using Vundle:
" install UltiSnips
Plugin 'SirVer/ultisnips'
"let g:UltiSnipsExpandTrigger="<C-J>" "(optional) CTRL-J instead of TAB to avoid conflicts with YCM
Plugin 'alexbyk/vim-ultisnips-react'