From da6bd518bc92ec4777e6036a8d97b9cec115e1b1 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Thu, 4 Jul 2013 12:43:40 -0700 Subject: [PATCH] Add custom php snippets to use as an example --- vim/UltiSnips/php.snippets | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 vim/UltiSnips/php.snippets diff --git a/vim/UltiSnips/php.snippets b/vim/UltiSnips/php.snippets new file mode 100644 index 0000000..54b4b67 --- /dev/null +++ b/vim/UltiSnips/php.snippets @@ -0,0 +1,41 @@ +snippet php "Starting php tag" !b + +endsnippet + +snippet ec "echo" !b +echo "${1}"; +endsnippet + +snippet f "Anonymous function" +function () { + ${1} +} +endsnippet + +snippet fuse "Anonymous function with use" +function () use (${1}) { + ${2} +} +endsnippet + +snippet this "this helper" +$${1:this}->${2:prop} +endsnippet + +snippet [] "array literal" +array(${1}) +endsnippet + +snippet {} "Empty object" +new stdClass() +endsnippet + +snippet scf "self calling function" !b +call_user_func(function () { + ${1} +}); +endsnippet