Sublime Text is a sophisticated text editor for code, html and prose. You'll love the slick user interface and extraordinary features. (www.sublimetext.com)
Its snippet system allows you to create snippets that are triggered by a sequence of characters you can define, followed by tab key. The syntax is really easy. To create a snippet choose "Tools, New Snippet".
The snippet I'd like to show you today is a huge timesaver. I use it excessively in my form models in symfony2. After declaring a model variable as private or protected I need to create a get and set method for it. Copy paste and substitute the variable name was my choice until today. The following snippet allows you to use the following workflow:
- type 'getset'
- press the tab key
- type your variable name
- done.
The result:
No comments:
Post a Comment