Skip to content

Commit

Permalink
added commands for emmet, html, blade templates, and css
Browse files Browse the repository at this point in the history
  • Loading branch information
TestPlan committed Sep 26, 2018
1 parent 293093c commit 80d1726
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
44 changes: 42 additions & 2 deletions php-storm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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(),
Expand All @@ -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': '{{ ',
Expand All @@ -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')],
Expand All @@ -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',

}

Expand Down
1 change: 1 addition & 0 deletions std.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 80d1726

Please sign in to comment.