Permalink
Browse files

Add some regexpressions to make my life easier

  • Loading branch information...
1 parent 802732e commit 133086c8b4a6d0159c15f3126fbec3f8a5ad7049 @vsushkov committed Apr 10, 2013
Showing with 6 additions and 30 deletions.
  1. +5 −5 snippets/php.snippets
  2. +1 −25 snippets/xml.snippets
View
@@ -53,8 +53,8 @@ snippet file
* versions in the future. If you wish to customize this module for your
* needs please refer to http://www.magentocommerce.com for more information.
*
- * @category Vsushkov
- * @package Vsushkov_${1:Module}
+ * @category `substitute(substitute(expand("%:r"), 'app/code/local/\|app/code/community/', '', 'g'), '/.*', '', 'g')`
+ * @package `substitute(expand("%:r"), 'app/code/\(community\|local\)/\(\w*\)/\(\w*\)/.*', '\=submatch(2) . "_" . submatch(3)', 'g')`
* @copyright Copyright (c) `strftime('%Y')` Valentin Sushkov (http://www.vsushkov.com/)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
@@ -63,11 +63,11 @@ snippet doc_c
/**
* ${1:Class comment}
*
- * @category Vsushkov
- * @package Vsushkov_${2:Module}
+ * @category `substitute(substitute(expand("%:r"), 'app/code/local/\|app/code/community/', '', 'g'), '/.*', '', 'g')`
+ * @package `substitute(expand("%:r"), 'app/code/\(community\|local\)/\(\w*\)/\(\w*\)/.*', '\=submatch(2) . "_" . submatch(3)', 'g')`
* @author Valentin Sushkov <me@vsushkov.com>
*/
- ${3}
+ ${2}
# Canonical class name for Magento
snippet mclass
`substitute(substitute(expand("%:r"), 'app/code/local/\|app/code/community/', '', 'g'), '/', '_', 'g')`
View
@@ -2,35 +2,11 @@ snippet phpunit
<phpunit>
<suite>
<modules>
- <${1:Module_Name} />
+ <`substitute(expand("%:r"), 'app/code/\(community\|local\)/\(\w*\)/\(\w*\)/.*', '\=submatch(2) . "_" . submatch(3)', 'g')` />
</modules>
</suite>
</phpunit>
snippet file
- /**
- * Oggetto Web extension for Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Academic Free License (AFL 3.0)
- * that is bundled with this package in the file LICENSE_AFL.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/afl-3.0.php
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade this module to newer
- * versions in the future. If you wish to customize this module for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category Oggetto
- * @package Oggetto_${1:Module}
- * @copyright Copyright (c) 2012 Oggetto Web ltd. (http://www.oggettoweb.com/)
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
- * @author Valentin Sushkov <vsushkov@oggettoweb.com>
- */
- ${2}
-snippet vfile
<!--
/**
* vsushkov's extension for Magento

0 comments on commit 133086c

Please sign in to comment.