mirror of
https://github.com/amix/vimrc
synced 2025-06-17 02:15:01 +08:00
Updated plugins
This commit is contained in:
@ -1245,3 +1245,19 @@ snippet ::a
|
||||
::after
|
||||
snippet ::b
|
||||
::before
|
||||
snippet var
|
||||
var(${0:${VISUAL}});
|
||||
snippet vard
|
||||
var(${0}, ${1:${VISUAL});
|
||||
snippet host
|
||||
:host {
|
||||
${1:${VISUAL}}
|
||||
}
|
||||
snippet host(
|
||||
:host(${1}) {
|
||||
${2:${VISUAL}}
|
||||
}
|
||||
snippet part {
|
||||
::part(${1})
|
||||
${2:${VISUAL}}
|
||||
}
|
||||
|
@ -57,3 +57,33 @@ snippet stanim
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
# Flutter scaffold application
|
||||
snippet fsa
|
||||
void main() {
|
||||
runApp(
|
||||
MaterialApp(
|
||||
title: 'Flutter Demo',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
),
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: const HomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
const HomePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Home Page'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,6 +40,9 @@ snippet lica
|
||||
<%= link_to '${1:link text...}', controller: '${2:items}', action: '${0:index}' %>
|
||||
snippet licai
|
||||
<%= link_to '${1:link text...}', controller: '${2:items}', action: '${3:edit}', id: ${0:@item} %>
|
||||
snippet lib
|
||||
<%= link_to '${1:link text...}' do %>
|
||||
<% end %>
|
||||
snippet yield
|
||||
<%= yield ${1::content_symbol} %>
|
||||
snippet conf
|
||||
|
@ -1,29 +1,29 @@
|
||||
snippet des "describe('thing', () => { ... })" b
|
||||
describe('${1:}', () => {
|
||||
snippet des "describe('thing', function() { ... })" b
|
||||
describe('${1:}', function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet it "it('should do', () => { ... })" b
|
||||
it('${1:}', () => {
|
||||
snippet it "it('should do', function() { ... })" b
|
||||
it('${1:}', function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet xit "xit('should do', () => { ... })" b
|
||||
xit('${1:}', () => {
|
||||
snippet xit "xit('should do', function() { ... })" b
|
||||
xit('${1:}', function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet bef "before(() => { ... })" b
|
||||
before(() => {
|
||||
snippet bef "before(function() { ... })" b
|
||||
before(function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet befe "beforeEach(() => { ... })" b
|
||||
beforeEach(() => {
|
||||
snippet befe "beforeEach(function() { ... })" b
|
||||
beforeEach(function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet aft "after(() => { ... })" b
|
||||
after(() => {
|
||||
snippet aft "after(function() { ... })" b
|
||||
after(function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet afte "afterEach(() => { ... })" b
|
||||
afterEach(() => {
|
||||
snippet afte "afterEach(function() { ... })" b
|
||||
afterEach(function() {
|
||||
${0:${VISUAL}}
|
||||
});
|
||||
snippet exp "expect(...)" b
|
||||
|
@ -352,7 +352,7 @@ snippet sym
|
||||
snippet ed
|
||||
export default ${0}
|
||||
snippet ${
|
||||
${${1}}${0}
|
||||
\${${1}}${0}
|
||||
snippet as "async"
|
||||
async ${0}
|
||||
snippet aw "await"
|
||||
|
@ -18,7 +18,7 @@ snippet cremove
|
||||
snippet ccatch
|
||||
<c:catch var="${0}" />
|
||||
snippet cif
|
||||
<c:if test="${${1}}">
|
||||
<c:if test="\${${1}}">
|
||||
${0}
|
||||
</c:if>
|
||||
snippet cchoose
|
||||
@ -26,7 +26,7 @@ snippet cchoose
|
||||
${0}
|
||||
</c:choose>
|
||||
snippet cwhen
|
||||
<c:when test="${${1}}">
|
||||
<c:when test="\${${1}}">
|
||||
${0}
|
||||
</c:when>
|
||||
snippet cother
|
||||
@ -34,12 +34,12 @@ snippet cother
|
||||
${0}
|
||||
</c:otherwise>
|
||||
snippet cfore
|
||||
<c:forEach items="${${1}}" var="${2}" varStatus="${3}">
|
||||
<c:forEach items="\${${1}}" var="${2}" varStatus="${3}">
|
||||
${0:<c:out value="$2" />}
|
||||
</c:forEach>
|
||||
snippet cfort
|
||||
<c:set var="${1}">${2:item1,item2,item3}</c:set>
|
||||
<c:forTokens var="${3}" items="${$1}" delims="${4:,}">
|
||||
<c:forTokens var="${3}" items="\${$1}" delims="${4:,}">
|
||||
${0:<c:out value="$3" />}
|
||||
</c:forTokens>
|
||||
snippet cparam
|
||||
@ -56,13 +56,13 @@ snippet cimport+
|
||||
</c:import>
|
||||
snippet curl
|
||||
<c:url value="${1}" var="${2}" />
|
||||
<a href="${$2}">${0}</a>
|
||||
<a href="\${$2}">${0}</a>
|
||||
snippet curl+
|
||||
<c:url value="${1}" var="${2}">
|
||||
<c:param name="${4}" value="${5}" />
|
||||
cparam+${0}
|
||||
</c:url>
|
||||
<a href="${$2}">${3}</a>
|
||||
<a href="\${$2}">${3}</a>
|
||||
snippet credirect
|
||||
<c:redirect url="${0}" />
|
||||
snippet contains
|
||||
|
@ -6,6 +6,11 @@ snippet pfun
|
||||
private fun ${1:name}(${2}): ${3:String} {
|
||||
${4}
|
||||
}
|
||||
snippet main
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
${0}
|
||||
}
|
||||
snippet ret
|
||||
return ${0}
|
||||
snippet whe
|
||||
|
@ -28,7 +28,7 @@ snippet ife
|
||||
${3}
|
||||
}
|
||||
snippet eif
|
||||
elsif ${1) {
|
||||
elsif ${1} {
|
||||
${2}
|
||||
}
|
||||
# Conditional One-line
|
||||
|
@ -12,6 +12,7 @@ snippet uni
|
||||
${0:representation}
|
||||
snippet from
|
||||
from ${1:package} import ${0:module}
|
||||
|
||||
# Module Docstring
|
||||
snippet docs
|
||||
"""
|
||||
@ -29,18 +30,22 @@ snippet sk "skip unittests" b
|
||||
snippet wh
|
||||
while ${1:condition}:
|
||||
${0:${VISUAL}}
|
||||
|
||||
# dowh - does the same as do...while in other languages
|
||||
snippet dowh
|
||||
while True:
|
||||
${1}
|
||||
if ${0:condition}:
|
||||
break
|
||||
|
||||
snippet with
|
||||
with ${1:expr} as ${2:var}:
|
||||
${0:${VISUAL}}
|
||||
|
||||
snippet awith
|
||||
async with ${1:expr} as ${2:var}:
|
||||
${0:${VISUAL}}
|
||||
|
||||
# New Class
|
||||
snippet cl
|
||||
class ${1:ClassName}(${2:object}):
|
||||
@ -52,11 +57,24 @@ snippet cl
|
||||
snippet cla
|
||||
class ${1:class_name}:
|
||||
"""${0:description}"""
|
||||
|
||||
snippet clai
|
||||
class ${1:class_name}:
|
||||
"""${2:description}"""
|
||||
def __init__(self, ${3:args}):
|
||||
${0}
|
||||
|
||||
# Data class
|
||||
snippet dcl dataclass
|
||||
@dataclass
|
||||
class ${1:ClassName}:
|
||||
"""${2:description}"""
|
||||
${3:var_1}: ${4:int}
|
||||
${5:var_2}: ${6:float} = ${7:0}
|
||||
|
||||
def ${8:total}(self): -> $6:
|
||||
return ${0:self.$3 * self.$5}
|
||||
|
||||
# New Function
|
||||
snippet def
|
||||
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||
@ -72,6 +90,7 @@ snippet adef
|
||||
snippet adeff
|
||||
async def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||
${0}
|
||||
|
||||
# New Method
|
||||
snippet defi
|
||||
def __init__(self, ${1:args}):
|
||||
@ -88,11 +107,11 @@ snippet property
|
||||
@property
|
||||
def ${1:foo}(self) -> ${2:type}:
|
||||
"""${3:doc}"""
|
||||
return self._${1:foo}
|
||||
return self._$1
|
||||
|
||||
@${1:foo}.setter
|
||||
def ${1:foo}(self, value: ${2:type}):
|
||||
self._${1:foo} = value
|
||||
@$1.setter
|
||||
def $1(self, value: $2):
|
||||
self._$1 = value
|
||||
|
||||
# Ifs
|
||||
snippet if
|
||||
@ -104,10 +123,28 @@ snippet el
|
||||
snippet ei
|
||||
elif ${1:condition}:
|
||||
${0:${VISUAL}}
|
||||
|
||||
# Match
|
||||
snippet match Structural pattern matching
|
||||
match ${1:expression}:
|
||||
case ${2:pattern_1}:
|
||||
${3:pass}
|
||||
case ${4:pattern_2}:
|
||||
${5:pass}
|
||||
|
||||
# Match with wildcard
|
||||
snippet matchw Pattern matching with wildcard
|
||||
match ${1:expression}:
|
||||
case ${2:pattern_1}:
|
||||
${3:pass}
|
||||
case _:
|
||||
${0:pass}
|
||||
|
||||
# For
|
||||
snippet for
|
||||
for ${1:item} in ${2:items}:
|
||||
${0}
|
||||
|
||||
# Encodes
|
||||
snippet cutf8
|
||||
# -*- coding: utf-8 -*-
|
||||
@ -115,15 +152,18 @@ snippet clatin1
|
||||
# -*- coding: latin-1 -*-
|
||||
snippet cascii
|
||||
# -*- coding: ascii -*-
|
||||
|
||||
# Lambda
|
||||
snippet ld
|
||||
${1:var} = lambda ${2:vars} : ${0:action}
|
||||
|
||||
snippet ret
|
||||
return ${0}
|
||||
snippet .
|
||||
self.
|
||||
snippet sa self.attribute = attribute
|
||||
self.${1:attribute} = $1
|
||||
|
||||
snippet try Try/Except
|
||||
try:
|
||||
${1:${VISUAL}}
|
||||
@ -152,6 +192,7 @@ snippet tryef Try/Except/Else/Finally
|
||||
${5}
|
||||
finally:
|
||||
${0}
|
||||
|
||||
# if __name__ == '__main__':
|
||||
snippet ifmain
|
||||
if __name__ == '__main__':
|
||||
@ -159,6 +200,10 @@ snippet ifmain
|
||||
# __magic__
|
||||
snippet _
|
||||
__${1:init}__
|
||||
|
||||
# debugger breakpoint
|
||||
snippet br
|
||||
breakpoint()
|
||||
# python debugger (pdb)
|
||||
snippet pdb
|
||||
__import__('pdb').set_trace()
|
||||
@ -192,9 +237,11 @@ snippet nosetrace
|
||||
__import__('nose').tools.set_trace()
|
||||
snippet pprint
|
||||
__import__('pprint').pprint(${1})
|
||||
|
||||
snippet "
|
||||
"""${0:doc}
|
||||
"""
|
||||
|
||||
# assertions
|
||||
snippet a=
|
||||
self.assertEqual(${0}, ${1})
|
||||
@ -215,6 +262,7 @@ snippet tgwt
|
||||
# then: ${3}
|
||||
snippet fut
|
||||
from __future__ import ${0}
|
||||
|
||||
#getopt
|
||||
snippet getopt
|
||||
try:
|
||||
@ -232,6 +280,7 @@ snippet getopt
|
||||
${0}
|
||||
elif option in ("-v", "--verbose"):
|
||||
verbose = argument
|
||||
|
||||
# argparse
|
||||
snippet addp
|
||||
parser = ${VISUAL:argparse.}ArgumentParser()
|
||||
@ -275,7 +324,7 @@ snippet epydoc
|
||||
"""
|
||||
snippet dol
|
||||
def ${1:__init__}(self, *args, **kwargs):
|
||||
super(${0:ClassName}, self).$1(*args, **kwargs)
|
||||
super(${0:ClassName}, self).$1(*args, **kwargs)
|
||||
snippet kwg
|
||||
self.${1:var_name} = kwargs.get('$1', ${2:None})
|
||||
snippet lkwg
|
||||
|
@ -274,22 +274,6 @@ snippet sl
|
||||
end
|
||||
snippet sha1
|
||||
Digest::SHA1.hexdigest(${0:string})
|
||||
snippet sweeper
|
||||
class ${1:ModelClassName}Sweeper < ActionController::Caching::Sweeper
|
||||
observe $1
|
||||
|
||||
def after_save(${0:model_class_name})
|
||||
expire_cache($2)
|
||||
end
|
||||
|
||||
def after_destroy($2)
|
||||
expire_cache($2)
|
||||
end
|
||||
|
||||
def expire_cache($2)
|
||||
expire_page
|
||||
end
|
||||
end
|
||||
snippet va validates_associated
|
||||
validates_associated :${0:attribute}
|
||||
snippet va validates .., acceptance: true
|
||||
|
@ -598,6 +598,8 @@ snippet begin
|
||||
#debugging
|
||||
snippet debug
|
||||
require 'byebug'; byebug
|
||||
snippet dbg
|
||||
require 'debug'; debugger
|
||||
snippet debug19
|
||||
require 'debugger'; debugger
|
||||
snippet debug18
|
||||
|
@ -17,7 +17,7 @@ snippet *
|
||||
# Definition
|
||||
snippet def
|
||||
(define (${1:name})
|
||||
(${0:definition}))
|
||||
${0:definition})
|
||||
|
||||
# Definition with lambda
|
||||
snippet defl
|
||||
|
@ -55,7 +55,7 @@ snippet go
|
||||
done
|
||||
# Set SCRIPT_DIR variable to directory script is located.
|
||||
snippet sdir
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
SCRIPT_DIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
||||
# getopt
|
||||
snippet getopt
|
||||
__ScriptVersion="${1:version}"
|
||||
@ -66,7 +66,7 @@ snippet getopt
|
||||
#===============================================================================
|
||||
function usage ()
|
||||
{
|
||||
echo "Usage : $${0:0} [options] [--]
|
||||
echo "Usage : \$${0:0} [options] [--]
|
||||
|
||||
Options:
|
||||
-h|help Display this message
|
||||
@ -80,18 +80,18 @@ snippet getopt
|
||||
|
||||
while getopts ":hv" opt
|
||||
do
|
||||
case $opt in
|
||||
case \$opt in
|
||||
|
||||
h|help ) usage; exit 0 ;;
|
||||
|
||||
v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;;
|
||||
v|version ) echo "\$${0:0} -- Version \$__ScriptVersion"; exit 0 ;;
|
||||
|
||||
* ) echo -e "\n Option does not exist : $OPTARG\n"
|
||||
* ) echo -e "\\n Option does not exist : \$OPTARG\\n"
|
||||
usage; exit 1 ;;
|
||||
|
||||
esac # --- end of case ---
|
||||
done
|
||||
shift $(($OPTIND-1))
|
||||
shift \$(($OPTIND-1))
|
||||
snippet root
|
||||
if [ \$(id -u) -ne 0 ]; then exec sudo \$0; fi
|
||||
|
||||
|
@ -63,7 +63,7 @@ snippet eq equation environment
|
||||
snippet eql Labeled equation environment
|
||||
\\begin{equation}
|
||||
\\label{eq:${2}}
|
||||
${0:${VISUAL}}
|
||||
${0:${VISUAL}}
|
||||
\\end{equation}
|
||||
# Equation
|
||||
snippet eq* unnumbered equation environment
|
||||
@ -406,6 +406,10 @@ snippet ddot ddot
|
||||
snippet vec vector
|
||||
\\vec{{$1}} {$0}
|
||||
|
||||
# Bar
|
||||
snippet bar bar
|
||||
\\bar{{$1}} {$0}
|
||||
|
||||
# Cross product
|
||||
snippet \x cross product
|
||||
\\times {$0}
|
||||
|
@ -50,7 +50,7 @@ snippet vactions
|
||||
${1:updateValue}({commit}, ${2:payload}) {
|
||||
commit($1, $2);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
# Add in js animation hooks
|
||||
snippet vanim:js:el
|
||||
@ -106,14 +106,33 @@ snippet vdata
|
||||
return {
|
||||
${1:key}: ${2:value}
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
snippet vmounted
|
||||
mounted() {
|
||||
console.log('mounted');
|
||||
},
|
||||
|
||||
snippet vmethods
|
||||
methods: {
|
||||
${1:method}() {
|
||||
console.log('method');
|
||||
}
|
||||
},
|
||||
|
||||
snippet vcomputed
|
||||
computed: {
|
||||
${1:fnName}() {
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
snippet vfilter
|
||||
filters: {
|
||||
${1:fnName}: function(${2:value}) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
snippet vfor
|
||||
<div v-for="${1:item} in ${2:items}" :key="$1.id">
|
||||
@ -125,7 +144,7 @@ snippet vgetters
|
||||
${1:value}: state => {
|
||||
return state.$1;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
snippet vimport
|
||||
import ${1:New} from './components/$1.vue';
|
||||
@ -152,7 +171,7 @@ snippet vmutations
|
||||
${1:updateValue}(state, ${3:payload}) => {
|
||||
state.${2:value} = $3;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
snippet vprops:d
|
||||
${1:propName}: {
|
||||
|
Reference in New Issue
Block a user