From 80d1726062dbe17f478b3ceee840e0ec2674e260 Mon Sep 17 00:00:00 2001 From: Ian Markind Date: Wed, 26 Sep 2018 16:31:33 -0400 Subject: [PATCH] added commands for emmet, html, blade templates, and css --- php-storm.py | 44 ++++++++++++++++++++++++++++++++++++++++++-- std.py | 1 + 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/php-storm.py b/php-storm.py index 2711d8d..ca51587 100644 --- a/php-storm.py +++ b/php-storm.py @@ -22,7 +22,7 @@ def foundation_breakpoint_function(m): def blade_switch(): def blade_switch_function(m): - Str('@switch($)')(None) + Str('@switch ($)')(None) press('return') for x in range(3): Str('@case()')(None) @@ -45,7 +45,7 @@ def blade_switch_function(m): def blade_for_each(): def blade_for_each_function(m): - Str('@foreach($ as $)')(None) + Str('@foreach ($ as $)')(None) press('return') press('return') Str('@endforeach')(None) @@ -57,6 +57,21 @@ def blade_for_each_function(m): return blade_for_each_function +def blade_for(): + def blade_for_function(m): + Str('@for ($i = 0; $i < ; $i++)')(None) + press('return') + press('return') + Str('@endfor')(None) + press('shift-tab') + press('up') + press('up') + for x in range(12): + press('right') + + return blade_for_function + + def blade_if(): def blade_if_function(m): Str('@if ()')(None) @@ -147,6 +162,7 @@ def blade_include_function(m): 'horse markup': ['formk', Key('tab')], 'chop': ['forek', Key('tab')], 'eagles': ['?=', Key('tab')], + 'index': '$i', # blade 'blade if': blade_if(), @@ -155,6 +171,7 @@ def blade_include_function(m): 'blade php': blade_php(), 'blade include': blade_include(), 'blade else': blade_else(), + 'blade for': blade_for(), 'blade for each': blade_for_each(), 'blade section': blade_section(), 'blade data': '{{ ', @@ -164,8 +181,29 @@ def blade_include_function(m): 'blade case': ['@case()', Key('left')], 'blade extends': ['@extends(\'\')', Key('left'), Key('left')], 'blade loop': '$loop', + 'blade index': 'index', + 'blade iteration': 'iteration', + 'blade remaining': 'remaining', + 'blade count': 'count', + 'blade first': 'first', + 'blade last': 'last', + 'blade depth': 'depth', 'blade raw data': '{!', + # HTML + 'href': 'href=', + 'id': 'id=', + 'class': 'class=', + # Emmet + 'section': ['section', Key('tab')], + 'paragraph': ['p', Key('tab')], + 'image': ['img', Key('tab')], + 'div': ['div', Key('tab')], + 'anchor': ['a', Key('tab')], + 'break': ['br', Key('tab')], + 'footer': ['footer', Key('tab')], + 'body': ['body', Key('tab')], + # CSS 'with': ['width: ;', Key('left')], 'max with': ['max-width: ;', Key('left')], @@ -178,6 +216,8 @@ def blade_include_function(m): 'breakpoint': foundation_breakpoint(), 'complete': Key('cmd-shift-enter'), 'definition': Key('alt-space'), + 'medium': 'medium', + '(padding | patty)': 'padding', } diff --git a/std.py b/std.py index 6183369..359b642 100644 --- a/std.py +++ b/std.py @@ -213,6 +213,7 @@ def FormatText(m): 'puter down': Key('ctrl-alt-shift-cmd-d'), 'puter restart': Key('ctrl-alt-shift-cmd-r'), 'about this puter': Key('ctrl-alt-shift-cmd-a'), + '(doc | dock)': Key('alt-cmd-d'), # 'exit talent': Key('ctrl-alt-shift-cmd-t'), 'delete': Key('backspace'),