vim-ultisnips-react


Ⅰ. 插件描述

Snippets for React +ES7 +Mocha

Ⅱ. 基本信息

创建日期:  2015-08-09
使用用户:  2
Github星:  5
插件作者:  alexbyk

Ⅲ. 安装方法

使用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 Component
  • rcf - boilerplate for React Component as pure Function
  • rfdn - React.findDOMNode
  • rpt... - PropTypes records

    • rptr - PropTypes.[$1].isRequired
    • rptar - PropTypes.array.isRequired
    • rptbr - PropTypes.bool.isRequired
    • rptfr - PropTypes.func.isRequired
    • rptnr - PropTypes.nnumber.isRequired
    • rptor - PropTypes.object.isRequired
    • rptsr - PropTypes.string.isRequired
    • rpter - 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 Component
  • rtr - TestUtils.renderIntoDocument
  • rtfrdct - TestUtils.findRenderedDOMComponentWithTag
  • rtfrdcc - TestUtils.findRenderedDOMComponentWithClass
  • rtfrct - TestUtils.findRenderedComponentWithType
  • rtsrdct - TestUtils.scryRenderedDOMComponentsWithTag
  • rtsrdcc - TestUtils.scryRenderedDOMComponentsWithClass
  • rtsrct - 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'

添加新评论