sometimes I'd like to launch a script, that parses text from the current line, takes this as arguments for a script. The script than inserts text into the editor, replacing certain placeholders with the argument.
I could do this as a macro and give it some hotkey, sure, but I'd prefer the macro to act as an 'intelligent' template of some sorts.
Here is an example:
I want to create the documentation-header for a class. As soon I enter
Code: Select all
cdoc
A full example may look like this:
Code: Select all
/** "public" method
* @method
* @memberOf YAHOO.myProject.myModule
* @param {Type[, Type, ... ]} [Parameter |...] Parameter-Description
* @return {Type [, Type, ...]} Returns-Description
* @type Object
If, in the editor I'd invoke this as a template like this:
Code: Select all
cdoc param description, param2 description, param3 description, [param4 description]