Friday, August 29, 2008

BBEdit 9

BBEdit 9 doesn’t seem like as big an upgrade as 8.0 and 8.5 were, but it’s nonetheless a good one.




24 Comments RSS · Twitter

With regard to single-tapping Escape to invoke text completion: I'll bet it's because you have BBEdit's "Use Emacs key bindings" preference turned on. If you turn that off, Escape invokes Complete with a single tap.

Yes, but it’s absurd that I have to choose one or the other. Emacs bindings are standard throughout the OS, and completion works with a single tap in every Cocoa application.

I was never a big fan of BBEdit. It's still using an awful default font and still feels like MacOS 9 app. It's also pretty ugly.

I'm a huge fan of TextMate and everything that BBEdit fails to deliver, TextMate not only delivers but also excels at!

Except, you know, a sane undo mechanism.

I have a shell script for exuberant ctags that calls

ctags --extra=+q -n -L "$FILELIST"

for the list of files it found from a call to find(1). Put the tags file in the root of your source directory. BBEdit wants full path names in the tags file.

As for TextMate, it just seems to get in the way too much. BBEdit or emacs any day.

The simple truth is that you always choose emacs bindings over that for your OS. Emacs will outlive them all, and will still be there, ported the Nth time, (and still behind the times) in the 24th century. And elisp will still be a pain in the ass.

Lally Singh: Thanks. BBEdit 9 seems to support relative paths. Since my code is organized into folders by framework, it seems like I’d need a single master tags file at the top level in order to make all the symbols available.

How do you get ctags to find symbols from the OS frameworks?

Do you run your script with cron, or is there a better way?

Do you have a quick way of finding definitions other than using the contextual menu? (Search > Find Definition doesn’t seem to do anything for me.)

The Find Differences command is way improved; I can now easily toggle endnote citations on and off in LaTeX manuscripts by comparing the manuscript before and after processing with Endnote or BibTeX.

I also really like the popup menu you get with autocompletion. I had been using Michael's BBAutoComplete with great success in BBEdit 8.7 to handle completion of cross-reference labels for figures, equations, and tables in LaTeX, but choosing the correct label from a popup menu with the new tool is a significant improvement over cycling over the elements in the list with repeated keystrokes, as was required with BBAutoComplete.

Warren Beck: Yes, the pop-up menu for completions is nice. I just don’t like the method of activating it, or the completions that it shows.

I've found the auto-completion to be completely frustrating/useless for development. Sure, it recognizes functions, etc. but misses everything wrapped in quotes.

Try this: Create a new doc in BBEdit making sure it is a plain text or (none) document. Paste the text "I think bbeditautocomplete is buggy." including the wrapping quotes; go to a new line and type bbe and you'll be presented with bbeditautocomplete. Now, make the document an ANSI C, Python, PHP or any other language that employs quoted strings and BBEdit will now tell you "No completions available."

I really want to come back to you BBEdit, but not if you're going to behave like that.

@DaveS: Lord knows, if an app has an ugly default font, it's a lost cause. Really, "ugly default font" is a reason not to use BBEdit? Do you stop using useful apps because the icon's not pretty enough, too?

