Question

I've recently switched to TextMate from Coda after getting annoyed by the long delays and general slowness of the app. There are a few annoyances in TM but it's mainly because I'm used to one over the other. One aspect that is driving me nuts however is the lack of automatic auto-complete.

For example, in a CSS document in Coda I could begin typing fo and Coda would pop up a list of font-style, font-weight etc. Selecting one of these would then show available properties, bold, light etc, again selectable. In TextMate I've begun using the Bundle auto-completition shortcuts but they're pretty useless as you have to type practically the whole thing for shorter snippets.

Is there any way of making TextMate replicate Coda's behaviour of automatically suggesting as you type? If not, are there any other editors that do (BBEdit?)? Thanks.

Was it helpful?

Solution

Install the TextMate bundle "GetBundles" first

I believe these two terminal commands will do it:

cd ~/Library/Application\ Support/TextMate/Bundles
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/

Then, in TextMate, press Ctrl+Cmd+T (this should be a very familiar shortcut) to bring up the window of bundles that are valid in your current scope. Type 'get bundles' or 'getbundles' and press enter when you are on the right bundle. This opens a window to search a bunch of repos for bundles. In the upper right is a search box. Enter 'CSS'. There are 5-6 CSS bundles available, I would try them out and see if one fits your needs.

TextMate doesn't have that kind of that kind of code parsing built in to the core but I know of at least one bundle (the PHP bundle, now included with TM) that does it.

OTHER TIPS

Pressing escape autocompletes for you. At least nowadays. Maybe it's not as seamless as one would like, but it works.

TextMate has a simple yet effective completion function on ⎋ (escape). It will complete the current word based on matches in the current document. If there are multiple matches, you can cycle through these by pressing ⎋ continuously. It is also possible to cycle backwards using ⇧⎋.

Source

You might try Espresso (http://macrabbit.com/espresso/): its auto-complete is similar.

Textmate also has tab triggers, which can be very useful and are as close as it gets to auto-complete on TextMate.

For example, if you type in "head" and then press tab, this will show up automagically:

<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page Title</title>

Textmate already has this built in for a few HTML tags, but only a very small number. So, you'll probably want to get a bundle that will expand tab triggers to cover all kinds of tags.

If you do everything that Brandon and matkins have already told you to do and search for the "HTML+" bundle (which can also be found on GitHub), this will allow tab triggers for almost all possible HTML elements and attributes.

Then, for example, you can type "p" and then the tab button and this will show up automagically:

<p></p>

with the curser in between the two tags.

You may be able to find similar bundles for CSS and other things – I haven't looked yet.

Again, this is as close to tag autocompleting that Textmate can get, as far as I have found.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top