diff --git a/Default.sublime-keymap b/Default.sublime-keymap new file mode 100644 index 0000000..d174de7 --- /dev/null +++ b/Default.sublime-keymap @@ -0,0 +1,60 @@ +[ + // press $ when selecting text to wrap it in blade echo tags and a variable + { + "keys": [ + "$" + ], + "command": "insert_snippet", + "args": { + "contents": "{{ \\$${0:$SELECTION} }}" + }, + "context": [ + { + "key": "selector", + "operator": "equal", + "operand": "text.html.blade", + "match_all": true + }, + { + "key": "setting.auto_match_enabled", + "operator": "equal", + "operand": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": false, + "match_all": true + } + ] + }, + // press ! when selecting text to wrap it in blade raw echo tags and a variable + { + "keys": [ + "!" + ], + "command": "insert_snippet", + "args": { + "contents": "{!! \\$${0:$SELECTION} !!}" + }, + "context": [ + { + "key": "selector", + "operator": "equal", + "operand": "text.html.blade", + "match_all": true + }, + { + "key": "setting.auto_match_enabled", + "operator": "equal", + "operand": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": false, + "match_all": true + } + ] + } +] \ No newline at end of file diff --git a/images/dollar-on-selection.gif b/images/dollar-on-selection.gif new file mode 100644 index 0000000..062be9e Binary files /dev/null and b/images/dollar-on-selection.gif differ diff --git a/images/exclaimation-on-selection.gif b/images/exclaimation-on-selection.gif new file mode 100644 index 0000000..e67ea30 Binary files /dev/null and b/images/exclaimation-on-selection.gif differ diff --git a/readme.md b/readme.md index 4d1b8da..87e89b1 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,7 @@ This package adds syntax definitions for the [Laravel](http://www.laravel.com) B ### Sublime Text Manual Install -1. Download or clone this repository into ```[install-dir]/Packages/laravel-blade``` +1. Download or clone this repository: ```git clone https://github.com/Medalink/laravel-blade.git Laravel\ Blade\ Highlighter``` 2. Restart Sublime Text. 3. Reopen any ```.blade``` files. 4. Enjoy :) @@ -28,6 +28,16 @@ This package adds syntax definitions for the [Laravel](http://www.laravel.com) B *[Material Theme](https://github.com/equinusocio/material-theme).* +#### Keymaps + +Press `$` when you have a selection active: + +![Dollar on selection](images/dollar-on-selection.gif "Dollar on selection") + +Press `!` when you have a selection active: + +![Exclaimation on selection](images/exclaimation-on-selection.gif "Exclaimation on selection") + #### Supported Extensions * [Blade Extensions Laravel Package](https://github.com/RobinRadic/blade-extensions)