Text Macros
Prev | Appendix F. Macros Included With jEdit | Next

## Text Macros

These macros generate various forms of formatted text.

- `Add_Prefix_and_Suffix.bsh`

  Adds user-supplied “prefix” and “suffix” text to each line in a group of selected lines.

  Text is added after leading whitespace and before trailing whitespace. A dialog window receives input and “remembers” past entries.

- `Color_Picker.bsh`

  Displays a color picker and inserts the selected color in hexadecimal format, prefixed with a “#”.

- `Compose_Tag.bsh`

  The selection is taken as tag name and replaced with a full xml tag.

- `Duplicate_Line.bsh`

  Duplicates the line on which the caret lies immediately beneath it and moves the caret to the new line.

- `Insert_Date.bsh`

  Inserts the current date and time in the current buffer.

  The inserted text includes a representation of the time in the “Internet Time” format.

- `Insert_Tag.bsh`

  Inserts a balanced pair of HTML/SGML/XML markup tags as supplied in an input dialog. The tags will surround any selected text.

- `Line_Filter.bsh`

  Filters lines of the current buffer due to a provided regular expression. The resulting set of lines can be either removed from the buffer or written to a new buffer.

  The filter works on a multiline selection (if there is one) otherwise on the whole buffer. The resulting set of lines includes those lines that either match or not match the regular expression.

- `Next_Char.bsh`

  Finds next occurrence of character on current line.

  The macro takes the next character typed after macro execution as the character being searched. That character is not displayed. If the character does not appear in the balance of the current line, no action occurs.

  This macro illustrates the use of `InputHandler.readNextChar()` as a means of obtaining user input. See the section called “Using a Single Keypress as Input”.

- `Reverse_Lines.bsh`

  Reverses the selected lines or the entire buffer if no lines are selected. Does not support Rectangular Selections.

- `Single_Space_Buffer.bsh`

  Removes every second line, if they are all blank.

Prev | Up | Next
Property Macros | Home | Part II. Writing Edit Modes