vimrc/sources_non_forked/vim-snippets/snippets/crystal.snippets
2017-02-11 14:01:38 +01:00

82 lines
1.3 KiB
Text

snippet req require
require "${1}"
snippet case
case ${1:object}
when ${2:condition}
${0}
end
snippet when
when ${1:condition}
${0}
snippet def
def ${1:method_name}
${0}
end
snippet pdef
private def ${1:method_name}
${0}
end
snippet if
if ${1:condition}
${0:${VISUAL}}
end
snippet ife
if ${1:condition}
${2:${VISUAL}}
else
${0}
end
snippet wh
while ${1:condition}
${0:${VISUAL}}
end
snippet cla class .. end
class ${1:`substitute(vim_snippets#Filename(), "\(_\|^\)\(.\)", "\u\2", "g")`}
${0}
end
snippet mod class .. end
module ${1:`substitute(vim_snippets#Filename(), "\(_\|^\)\(.\)", "\u\2", "g")`}
${0}
end
snippet r
getter ${0:name}
snippet r!
getter! ${0:name}
snippet r?
getter? ${0:name}
snippet w
setter ${0:name}
snippet w!
setter! ${0:name}
snippet w?
setter? ${0:name}
snippet rw
property ${0:name}
snippet rw!
property! ${0:name}
snippet rw?
property? ${0:name}
snippet defs
def self.${1:class_method_name}
${0}
end
snippet defi
def initialize(${1})
${0}
end
snippet do
do
${0:${VISUAL}}
end
snippet dov
do |${1:v}|
${2}
end
snippet desc
describe ${1:`substitute(substitute(vim_snippets#Filename(), "_spec$", "", ""), "\(_\|^\)\(.\)", "\u\2", "g")`} do
${0}
end
snippet it
it "${1}" do
${0}
end