@Michael: The Configuring BBEdit for Development Environments section of the manual has some tips on keeping the tags file up to date (write a script that's invoked whenever you do a build), as well as a recommended command line invocation to use (although the manual seems not to have gotten the memo on on the relative paths).

Other Tips:

Sub-Title: Things I had to pickup on my own

Most of this is based on experience with the 8.x ctags support, I haven't had a chance to play much with the new version.

Search->Find Definitions is the way to find a definition. Select the symbol, invoke the command. If you invoke the command without anything selected, a modal sheet will popup and let you enter the name of the symbol you're looking for. If BBEdit doesn't find a symbol, nothing happens. I suspect that's what you're experiencing.

I think BBEdit loads the tag files, or an index of the symbols, or **something** when the application loads. Point being I often have to restart bbedit to completely pickup changes to my tags file. You might want to try that and see if it helps your problem. (I may be making this up)

The version of ctags that ships with OS X appears to only support actual C derivatives. Downloading, compiling, and using Exeberant Ctags gives you support for a wider variety of languages (PHP and Javascript being of interest to me). It's a conflict free configure/make/make install. I wrote up instructions for some colleagues a while back that you may find helpful.

I've gotten in the habit of doing a [CMD E] to throw the Symbol I'm looking for into find, and *THEN* doing a [CMD -] to look up the definition. That way if the position of the symbol has shifted since the last time my tags file updated, I can jump to it pretty quickly.

Hope that helps some, and in closing, Monaco 9 4evr!

Scratchpad is fantastic. I no longer have an endless array of 'temp' files I have to go and delete. It just opens it up for me again when I relaunch. Kind of obvious, I've already forgotten the days it wasn't there.

But I just killed autocomplete after a few minutes. Very distracting to have menus popping up every time I pause for thought.

Alan: Thanks. I did read the manual, but I was hoping there was a better way because it didn’t seem to index all the symbols. Does it index the frameworks for you? As I said, the contextual menu works, but when I select a ctags-colored symbol and choose Search > Find Definition, nothing happens (from the manual, I expected to see a sheet).

Michael: My apologies, I think I'm missing something and don't fully understand your problem/question/goal.

Are you having trouble getting ctags to recognize *any* symbols, or is it just symbols in the Framework files?

I'm not a Cocoa developer, so I've never tried to index the framework files. I'm not even sure I know what, precisely, they are. I'm assuming they're just Objective C source and header files. If so Exuberant ctags **should** be able to index them and create tag files. However, I've only used ctags with python, javascript and PHP source files, so I can't say for certain this is the case.

When you say the "contextual menu works", do you mean you can right click a word/symbol somewhere in your code, and then select definitions from the contextual popup to jump to the file and line where that symbol is defined? And then if you text-select the same symbol and choose Search -> Find Definitions nothing happens?

If that's the case, that's really bizarre and not in-line with my experience. It sounds broken and Bare Bones support might be better able to help.

Random Troubleshooting:

If you invoke Find Definitions without selecting anything a sheet will pop-up and allow you to type in the symbol name you're looking for. If you try this and manually type in your symbol name, does that work any better?

Do you see a reference to the symbol you're looking for in the generated tag files? Determining that would at least narrow down the problem (is a symbol not being found by ctags or is BBEdit having trouble with the symbol)

Alan: It recognizes the symbols from the current project, but not from frameworks (mine or Apple’s) that it imports.

Yes, that’s what I’m saying about the contextual menu and Search > Find Definition. The latter does work if nothing is selected, however. So maybe this is a BBEdit bug. Since I hadn’t really used this before, I was assuming that it was working as designed and my expectations were off.

[...] Bare Bones Software | BBEdit 9.0 Release Notes - some really great stuff in here, Michael has a good write-up as well. [...]

I've often used a new window as the scratchpad; guess the scratchpad has the advantage of persistance without prompting you to save when you quit (but who quits BBEdit?)

One nice gem tucked into the release notes: code hinting preserved when copying an excerpt from one document to a new document. Hadn't really thought about the issue directly, but as soon as I read it, I knew that this scratched an itch that I had....

mdhills: Exactly: I always have BBEdit open with a scratch window, so I don’t see what it gains me. I mentioned that gem under “Hits” above.

Code completion got turned off within a couple days after it continued to try to auto-complete numbers in my Javascript code. I would type 1 and it would offer me 10 and 1000... The only way auto-complete is useful is if it offers me relevant suggestions at the right time. I agree with others here it was mostly annoying, offering me things of no use like completing numbers and never anything that was actually of use, like variable names.

I'm adapting to the new find, but things like "Search backwards" were initially missed and the search options checkboxes no longer seem to have key-commands (probably because the search box is no longer modal and those key commands need to access the regular application functions.)

For some reason, I no longer have a Tools menu. It doesn't say it was removed. I see that the functions are available via palettes, but I don't use the functions enough to justify leaving palettes open. So if I want to use the "Format" option, I have to open the palette and then select it.

Michael R.: The new Find windows do have keyboard shortcuts. For example, the Grep checkbox can be toggled with Control-Shift-G. There will be a Tools window if you have plug-ins installed. The Format command has not been provided by a plug-in for a very long time. It's in the Markup menu.

Just to follow up: the keyboard shortcut problems I was having with ctags turned out to be a bug in BBEdit’s Objective-C module, and Bare Bones has fixed this for an upcoming maintenance release.

[...] 9.0.2 fixes the problem with Find Definition and ctags that I encountered with Objective-C [...]

[...] The bbedit --maketags command is much easier than invoking ctags directly. [...]

[...] of my main missing features from BBEdit 9 still apply: no TextMate-style “Go to File” within a project, no Git support, [...]

Leave a Comment