mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
snippet ir
|
||||
import React from 'react';
|
||||
snippet irc
|
||||
import React, {Component} from 'react';
|
||||
import React, { Component } from 'react';
|
||||
snippet ird
|
||||
import ReactDOM from 'react-dom';
|
||||
snippet cdm
|
||||
@ -42,11 +42,24 @@ snippet pt
|
||||
static propTypes = {
|
||||
${1}: React.PropTypes.${2:type},
|
||||
}
|
||||
snippet rfc
|
||||
const ${1:ComponentName} = (${2:props}) => {
|
||||
return (
|
||||
<div>
|
||||
$1
|
||||
</div>
|
||||
);
|
||||
}
|
||||
snippet rcc
|
||||
class ${1:ClassName} extends React.Component {
|
||||
state = {
|
||||
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
${0:<div />}
|
||||
<div>
|
||||
$1
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
snippet ist
|
||||
import { createStore } from 'redux';
|
||||
snippet con
|
||||
connect(${1:mapStateToProps}, ${2:mapDispatchToProps})(<${3:VISUAL}/>);
|
||||
snippet act
|
||||
const ${1:actionName} = (${2:arg}) => {
|
||||
return {
|
||||
type: ${3:VISUAL},
|
||||
$2
|
||||
};
|
||||
};
|
||||
snippet rdc
|
||||
const ${1:reducerName} = (state={}, action) => {
|
||||
switch(action.type) {
|
||||
case ${1:action}:
|
||||
return {
|
||||
...state,
|
||||
$2
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
};
|
||||
};
|
||||
snippet mstp
|
||||
const mapStateToProps = (state) => {
|
||||
return {
|
||||
${1:propName}: state.$1,
|
||||
};
|
||||
};
|
||||
snippet mdtp
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
${1:propName}: () => {
|
||||
dispatch(${2:actionName}());
|
||||
},
|
||||
};
|
||||
};
|
@ -1,55 +0,0 @@
|
||||
snippet const
|
||||
const ${1} = ${0};
|
||||
snippet let
|
||||
let ${1} = ${0};
|
||||
snippet im "import xyz from 'xyz'"
|
||||
import ${1} from '${2:$1}';
|
||||
snippet imas "import * as xyz from 'xyz'"
|
||||
import * as ${1} from '${2:$1}';
|
||||
snippet imm "import { member } from 'xyz'"
|
||||
import { ${1} } from '${2}';
|
||||
snippet cla
|
||||
class ${1} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet clax
|
||||
class ${1} extends ${2} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet clac
|
||||
class ${1} {
|
||||
constructor(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
}
|
||||
snippet foro "for (const prop of object}) { ... }"
|
||||
for (const ${1:prop} of ${2:object}) {
|
||||
${0:$1}
|
||||
}
|
||||
# Generator
|
||||
snippet fun*
|
||||
function* ${1:function_name}(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet c=>
|
||||
const ${1:function_name} = (${2}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet caf
|
||||
const ${1:function_name} = (${2}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet =>
|
||||
(${1}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet af
|
||||
(${1}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet sym
|
||||
const ${1} = Symbol('${0}');
|
||||
snippet ed
|
||||
export default ${0}
|
||||
snippet ${
|
||||
${${1}}${0}
|
@ -5,10 +5,14 @@ snippet proto
|
||||
${0:${VISUAL}}
|
||||
};
|
||||
# Function
|
||||
snippet fun
|
||||
snippet fun "function"
|
||||
function ${1:function_name}(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet fun "async function"
|
||||
async function ${1:function_name}(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# Anonymous Function
|
||||
snippet anf "" w
|
||||
function(${1}) {
|
||||
@ -202,8 +206,6 @@ snippet @par
|
||||
@param {${1:type}} ${2:name} ${0:description}
|
||||
snippet @ret
|
||||
@return {${1:type}} ${0:description}
|
||||
# JSON
|
||||
|
||||
# JSON.parse
|
||||
snippet jsonp
|
||||
JSON.parse(${0:jstr});
|
||||
@ -273,9 +275,64 @@ snippet cprof "console.profile"
|
||||
snippet ctable "console.table"
|
||||
console.table(${1:"${2:value}"});
|
||||
# Misc
|
||||
# 'use strict';
|
||||
snippet us
|
||||
'use strict';
|
||||
# setTimeout function
|
||||
snippet timeout
|
||||
setTimeout(function () {${0}}${2}, ${1:10});
|
||||
snippet const
|
||||
const ${1} = ${0};
|
||||
snippet let
|
||||
let ${1} = ${0};
|
||||
snippet im "import xyz from 'xyz'"
|
||||
import ${1} from '${2:$1}';
|
||||
snippet imas "import * as xyz from 'xyz'"
|
||||
import * as ${1} from '${2:$1}';
|
||||
snippet imm "import { member } from 'xyz'"
|
||||
import { ${1} } from '${2}';
|
||||
snippet cla
|
||||
class ${1} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet clax
|
||||
class ${1} extends ${2} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet clac
|
||||
class ${1} {
|
||||
constructor(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
}
|
||||
snippet foro "for (const prop of object}) { ... }"
|
||||
for (const ${1:prop} of ${2:object}) {
|
||||
${0:$1}
|
||||
}
|
||||
snippet fun*
|
||||
function* ${1:function_name}(${2}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet c=>
|
||||
const ${1:function_name} = (${2}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet caf
|
||||
const ${1:function_name} = (${2}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet =>
|
||||
(${1}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet af
|
||||
(${1}) => {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet sym
|
||||
const ${1} = Symbol('${0}');
|
||||
snippet ed
|
||||
export default ${0}
|
||||
snippet ${
|
||||
${${1}}${0}
|
||||
snippet aw "await"
|
||||
await ${0:${VISUAL}}
|
||||
|
Reference in New Issue
Block a user