===================
Next generation JavaScript and React snippets for Vim Require garbas/vim-snipmate
=============
Use Vundle
" vim-babel-snippets:
Bundle "huangguozhen/vim-babel-snippets"
" SnipMate and its dependencies:
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
Bundle "garbas/vim-snipmate"
" Other sets of snippets (optional):
Bundle "honza/vim-snippets"
======
In insert mode
rcc<Tab>
expanding to
import React, { Component, PropType } from 'react'
export default class ClassName extends Component {
render () {
return (
)
}
}
Trigger | Content |
---|---|
rcc→ |
class component skeleton |
rccl→ |
legacy component skeleton |
cdm→ |
componentDidMount() {…} |
cdup→ |
componentDidUpdate(prevProps, prevState) {…} |
cwm→ |
componentWillMount() {…} |
cwr→ |
componentWillReceiveProps(nextProps) {…} |
cwun→ |
componentWillUnmount() {…} |
cwup→ |
componentWillUpdate(nextProps, nextState) {…} |
fdn→ |
React.findDOMNode(…) |
gdp→ |
getDefaultProps() {…} |
gis→ |
getInitialState() {…} |
ren→ |
render() {…} |
sst→ |
this.setState(…) |
scu→ |
shouldComponentUpdate(nextProps, nextState) {…} |
props→ |
this.props |
state→ |
this.state |