Skip to content

ziyan-junaideen/vim-react-snippets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-react-snippets for Ultisnip

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.

Dependencies

Installation

Use your preferred Vim plugin installation method. There are many plugin managers you can use for this or go manual.

for vundle:

Plugin 'SirVer/ultisnips'
Plugin 'ziyan-junaideen/vim-react-snippets'
Plugin 'honza/vim-snippets' "optional"

for vim-plug:

Plug 'SirVer/ultisnips'
Plug 'ziyan-junaideen/vim-react-snippets'
Plug 'honza/vim-snippets' "optional

Usage

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

(in insert mode)

div.<Tab>

expands to

<div className="name">
</div>

and

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.

Thanks

This is not entirely my work, just copied existing stuff to make my life easy and will be glad if you enjoyed.

Twitter: @ZiyanJunaideen

About

Vim version of the snippets from jgebhardt/sublime-react

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published