Textwrangler Tips – Compare files, keyboard shortcuts

A few quick TextWrangler tips.

I never knew until recently that you can compare files in TextWrangler… and its easy.

Simply highlight the 2 files you want to compare in the Documents drawer, right click on them and select the option ‘Compare Selected Documents‘.

Now the 2 files will open into 2 windows with a review of the differences below them. You can then apply the differences in either direction.

Another tip is adding keyboard shortcuts to TextWrangler’s menu options.

I like to use the Search -› Jump Back/Forward option to navigate around a large body of code but alas it has no keyboard shortcut. So each time you wish to move from one Jump mark to another, you need to go up to the Search menu… which kinda defeats the handiness of the option in the first place.

Anyways, to add a keyboard shortcut to this (or some other useful menu) option, go to Textwrangler -› Preferences.

Select Menus

Find the menu heading for the option you want, in my case Search

In the menu header, find the option(s) you want to add a keyboard shortcut to.

Highlight an option and press the Set Key button.

Enter the keyboard shortcut and press the Set button.

Bingo.

Lastly, a while back I wrote a shell script to format my XML. To add a shortcut to this, you need to select Window -› Palettes -› Unix Filters

Select the script you want to shortcut and press the Set Key… button. Enter your keyboard shortcut and press the Set button and now when you want to format some messy XML, you have a keyboard shortcut to knock it into shape.

4 thoughts on “Textwrangler Tips – Compare files, keyboard shortcuts

  1. I was looking for a file compare tool and didn’t know it was right under my nose this whole time! Thanks for the TextWrangler tip!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s