epilande / Vim React Snippets
✂️ React code snippets for vim
Stars: ✭ 268
Programming Languages
es2015
71 projects
Projects that are alternatives of or similar to Vim React Snippets
pymolsnips
Pymolsnips is a library of PyMOL scripting language code fragments for several popular text editors.
Stars: ✭ 19 (-92.91%)
Mutual labels: snippets
snippet-box
Snippet Box is a simple self-hosted app for organizing your code snippets. It allows you to easily create, edit, browse and manage your snippets in various languages.
Stars: ✭ 437 (+63.06%)
Mutual labels: snippets
Desktop
A comprehensive solution for convenient and efficient work with notes, snippets, clipboard, files, and other information that requires quick access via any device.
Stars: ✭ 123 (-54.1%)
Mutual labels: snippets
unitscss
UNITS is a simple and beautiful CSS component set.
Stars: ✭ 13 (-95.15%)
Mutual labels: snippets
Xylitol-MASM32-snippets
MASM32 Code collection for reverse engineers
Stars: ✭ 119 (-55.6%)
Mutual labels: snippets
React Native Snippets
✏️ A collection of React Native snippets for Sublime Text and Atom
Stars: ✭ 257 (-4.1%)
Mutual labels: snippets
java-design-patterns-web
Java Design Patterns website at https://java-design-patterns.com
Stars: ✭ 81 (-69.78%)
Mutual labels: snippets
vscode-ampscript
This extension allows you to connect Visual Studio Code directly to your MC Account, enables syntax highlighting for AMPScript, has built-in documentation for all AMPScript functions and also adds code snippets for language elements and functions.
Stars: ✭ 37 (-86.19%)
Mutual labels: snippets
30-seconds-of-code-texteditorsnippets
Files to import the 30-seconds-of-code snippets into VSCode, Atom and Sublime.
Stars: ✭ 35 (-86.94%)
Mutual labels: snippets
mobly-bundled-snippets
Snippets to allow Mobly tests to control Android devices by exposing a simplified Android API.
Stars: ✭ 25 (-90.67%)
Mutual labels: snippets
awesome-ecommerce
Collect and develop Open Source or Free Projects for building ecommerce platform easy and fast and free
Stars: ✭ 39 (-85.45%)
Mutual labels: snippets
pytips
Python Tips contains code snippets that will help you learn Python
Stars: ✭ 179 (-33.21%)
Mutual labels: snippets
steemsnippets
A collection of snippets for steem programming
Stars: ✭ 44 (-83.58%)
Mutual labels: snippets
Graphql For Vscode
GraphQL syntax highlighting, linting, auto-complete, and more!
Stars: ✭ 265 (-1.12%)
Mutual labels: snippets
GDL-sublime
📝 A Sublime Text package for the programming language GDL (Geometric Description Language)
Stars: ✭ 25 (-90.67%)
Mutual labels: snippets
Vim React Snippets
A Vim snippet library for React in ES6. You may also want to check out vim-es2015-snippets.
Requires UltiSnips.
Installation
Using vim-plug:
" ES2015 code snippets (Optional)
Plug 'epilande/vim-es2015-snippets'
" React code snippets
Plug 'epilande/vim-react-snippets'
" Ultisnips
Plug 'SirVer/ultisnips'
" Trigger configuration (Optional)
" let g:UltiSnipsExpandTrigger="<C-l>"
Usage
In a JavaScript or JSX file, type a trigger name while in Insert mode, then press Ultisnips trigger key. In my case I have it mapped to <C-l>
.
For example, let's say we have ListItem.js
In Insert mode
rfc<C-l>
Will expand to
import React from 'react';
import PropTypes from 'prop-types';
import styles from './ListItem.css';
function ListItem({ ...props }) {
return (
<div className={styles.base}>
</div>
);
}
ListItem.defaultProps = {
};
ListItem.propTypes = {
};
export default ListItem;
Check out UltiSnips/javascript.snippets
to see all snippets.
Snippets
Skeleton
Trigger | Content |
---|---|
rrcc→ |
React Redux Class Component |
rcc→ |
React Class Component |
rfc→ |
React Functional Component |
rsc→ |
React Styled Component |
rsci→ |
React Styled Component Interpolation |
Lifecycle
Trigger | Content |
---|---|
cwm→ |
componentWillMount() {...} |
cdm→ |
componentDidMount() {...} |
cwrp→ |
componentWillReceiveProps(nextProps) {...} |
scup→ |
shouldComponentUpdate(nextProps, nextState) {...} |
cwup→ |
componentWillUpdate(nextProps, nextState) {...} |
cdup→ |
componentDidUpdate(prevProps, prevState) {...} |
cwu→ |
componentWillUnmount() {...} |
ren→ |
render() {...} |
PropTypes
Trigger | Content |
---|---|
pt→ |
propTypes {...} |
pt.a→ |
PropTypes.array |
pt.b→ |
PropTypes.bool |
pt.f→ |
PropTypes.func |
pt.n→ |
PropTypes.number |
pt.o→ |
PropTypes.object |
pt.s→ |
PropTypes.string |
pt.no→ |
PropTypes.node |
pt.e→ |
PropTypes.element |
pt.io→ |
PropTypes.instanceOf |
pt.one→ |
PropTypes.oneOf |
pt.onet→ |
PropTypes.oneOfType (Union) |
pt.ao→ |
PropTypes.arrayOf (Instances) |
pt.oo→ |
PropTypes.objectOf |
pt.sh→ |
PropTypes.shape |
ir→ |
isRequired |
Others
Trigger | Content |
---|---|
props→ |
this.props |
state→ |
this.state |
set→ |
this.setState(...) |
dp→ |
defaultProps {...} |
cn→ |
className |
ref→ |
ref |
pp→ |
${props => props} |
Hooks
Trigger | Content |
---|---|
us.s→ |
const [state, setState] = useState(''); |
us.e→ |
useEffect(() => { }); |
us.er→ |
useEffect(() => { return () => {}; }); |
us.c→ |
const context = useContext(ctx); |
us.r→ |
const [store, dispatch] = useReducer(storeReducer, initialState); |
us.cb→ |
useCallback(() => { }, []); |
us.m→ |
const memo = useMemo(() => { }, []); |
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].