Skip to content

justinj/vim-react-snippets

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

vim-react-snippets

A set of snippets for Vim to work with Facebook's React library. This fork change the snippet syntax to ES6. Remove semicolon and comma. I also remove snippets related to react-classset as it is deprecated now.

Require UltiSnips. I only update the UltiSnips version. Pull requests for vim-snipmate version are welcome.

Installation

Use your preferred Vim plugin installation method. For me, I like vim-plug. If you also using vim-plug, put the following into your .vimrc.

Plug 'SirVer/ultisnips'

" Currently, es6 version of snippets is available in es6 branch only
Plug 'letientai299/vim-react-snippets', { 'branch': 'es6' }

Plug 'honza/vim-snippets' "optional

Usage

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

(in insert mode)

gdp<Tab>

expanding to

getDefaultProps() {
    return {

    };
},

Another example:

rcx<Tab>

Expanding to

class ClassName extends React.Component {
  render(){
    return (

    )
  }
}

And a bunch of others!

Check ./UltiSnips/javascript.snippets to see the full list.

About

Vim version of the snippets from jgebhardt/sublime-react

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published