Created
July 9, 2025 19:18
-
-
Save james2doyle/d777c699a7971377b5d9a288f12080e4 to your computer and use it in GitHub Desktop.
An example of a complex keybinding in Sublime Text. This example shows you can "press [key] when selecting text to wrap it in template echo tags and a variable"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
// 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 | |
} | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment