[TextMate] some suggestions for search & replace

C J Silverio ceej at spies.com
Mon Oct 18 03:53:12 UTC 2004


I've now spent a couple of weekends writing code with TextMate, which 
is I
think enough time to understand its way of working. Some of the things 
I like
most about it come from the language syntax bundles, which are really
powerful and flexible. That's a great feature and a real selling point.
Typing close characters for me: nice. Auto-completion: nice. C++ class
templates: nice. I like the spare look, no stinkin' toolbars cluttering
stuff up and distracting from my all-important data.

Love the new tab look in b7. (Maybe a tad darker to set them off more
from their background? Eh, maybe not.) Also love the sharp new approach
to drawing the selection. Much more readable!

Inevitably, I have suggestions. Users, they're so annoying that way!
Most of my suggestions have to do with searching. TextMate doesn't feel
quite right, yet.

(I've scanned a bunch of the  previous messages to the list, but not
enough to be sure these weren't discussed already. Apologies if I'm
repeating the past.)

- Keyboard accelerator for "replace and find next". For the love
   of god, Montresor!

- "Find the selection" action, with keyboard accelerator. (Yes, it can
   be macroed, but why should I have to macro such an important action?)

- Scroll the text to keep the cursor in the "hot zone" when possible.
   E.g., if you have to scroll to make the result of a search visible,
   scroll enough to put the new selection in the middle of the screen.
   Repeated find-nexts though large files always seem to end up for me
   with the selection on the bottom-most line, with no context visible.
   Yuck!

- For extra points, place the selection where it won't be hidden by
   the Find dialog, which is often covering up the text. (But you're 
going
   to add a replace-and-find-next accelerator, so the Find dialog won't
   be shown so often and this won't matter as much. Right?)

- Bigger fields in the find/replace dialog, please! Try copying some
   text that spans multiple lines and pasting that into the find field.
   Hard to deal with, yes?

- Whole word matching option, please, controlled by a checkbox on the 
find
   dialog. I often want this without wanting the bother of writing a
   regular expression every time.

- Multi-file search outside of project groups, please! Minimal
   implementation searches all the files in a particular directory with
   optional descent into subdirectories. This is a switch-blocker for me,
   and I bet it would make lots of other people happy.

More controversially:

You're probably sick of hearing this, but please reconsider adding
an app preferences dialog. It will do two things for you:

   - It will clear out rarely-changed items that are currently
     cluttering your menus.
   - It will make clear which preferences are app-wide, and which
     ones are settings for the current document.
   - Bonus: your app will feel more Mac-like than it does now.

Remember, it does me no good to have easy access to stuff I set once,
then never ever change again.

As I think about that suggestion and fiddle with things, I begin to 
realize
that TextMate doesn't have per-document settings, and that the 
appearance of
having them is a bug. For instance, open two documents. Turn on text 
wrapping
in one. Note that only the selected document at the time you change the
setting is affected. This leads you to believe that wrapping is a 
document
setting. But if you quit TextMate and restart, suddenly all documents 
are
getting text-wrapped. Whoops.

I would suggest that some choices should be saved with the document, as 
part
of its state (cursor position, selection, wrap, font choice, etc). Those
settings belong in menus. Consider making anything you expect the user 
to
change often part of the document state. Any setting that affects all
documents probably belongs in a preference dialog, tucked out of the 
way.

I can argue this the other way, that adding document state is more
trouble than it's worth. BBEdit does it, and I like it. Soft line wrap 
in
particular is something that I definitely want on some documents and
definitely don't want on others. Worth thinking about, anyway.

Boy, I got longwinded. Hope at least some of this is helpful.

Thanks for making such a solid editor, and hope you enjoy that new G5!

--ceej




More information about the textmate mailing list