/macros

A collection of useful Komodo macros

Primary LanguageJavaScriptMozilla Public License 2.0MPL-2.0

Komodo Macros

This is a collection of useful Komodo macros.

Table of Contents

Macros

Wrap Text (code)

Wrap the editor selection with arbitrary text. Easily enclose text with HTML tags or stringify a selection.

PHPDoc and JSDoc (code)

Automatically adds PHPdoc (or JSDoc) comments, including a summary, to your PHP (or JavaScript) file when you type '/**' followed by the ENTER key.

If the line below the current position is a function, variable or class it will check for an toolbox Abbreviation and add it's contents to the phpdoc comment.

Incremental Numbering (code)

Make a column selection in the editor, then for each column insert a number and have the number incremented for each subsequent row in the selection.

Copy Find Results (code)

A macro that will copy the existing Find Results onto the clipboard. Note: There can be two find results pane opened - this only works on the first one.

Variable Dumper (code)

Debug helper - generates a print statement from the current word or selection.

Swap Assignment (code)

Switch a variable assignment (or argument) around, so foo = bar will become bar = foo.

Automagic Snippets From Text (code)

Create a snippet from selected text, add a name and automatically open properties to add keybinding.

Reorder lines as tower (code)

Reorder selected lines, so that the shortest will go to top and the longest goes to bottom. Useful when reordering "import" lines in Python source code.

Left pare (code)

Remove 1 character form selected line on the left. Useful to clean code copied from diff file.

Byte or Char Position (code)

Show the Byte or Char position of your cursor in the Statusbar beside Ln and Col.

Img Tag Dimensions (code)

Execute the macro insdie an img tag in an html file, which the src attribute filled in. The macro will load the image and input the height and width of the image attributes with the correct dimensions

Installing

Create a new macro in your Komodo toolbox and copy/paste the contents into the Komodo macro editor.

Contributing

Got a handy macro yourself? Please submit a pull request to have your macro added to this list.