R4NT Magazine

CODE

jEdit Macros make life easy

by David Gluzman

I've recently discovered the power of 'regular expression' find and replace. Huh? Well, instead of searching for a particular string of text, I can define the start and end of lines and do something for each.

Example:

Search for: ^ (this means start of new line)
Replace with: "< p>" (without spaces mind you)

And BLAM! It will put a paragraph tag to the start of every new line (to either the entire document, or just your selection).

Anyways.

Combine regular expressions with the power of jEdit (this is my full time text editor of choice, which runs on any OS since it's Java based); and you can do some seriously cool stuff (Geek alert). But seriously I've made a few macros that will go thru a document (such as a submitted article to R4NT) and format all the paragraphs within a literal blink of an eye! Oh man, this is gonna make my life way easier.

So here are two .bsh (BeanScript) macro files I've created that I'd like to share to anyone that might be interested.

Paragraph Formatter
List Item Formatter

Just dump these files into your Macro directory (normally in your documents and settings directory), make some keyboard short cuts, and you'll be formatting documents faster than ever.

Hmm.. Now if I could only write a macro to deploy the magazine each month.. Hmm...