What are KeyboardTemplates ?


It's an extended AutoReplace system which permit to work faster. You can define states where you want them to expand (for example only in comment or only in php code, ...)

How does it work ?

You can define templates in the menu File -> Edit keyboard template.
Keyboard template are per class file (ie php files have their own bunch of template, html too, ...)
To fire template a expansion, simply write it's name in the correct state, and press space.
It will be expanded to the expression you gave.

What can I use to build template ?

After expansion, the caret will be here
You can use both tokens like this to tell what will be the selection after expansion (the first one, specify where will be the start of the selection, and the second, where will be the end position of the selection)
These token will be replaced by the first token in the clipboard
These token will be replaced by the first line in the clipboard
Drop a QuickMark instead of this token

You can also use special commands like theses:
Replaced by current class name
Replaced by current function name
Replaced by [current class name] :: [current function name]
(It is also planned that you can extends available command list with plugins, more info to come later.)
If you've got ideas of functions which can be defined, please tell us

you can create template alias, an alias is a kind of shortcut to another template.
For example if you have a template named i+, and you want that that i= to fire the same template, you can create an alias by defining i= as %i+%.
An alias is colored in blue in the KeyboardTemplate editor.

powered_by_phpedit