doylem / vim-react-snippets

CJSX friendly Vim snippets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vim-react-snippets

A set of snippets for Vim to work with Facebook's React library.

A direct port of the awesome snippets from jgebhardt/sublime-react.

Requires vim-snipmate.

Installation

Use your preferred Vim plugin installation method. I use pathogen.

Usage

Within any Javascript, JSX or CJSX file, you should be able to do the following:

(in insert mode)

gdp<Tab>

expanding to (JSX)

getDefaultProps: function() {
  return {
    $1
  };
},

or (CJSX)

getDefaultProps: ->
  $1

And a bunch of others! Check snippets/javascript.snippets and snippets/coffee.snippets to see the full list.

About

CJSX friendly Vim snippets

License:Apache License 2.0