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 “#”.

- `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.

- `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