mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated vimrc
This commit is contained in:
@ -56,22 +56,26 @@
|
||||
#
|
||||
# Feedback is welcome!
|
||||
#
|
||||
# entry point
|
||||
# Main
|
||||
snippet sim
|
||||
public static int Main(string[] args) {
|
||||
${1:public }static int Main(string[] args) {
|
||||
${0}
|
||||
return 0;
|
||||
}
|
||||
snippet simc
|
||||
public class Application {
|
||||
public static int Main(string[] args) {
|
||||
${1:public }static int Main(string[] args) {
|
||||
${0}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
snippet svm
|
||||
${1:public }static void Main(string[] args) {
|
||||
${0}
|
||||
}
|
||||
# if condition
|
||||
snippet if
|
||||
if (${1}) {
|
||||
if (${1:true}) {
|
||||
${0}
|
||||
}
|
||||
snippet el
|
||||
@ -90,10 +94,10 @@ snippet ?
|
||||
snippet do
|
||||
do {
|
||||
${0}
|
||||
} while (${1});
|
||||
} while (${1:true});
|
||||
# while loop
|
||||
snippet wh
|
||||
while (${1}) {
|
||||
while (${1:true}) {
|
||||
${0}
|
||||
}
|
||||
# for loop
|
||||
@ -101,17 +105,21 @@ snippet for
|
||||
for (int ${1:i} = 0; $1 < ${2:count}; $1${3:++}) {
|
||||
${0}
|
||||
}
|
||||
snippet forr
|
||||
for (int ${1:i} = ${2:length}; $1 >= 0; $1--) {
|
||||
${0}
|
||||
}
|
||||
# foreach
|
||||
snippet fore
|
||||
foreach (var ${1:entry} in ${2}) {
|
||||
foreach (${1:var} ${2:entry} in ${3}) {
|
||||
${0}
|
||||
}
|
||||
snippet foreach
|
||||
foreach (var ${1:entry} in ${2}) {
|
||||
foreach (${1:var} ${2:entry} in ${3}) {
|
||||
${0}
|
||||
}
|
||||
snippet each
|
||||
foreach (var ${1:entry} in ${2}) {
|
||||
foreach (${1:var} ${2:entry} in ${3}) {
|
||||
${0}
|
||||
}
|
||||
# interfaces
|
||||
@ -164,32 +172,32 @@ snippet ctor
|
||||
# properties - auto properties by default.
|
||||
# default type is int with layout get / set.
|
||||
snippet prop
|
||||
${1:public} ${2:int} ${3:} { get; set; }
|
||||
${1:public} ${2:int} ${3} { get; set; }
|
||||
snippet p
|
||||
${1:public} ${2:int} ${3:} { get; set; }
|
||||
${1:public} ${2:int} ${3} { get; set; }
|
||||
snippet p+
|
||||
public ${1:int} ${2:} { get; set; }
|
||||
public ${1:int} ${2} { get; set; }
|
||||
snippet p+&
|
||||
public ${1:int} ${2:} { get; internal set; }
|
||||
public ${1:int} ${2} { get; internal set; }
|
||||
snippet p+|
|
||||
public ${1:int} ${2:} { get; protected set; }
|
||||
public ${1:int} ${2} { get; protected set; }
|
||||
snippet p+-
|
||||
public ${1:int} ${2:} { get; private set; }
|
||||
public ${1:int} ${2} { get; private set; }
|
||||
snippet p&
|
||||
internal ${1:int} ${2:} { get; set; }
|
||||
internal ${1:int} ${2} { get; set; }
|
||||
snippet p&|
|
||||
internal ${1:int} ${2:} { get; protected set; }
|
||||
internal ${1:int} ${2} { get; protected set; }
|
||||
snippet p&-
|
||||
internal ${1:int} ${2:} { get; private set; }
|
||||
internal ${1:int} ${2} { get; private set; }
|
||||
snippet p|
|
||||
protected ${1:int} ${2:} { get; set; }
|
||||
protected ${1:int} ${2} { get; set; }
|
||||
snippet p|-
|
||||
protected ${1:int} ${2:} { get; private set; }
|
||||
protected ${1:int} ${2} { get; private set; }
|
||||
snippet p-
|
||||
private ${1:int} ${2:} { get; set; }
|
||||
private ${1:int} ${2} { get; set; }
|
||||
# property - bool
|
||||
snippet pi
|
||||
${1:public} int ${2:} { get; set; }
|
||||
${1:public} int ${2} { get; set; }
|
||||
snippet pi+
|
||||
public int ${1} { get; set; }
|
||||
snippet pi+&
|
||||
@ -212,7 +220,7 @@ snippet pi-
|
||||
private int ${1} { get; set; }
|
||||
# property - bool
|
||||
snippet pb
|
||||
${1:public} bool ${2:} { get; set; }
|
||||
${1:public} bool ${2} { get; set; }
|
||||
snippet pb+
|
||||
public bool ${1} { get; set; }
|
||||
snippet pb+&
|
||||
@ -235,7 +243,7 @@ snippet pb-
|
||||
private bool ${1} { get; set; }
|
||||
# property - string
|
||||
snippet ps
|
||||
${1:public} string ${2:} { get; set; }
|
||||
${1:public} string ${2} { get; set; }
|
||||
snippet ps+
|
||||
public string ${1} { get; set; }
|
||||
snippet ps+&
|
||||
@ -258,87 +266,87 @@ snippet ps-
|
||||
private string ${1} { get; set; }
|
||||
# members - void
|
||||
snippet m
|
||||
${1:public} ${2:void} ${3:}(${4:}) {
|
||||
${5:}
|
||||
${1:public} ${2:void} ${3}(${4}) {
|
||||
${0}
|
||||
}
|
||||
snippet m+
|
||||
public ${1:void} ${2:}(${3:}) {
|
||||
${4:}
|
||||
public ${1:void} ${2}(${3}) {
|
||||
${0}
|
||||
}
|
||||
snippet m&
|
||||
internal ${1:void} ${2:}(${3:}) {
|
||||
${4:}
|
||||
internal ${1:void} ${2}(${3}) {
|
||||
${0}
|
||||
}
|
||||
snippet m|
|
||||
protected ${1:void} ${2:}(${3:}) {
|
||||
${4:}
|
||||
protected ${1:void} ${2}(${3}) {
|
||||
${0}
|
||||
}
|
||||
snippet m-
|
||||
private ${1:void} ${2:}(${3:}) {
|
||||
${4:}
|
||||
private ${1:void} ${2}(${3}) {
|
||||
${0}
|
||||
}
|
||||
# members - int
|
||||
snippet mi
|
||||
${1:public} int ${2:}(${3:}) {
|
||||
${4:return 0;}
|
||||
${1:public} int ${2}(${3}) {
|
||||
${0:return 0;}
|
||||
}
|
||||
snippet mi+
|
||||
public int ${1:}(${2:}) {
|
||||
${3:return 0;}
|
||||
public int ${1}(${2}) {
|
||||
${0:return 0;}
|
||||
}
|
||||
snippet mi&
|
||||
internal int ${1:}(${2:}) {
|
||||
${3:return 0;}
|
||||
internal int ${1}(${2}) {
|
||||
${0:return 0;}
|
||||
}
|
||||
snippet mi|
|
||||
protected int ${1:}(${2:}) {
|
||||
${3:return 0;}
|
||||
protected int ${1}(${2}) {
|
||||
${0:return 0;}
|
||||
}
|
||||
snippet mi-
|
||||
private int ${1:}(${2:}) {
|
||||
${3:return 0;}
|
||||
private int ${1}(${2}) {
|
||||
${0:return 0;}
|
||||
}
|
||||
# members - bool
|
||||
snippet mb
|
||||
${1:public} bool ${2:}(${3:}) {
|
||||
${4:return false;}
|
||||
${1:public} bool ${2}(${3}) {
|
||||
${0:return false;}
|
||||
}
|
||||
snippet mb+
|
||||
public bool ${1:}(${2:}) {
|
||||
${3:return false;}
|
||||
public bool ${1}(${2}) {
|
||||
${0:return false;}
|
||||
}
|
||||
snippet mb&
|
||||
internal bool ${1:}(${2:}) {
|
||||
${3:return false;}
|
||||
internal bool ${1}(${2}) {
|
||||
${0:return false;}
|
||||
}
|
||||
snippet mb|
|
||||
protected bool ${1:}(${2:}) {
|
||||
${3:return false;}
|
||||
protected bool ${1}(${2}) {
|
||||
${0:return false;}
|
||||
}
|
||||
snippet mb-
|
||||
private bool ${1:}(${2:}) {
|
||||
${3:return false;}
|
||||
private bool ${1}(${2}) {
|
||||
${0:return false;}
|
||||
}
|
||||
# members - string
|
||||
snippet ms
|
||||
${1:public} string ${2:}(${3:}) {
|
||||
${4:return "";}
|
||||
${1:public} string ${2}(${3}) {
|
||||
${0:return "";}
|
||||
}
|
||||
snippet ms+
|
||||
public string ${1:}(${2:}) {
|
||||
${3:return "";}
|
||||
public string ${1}(${2}) {
|
||||
${0:return "";}
|
||||
}
|
||||
snippet ms&
|
||||
internal string ${1:}(${2:}) {
|
||||
${3:return "";}
|
||||
internal string ${1}(${2}) {
|
||||
${0:return "";}
|
||||
}
|
||||
snippet ms|
|
||||
protected string ${1:}(${2:}) {
|
||||
${3:return "";}
|
||||
${0:return "";}
|
||||
}
|
||||
snippet ms-
|
||||
private string ${1:}(${2:}) {
|
||||
${3:return "";}
|
||||
private string ${1}(${2}) {
|
||||
${0:return "";}
|
||||
}
|
||||
# structure
|
||||
snippet struct
|
||||
@ -347,6 +355,11 @@ snippet struct
|
||||
}
|
||||
# enumeration
|
||||
snippet enum
|
||||
enum ${1} {
|
||||
${0}
|
||||
}
|
||||
|
||||
snippet enum+
|
||||
public enum ${1} {
|
||||
${0}
|
||||
}
|
||||
@ -372,3 +385,86 @@ snippet <rem
|
||||
<remarks>${1}</remarks>
|
||||
snippet <c
|
||||
<code>${1}</code>
|
||||
|
||||
snippet cw
|
||||
Console.WriteLine(${1});
|
||||
|
||||
# equals override
|
||||
snippet eq
|
||||
public override bool Equals(object obj) {
|
||||
if (obj == null || GetType() != obj.GetType()) {
|
||||
return false;
|
||||
}
|
||||
${0:throw new NotImplementedException();}
|
||||
return base.Equals(obj);
|
||||
}
|
||||
# exception
|
||||
snippet exc
|
||||
public class ${1:MyException} : ${2:Exception} {
|
||||
public $1() { }
|
||||
public $1(string message) : base(message) { }
|
||||
public $1(string message, Exception inner) : base(message, inner) { }
|
||||
protected $1(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
# indexer
|
||||
snippet index
|
||||
public ${1:object} this[${2:int} index] {
|
||||
get { ${0} }
|
||||
set { ${0} }
|
||||
}
|
||||
# eventhandler
|
||||
snippet inv
|
||||
EventHandler temp = ${1:MyEvent};
|
||||
if (${2:temp} != null) {
|
||||
$2();
|
||||
}
|
||||
# lock
|
||||
snippet lock
|
||||
lock (${1:this}) {
|
||||
${0}
|
||||
}
|
||||
# namespace
|
||||
snippet namespace
|
||||
namespace ${1:MyNamespace} {
|
||||
${0}
|
||||
}
|
||||
# property
|
||||
snippet prop
|
||||
public ${1:int} ${2:MyProperty} { get; set; }
|
||||
snippet propf
|
||||
private ${1:int} ${2:myVar};
|
||||
public $1 ${3:MyProperty} {
|
||||
get { return $2; }
|
||||
set { $2 = value; }
|
||||
}
|
||||
snippet propg
|
||||
public ${1:int} ${2:MyProperty} { get; private set; }
|
||||
# switch
|
||||
snippet switch
|
||||
switch (${1:switch_on}) {
|
||||
${0}
|
||||
default:
|
||||
}
|
||||
# try
|
||||
snippet try
|
||||
try {
|
||||
${0}
|
||||
}
|
||||
catch (${1:System.Exception}) {
|
||||
throw;
|
||||
}
|
||||
snippet tryf
|
||||
try {
|
||||
${0}
|
||||
}
|
||||
finally {
|
||||
${1}
|
||||
}
|
||||
# using
|
||||
snippet usi
|
||||
using(${1:resource}) {
|
||||
${0}
|
||||
}
|
||||
|
Reference in New Issue
Block a user