High praise for BareBones!! and Format (and indent) XML with TextWranger?

1925 views
Skip to first unread message

Jared Rypka-Hauer

unread,
Nov 26, 2008, 11:16:04 AM11/26/08
to TextWrangler Talk
Hey folks... first post here. Let me start by saying I am a very
active member of the Adobe community, specializing in ColdFusion and
Flex/AIR. This community has seen a surge in Windows -> OSX
conversions in the last 2 years and Adobe have started throwing a ton
of support behind the OSX versions of their software. I have a
reputation as one of "the Mac guys" in the community and am regularly
asked for advice on what software is essential when making that
conversion... right at the top of that list is TextWrangler. In fact I
consider it _the_ essential piece of software for any professional
user moving to OSX, especially in a role involving the need to work
with Apache and the HOSTS file. I also have it set to be my default
editor for .cfm, .cfc, .mxml, and .as files so that if I need quick
edits I can just double-click and go. Otherwise I use Eclipse for
everything else.

The other thing I use it for is text conversions... everything from
reformatting SQL that I get in one long line so it's formatted and
indented, to changing line endings and charsets in shell scripts that
originated on other platforms (eg. ColdFusion comes with a bunch of
shell scripts for various tasks which won't run on OSX because the
line endings are Windows-style). The regex engine is beyond
fantastic... I just can't praise TW enough. Hell, I even copy text
from Eclipse into TW to do transformations and then copy it back into
Eclipse to keep working.

Anyway, just wanted you to know that I could not live without TW...

Now for my question: I have TW set as the default editor for XML
files, but without a "Format and Indent XML" function it makes it a
little hard to use it on big XML files that done come formatted. So
I'm wondering what's the best way (if there is a way) to get TW to do
a format-and-indent on an XML file? Beyond that, is there a way to get
formatters for other languages (i.e. SQL, AS3, ColdFusion, etc.) into
TW? Is that what a Text Factory is for?

Incidentally I have ColdFusion files currently associated with the XML
color coding scheme... I'm wondering if it's possible to add other
language profiles to TW to make it easier to work with CF, etc.?

Also I'm wondering if these questions would be answered by upgrading
to BBEdit? I hesitate to upgrade just because I already have
Dreamweaver, Eclipse+oXygen, FlexBuilder+oXygen, FDT3, Navicat, Aqua
Data Studio, SQL Developer, etc. on my machine... I know at least 3 of
those are redundant, but there are reasons. Anyway, getting another
$100+ piece of software if with a bit of work I can get TW to do what
I need. Then again if it's worth it I'll do it in a heartbeat.

Thanks in advance...

Jared

Steve Kalkwarf

unread,
Nov 26, 2008, 11:45:35 AM11/26/08
to textwr...@googlegroups.com
On Nov 26, 2008, at 11:16 AM, Jared Rypka-Hauer wrote:
>
> Now for my question: I have TW set as the default editor for XML
> files, but without a "Format and Indent XML" function it makes it a
> little hard to use it on big XML files that done come formatted. So
> I'm wondering what's the best way (if there is a way) to get TW to do
> a format-and-indent on an XML file? Beyond that, is there a way to get
> formatters for other languages (i.e. SQL, AS3, ColdFusion, etc.) into
> TW? Is that what a Text Factory is for?

Text Factories are ways to store batches of text operations for reuse.
Nearly all of the items on the Text menu, plus a few other operations
can be batched. Factories can be authored in BBEdit, and applied from
either BBEdit or TextWrangler.

There are a couple of HTML Tidy operations (including HTML/XML reflow)
available as factory operations.

If you want to spend the time to roll your own operations,
TextWrangler does have one of BBEdit's most powerful features: The
Shebang menu. The shebang menu allows you to apply scripts (perl,
shell, python, ruby, etc, etc, etc) to text in TextWrangler windows,
so for instance, you could pipe the unformatted XML file through a
command line tool to reflow it, and get the results back in the same
window you started from.

> Also I'm wondering if these questions would be answered by upgrading
> to BBEdit?

We offer a 30 day fully functional demo of BBEdit, so you can try it,
and see if it improves your productivity. Personally, I can't live
without it. :-)

Steve

Jared Rypka-Hauer

unread,
Nov 26, 2008, 12:00:54 PM11/26/08
to TextWrangler Talk
I'll try the download of BBEdit and see where it goes... One of the
things I like about TW is how lightweight it is: how quick it
launches, how little RAM it occupies, etc. Hopefully BBEdit will work
just as well.

I'll also look into grabbing a pre-fab HTML Tidy operation... thanks
for that. I never really thought to look around and see if anyone
already wrote this sort of thing for TW or BBEdit.

Thanks for the extremely quick response! :)

J

On Nov 26, 10:45 am, Steve Kalkwarf <kalkw...@barebones.com> wrote:

> ...
> There are a couple of HTML Tidy operations (including HTML/XML reflow)  
> available as factory operations.
>
> If you want to spend the time to roll your own operations,  
> TextWrangler does have one of BBEdit's most powerful features: The  
> Shebang menu...

Tom Robinson

unread,
Nov 26, 2008, 1:35:49 PM11/26/08
to textwr...@googlegroups.com
On 2008-11-27, at 05:45, Steve Kalkwarf wrote:

> The shebang menu allows you to apply scripts (perl,
> shell, python, ruby, etc, etc, etc) to text in TextWrangler windows,
> so for instance, you could pipe the unformatted XML file through a
> command line tool to reflow it, and get the results back in the same
> window you started from.

Brilliant, thanks Steve. Formatting XML has been a nice-to-have on my
list for ages.

On a quick search I found this:

<http://www.entropy.ch/blog/Developer/2008/04/23/XML-Pretty-Printing-in-BBEdit-and-vi-With-xmllint.html
>

With a minute's set up I can now format XML within my favourite
editor :-)

Jared: just replace BBEdit in the instructions with TextWrangler
(it's often worth searching on BBEdit instead of TextWrangler.)

Tom Robinson

unread,
Nov 26, 2008, 1:40:03 PM11/26/08
to textwr...@googlegroups.com
On 2008-11-27, at 05:16, Jared Rypka-Hauer wrote:

> Incidentally I have ColdFusion files currently associated with the XML
> color coding scheme... I'm wondering if it's possible to add other
> language profiles to TW to make it easier to work with CF, etc.?

If you're wanting to build a language module for syntax colouring,
etc. then check out Codeless Language Modules. These are XML files
which tell TextWrangler how to display your particular language. See
Chapter 13 and Appendix C of the built-in User Manual.

Reply all
Reply to author
Forward
0 new messages