This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » development » Miscellaneous » Ultra Edit bundle
Ultra Edit bundle [message #74929] Tue, 17 March 2009 10:18
pbkyriak  is currently offline pbkyriak
Messages: 3
Registered: May 2008
Location: Greece
Junior Member
Hi all,
today i was trying to use Ultra Edit macro found in trac http://trac.symfony-project.org/wiki/UltraEditBundle when i got the idea to make it cleaner with UE scripting.
After a couple of hours i got my self a small script:

var keywords = new Array();
var templates = new Array();

keywords[0] = 'echo';    templates[0] = 16;
keywords[1] = '__';      templates[1] = 16;
keywords[2] = 'foreach'; templates[2] = 19
keywords[3] = 'if';      templates[3] = 11;


UltraEdit.columnModeOff();
UltraEdit.insertMode();
UltraEdit.activeDocument.hexOff();
UltraEdit.unixReOn();

UltraEdit.activeDocument.selectWord();
var sel_text = UltraEdit.activeDocument.selection;

var found = false;
var i;
for( i=0; i< keywords.length; i++) {
	if( keywords[i]==sel_text ) {
		UltraEdit.activeDocument.insertTemplate(templates[i]);
		found=true;
		break;
	}
}
if( !found ) {
	UltraEdit.activeDocument.key("CTRL+RIGHT ARROW");
	UltraEdit.activeDocument.write('\t');
}

again it is activated with TAB key and it is easy to setup and extend. Actualy it maps keywords to uedit templates!!
So it takes advantage of uedit code templates also.
Keywords array holds the keywords and templates array the id to the template we want to be inserted.
Installation steps are:
1. add the script to UE and set hot key to TAB
2. setup templates Advanced->Display/Modify Templates
3. map keywords to templates into the script
and done. Type for example foreach and hit TAB you should get the template in your code.


Hope it helps
Previous Topic:Yii and symfony speed comparison
Next Topic:create an svn:externals for the sf dir
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software