I need make a shortcut that will be adding certain text at the cursor, eg {sometext}, how can this be done?
@skyisred I think the question is already very well answered to the point. But web-developers often will need to generate dummy content to fill the elements. Say "Lorem ipsum".
Type lorem
and hit Tab
Sublime will generate the complete Lorem ipsum dummy text for you.
If you really want to do it with a shortcut
Go to
[On Windows] Preferences > Key Bindings - User
[On OS X] Sublime Text > Preferences > Key Bindings - User
[
{"keys": ["ctrl+alt+i","ctrl+alt+s"], "command": "insert_snippet","args": {"contents": "A small snippet"}},
{"keys": ["ctrl+alt+i","ctrl+alt+m"], "command": "insert_snippet","args": {"contents": "A medium-sized snippet, just good enough to fill in a normal span element."}},
{"keys": ["ctrl+alt+i","ctrl+alt+l"], "command": "insert_snippet","args": {"contents": "A large snippet, a little more than the medium snippet and just good enough to fill in a paragraph element.This will make your work so much more easier."}}
]
I have written an article on creating custom keyboard shortcuts in Sublime Text which might be helpful to you to create shortcuts for other common operations in Sublime Text.