Snippets are regular expressions and activated by pressing the space key.
Here are some of the many rules: ^ start of line, $ end of line, ? 0-1 * 0-n + 1-n $1-$n:

Last update: 2015-07-01

PATTERN
TEXT
mn
$module_name
^mh
$module_header
^ocd@$
Option Compare Database
^oe@$
Option Explicit
^pu@$
Public {VARIABLE} As {^TYPE^}
^pr@$
Private {VARIABLE} As {^TYPE^}
^(private +|public +)?(type|enum)$
$1$2 {NAME}\nEnd $2
^s@$
' __{SECTION}__
^b@$
' \@\@{BEACON}\@\@
^m@$
' ({FIXME:}|{TODO:}|{NOTE:}) {COMMENT}
pn
$procedure_name
^ph
$procedure_header
^ *peh
$procedure_error_header
^ *pef
$procedure_error_footer
px
$procedure_exit
^(\d* *)oegt
$1On Error GoTo {LABEL}
^(\d* *)oern
$1On Error Resume Next
^ *((?:public|private|friend) +)?(static +)?sub@$
$1$2Sub {NAME}({ARGUMENTS})\n\t\nEnd Sub
^ *((?:public|private|friend) +)?(static +)?function@$
$1$2Function {NAME}({ARGUMENTS}) As {^TYPE^}\n\t\nEnd Function
^ *((?:public|private|friend) +)?(static +)?property get@$
$1$2Property Get {@ATTRIBUTE@}() As {^TYPE^}\n\t{Set }{ATTRIBUTE} = {EXPRESSION}\nEnd Property
^ *((?:public|private|friend) +)?(static +)?property let@$
$1$2Property Let {ATTRIBUTE}(({ByVal }|{ByRef }){@ARGUMENT@} As {^TYPE^})\n\t{EXPRESSION} = {ARGUMENT}\nEnd Property
^ *((?:public|private|friend) +)?(static +)?property set@$
$1$2Property Set {ATTRIBUTE}(({ByVal }|{ByRef }){@ARGUMENT@} As {^TYPE^})\n\tSet {EXPRESSION} = {ARGUMENT}\nEnd Property
((?:sub|function|property) .*optional .*)([(,]) *@ *([^ )])
$1$2 Optional ({ByRef }|{ByVal }){NAME} As {^TYPE^}, @$1
((?:sub|function|property) .*optional .*)([(,]) *@ *\)(.*)
$1$2 Optional ({ByRef }|{ByVal }){NAME} As {^TYPE^}@)$1
((?:sub|function|property) .*[,(] *)o@ *([,)_].*)
$1Optional ({ByRef }|{ByVal }){NAME} As {^TYPE^}@$1
((?:sub|function|property) .*[,(] *)o@(?! *Optional)
$1Optional
((?:sub|function|property) .*)([(,]) *@ *([),])
$1$2({ByRef }|{ByVal }){NAME} As {^TYPE^}@$1
((?:sub|function|property) .*)([(,]) *
$1$2({ByRef }|{ByVal }){NAME} As {^TYPE^},
((?:function|property get) .*\(.*\))@$
$1 As {^TYPE^}
o@(?!Optional )(ByRef |ByVal )?([^ ]+ as )
Optional @$1$2
([^ ]+ as [^ ]+, *)o
$1Optional ({ByRef }|{ByVal }){NAME} As {^TYPE^}
(optional .* as [^ ]+( = [^ ]+)? *, *)
$1Optional ({ByRef }|{ByVal }){NAME} As {^TYPE^}
((?:ByRef |ByVal )[^ ]+ as [^ ]+ *, *)@ *([,)_].*)
$1 ({ByRef }|{ByVal }){NAME} As {^TYPE^}@$1
((?:ByRef |ByVal )[^ ]+ as [^ ]+ *, *)
$1({ByRef }|{ByVal }){NAME} As {^TYPE^},
^(\d* *(?:dim|static)( .*, *| *))@ *(?:[, ]*)([^ ]+)
$1 {NAME} As {^TYPE^}, @$1
^(\d* *(?:dim|static)( .*, *| *))@$
$1 {NAME} As {^TYPE^}
as +b
As Boolean
as +d
As Date
as +i
As Integer
as +l
As Long
as +r
As Recordset
as +s
As String
as +v
As Variant
= *n
= Nothing
(as|=) +(new +)?c
$1 $2Collection
^(\d* *)set@$
$1Set {OBJECT} = {EXPRESSION}
^(\d* *)set ([^ ]+) *= *new
$1Set $2 = New {┬░TYPE┬░}
(=*)t
$1True
(=*)f
$1False
!
Not {EXPRESSION}
([^ ,]+) *(\+|\-)(\+|\-)
$1 = $1 $2 1
([^ ,]+) *(\+|\-|\*|\&)=
$1 = $1 $2 {EXPRESSION}
^(\d* *)if@$
$1If {CONDITION} Then
^(\d* *)elseif@$
$1ElseIf {CONDITION} Then
^(\d* *)for@$
$1For {VARIABLE} = {VALUE} To {EXPRESSION}
^(\d* *)foreach@$
$1For Each {VARIABLE} In {COLLECTION}
^(\d* *)select@$
$1Select Case {EXPRESSION}
^(\d* *)do@$
$1Do ({While}|{Until}) {CONDITION}
^(\d* *)while@$
$1While {CONDITION}
^(\d* *)case@$
$1Case {CONDITION}
^(\d* *)loop@$
$1Loop ({While}|{Until}) {CONDITION}
^(\d* *)with@$
$1With {OBJECT}
bx
$block_exit
iif@$
IIf({CONDITION}, {TRUE}, {FALSE})
dbox
MsgBox "$module_name.$procedure_name\@$module_line"
and
And {CONDITION}
or
Or {CONDITION}

Send us your snippets via email office@vbetwister.com and share it with the community