Created
February 6, 2015 08:19
-
-
Save select/e5a4e35e02f072d2fdde to your computer and use it in GitHub Desktop.
Sublime Text replace selected text with a snippet, trigger this with a keyboard shortcut (e.g. for wrapping natural laguage strings with a call to a translation function)
This file contains 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
// add this to your "Key Bindings - User" to trigger the snipped | |
{ | |
"keys": ["ctrl+1"], | |
"command": "insert_snippet", | |
"args": { | |
"name": "Packages/User/php-translation-wrap-string.sublime-snippet" | |
}, | |
} |
This file contains 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
<!-- this snipped will wrap the selected text --> | |
<snippet> | |
<content><![CDATA[ | |
' . \$this->translate('${0:$TM_SELECTED_TEXT}') . ' | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>translate wrap string</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.php</scope> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment