Development

UltraEditBundle

You must first sign up to be able to contribute.

Version 4 (modified by francois, 11 years ago)
fixed space problem and added shorcut for xliff translations

UltraEdit? bundle

UltraEdit?'s Macros allow for a smart code completion, "a la" TextMate, but for Windows.

Here is a Macro to be launched by the tabulation key. It preserves the usual tabulation action, but adds new completion when the it is pressed after if, else, foreach and echo.

if+TAB

<?php if(): ?>
   
<?php endif; ?>

else+TAB

<?php else: ?>

foreach+TAB

<?php foreach($ as $): ?>
   
<?php endforeach; ?>

__+TAB

<?php echo __('') ?>

echo+TAB

<?php echo ?>

Of course, the indenting will be preserved and the cursor will go to the smartest position.

This is very useful to write templates in PHP. Try it on, you won't be able to work without it anymore.

InsertMode
ColumnModeOff
HexOff
UnixReOn
IfSel
  Find RegExp "^"
  Replace All SelectText "  "
Else
  IfExtIs "php"
    "PHPCOMPPHP"
    Key Ctrl+LEFT ARROW
    Find "echoPHPCOMPPHP"
    Replace All "<?php echo  ?>"
    IfFound
      Loop 11
      Key RIGHT ARROW
      EndLoop
    EndIf
    IfNotFound
      Find RegExp "^(\s*)ifPHPCOMPPHP"
      Replace All "\1<?php if(): ?>
\1  
\1<?php endif; ?>"
      IfFound
        Loop 9
        Key RIGHT ARROW
        EndLoop
      EndIf
      IfNotFound
        Find RegExp "^(\s*)foreachPHPCOMPPHP"
        Replace All "\1<?php foreach($ as $): ?>
\1  
\1<?php endforeach; ?>"
        IfFound
          Loop 15
          Key RIGHT ARROW
          EndLoop
        EndIf
        IfNotFound
          Find RegExp "^(\s*)elsePHPCOMPPHP"
          Replace All "\1<?php else: ?>
\1"
          IfFound
            Loop 4
            Key RIGHT ARROW
            EndLoop
            Key DOWN ARROW
          EndIf
          IfNotFound
            Find "__PHPCOMPPHP"
            Replace All "<?php echo __('') ?>"
            IfFound
              Loop 13
              Key RIGHT ARROW
              EndLoop
            EndIf
            IfNotFound          
              Find "PHPCOMPPHP"
              Replace All "  "
              Key Ctrl+RIGHT ARROW
            EndIf
          EndIf
        EndIf
      EndIf
    EndIf
  Else
    IfExtIs "xml"
      "XMLCOMPXML"
      Key Ctrl+LEFT ARROW
      Find "transXMLCOMPXML"
      Replace All "<trans-unit>
        <source></source>
        <target></target>
      </trans-unit>"
      IfFound
        Loop 10
          Key RIGHT ARROW
        EndLoop
        Key DOWN ARROW
      EndIf
    Else
      "  "
    EndIf
  EndIf
EndIf

Note: This macro will override the default value of a tabulation and replace it by two spaces

To be completed with classic PHP completion, when not in templates:

if+Shift+TAB

if()
{
  
}

else+Shift+TAB

else
{

}

foreach+Shift+TAB

foreach($ as $)
{

}