From 3fa45cda70ac9b9fcc1685e2091292d1a5347e03 Mon Sep 17 00:00:00 2001 From: Yu Huanbo Date: Sun, 7 Apr 2013 19:05:25 +0800 Subject: [PATCH] add `nc`(namespace and class) for php http://knplabs.com/blog/boost-your-productivity-with-sf2-and-vim --- snippets/php.snippets | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/snippets/php.snippets b/snippets/php.snippets index e861a5b..513ee9b 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -222,6 +222,13 @@ snippet class ${8:// code...} } } +snippet nc + namespace ${1:`substitute(substitute(expand("%:h"), '\v^\w+\/(\u)', '\1', ''), '\/', '\\\', 'g')`}; + + ${2:abstract }class ${3:`Filename()`} + { + ${4} + } # define(...) snippet def define('${1}'${2});${3}