APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS














(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version



Smultron Editor

I'm a "vi" kind of guy. Whether it's writing scripts or posts for this web site, vi is my tool of choice

Part of that is quite utilitarian. Vi is always available, except on Windows, of course, but I don't write posts on Windows and certainly don't do any Windows scripting. Everywhere else, I can count on vi.



But it is also force of habit. I'm used to vi, can do what I want to do quickly and efficiently, so why use anything else? Why indeed. I'm not about to switch.

Yet for the purposes of this review, I'm actually using Smultron, a Mac OS X editor.

The first thing I wanted to check out was search and replace. This is usually where editors fail to impress me. Vi has wonderful search and replace features. For example, when writing posts like this, I may paste in a list of web site references:

http://abc.com
http://xyz.com

and so on. I want to change them into hyperlinks, so in vi I'd simply do:

s/\(.*\)/<href="\1">\1<\/a>/
 

That may look awful to the uninitiated, but it really breaks down very simply. See Vi Primer for a quick introduction.

So how would you do that in Smultron? Well.. I don't know. I don't think you can. The search and replace supposedly recognizes regular expressions, so you can say that the "find" part matches ".*", but there's no apparent way to refer to what was matched. It isn't \1 or $1, and Smultron's "Help" link is entirely mute on this subject.

Worse, Smultron is worried that you might have made a mistake: when you execute a search and replace Smultron asks if you are sure. I couldn't find anything in Preferences to turn that nag off.

More maddening is the "Undo" feature. If you mistakenly replaced more than you wanted to in selected text, you have to re-select the changed text before you can undo it!

Smultron does have a "Close Tag" feature (command T) that works well for typing in html documents like this. I also like that it displays line numbers and can easily display invisible characters, though the distinction between a space and a period isn't much in that mode.

Smultron can be set to auto complete words after a delay period of your choosing. As it lacks spell checking, that's at least a partial substitute. That feature does make it difficult to type html tags, though: if you start <p it Smultron thinks the "p" should be the word "period". Also, if you have accidentally mistyped something, Smultron will add that to its list of words to suggest, making it very easy to keep compounding the mistake. I found auto completion more annoying than useful, so turned it off.

Smultron can do automatic indenting and supposedly can indicate matching braces in code, but I couldn't figure out how you ask it to show the matching brace and again the documentation is non-existent. There's also supposedly syntax coloring that supposedly shows unclosed tags; how to trigger that eluded me.



;


That's undoubtedly the most annoying part of Smultron: no documentation. I suppose if you must have a graphical editor, and don't mind one that has lousy documentation, then Smultron might be useful to you. It sure is not useful to me.


Technorati tags: Reviews
;


Click here to add your comments





Mon Jun 26 14:25:16 2006: Subject:   bruceg2004


I am very happy with TextMate. When I am not using vi, I am using TextMate, and have only scratched the surface of what it can do. I mostly use it for project management. According to the website, you can run code right in the editor, and it has the regex of grep in it's search/replace.

http://macromates.com/ http://macromates.com/

I tried Smultron, as well. I also trialed BBEdit, and TextWrangler, and settled on TextMate.

- Bruce




Fri Apr 27 14:10:03 2007: Subject:   anonymous


Could you please sprinkle in some more ads within your articles. I think you still have room to make your site a bit more obnoxious.




Fri Apr 27 14:18:24 2007: Subject:   TonyLawrence

gravatar
Happy to take 'em all out if you'd like to step up and pay for the time and expense of running this site.

It's about $2,000 a month all told - when shall I expect your first check?



Fri Oct 17 11:23:57 2008: Subject: Replace arguments on regexps   GwynethLlewelyn
http://gwynethllewelyn.net/

At least on Smultron 3.5, regexp search & replacing uses the $1 as placeholder. It works fine, even if it's a bit slow.



Wed Mar 11 11:52:45 2009: Subject:   NickMariette
http://soundsorange.net
gravatar
I have been using smultron 3.1.2 for my thesis and it has been handy for consistency - e.g. fixing SI units to always have a space between the digits and the unit = e.g. 500ms should be 500 ms.

I almost thought I was doomed when I struggled to find a way to do this in smultron after it had been helping me in lots of other ways. I saw the previous comment about v3.5 and almost considered trying a machine with Leopard just to try it out....

I tried to do it in textwrangler - and found a way (thanks to it's very thorough documentation - definitely missing in smultron). but then i tried the same method in smultron and it worked.

so. long story short:
you have to use grep's subpattern syntax (see textwrangler manual page 145 - writing replacement patterns).

so for my problem, i could add a space wherever a digit was followed by ms by finding:
(\d+) ms
and replacing it with:
\1 ms

hope this helps some others with this problem!



Wed Mar 11 12:33:12 2009: Subject:   NickMariette

gravatar
Careful!
- Actually the replace string should be $1 (not \1).

Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



ad

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!



 I sell and support
 Kerio Mail server




pavatar.jpg
More:
       - MacOSX
       - Reviews


Unix/Linux Consultants

Skills Tests

Guest Post Here








card_image






My Favorites

Change Congress