Getting More Out of CSSEdit Part 2: Editing the Auto Completion Plist

In Summary

Editing the Auto Completion plist file in CSSEdit for more properties and custom values. Want CSS3 support? You got it.

Contents
Headline h3 Lorem
Ipsum Dolor
Some Other Sub Headline
In Conclusion

Tuesday, August 12th, 2008

categories
code collection, css
tags
, , , ,

As awesome as CSSEdit is, there’s always room for improvement. The auto completion feature for properties and values is brilliant, but one thing that bothered me was the absence of a few properties and values.  Luckily these properties and values are stored in a .plist file.  What’s the big whoop?  Well, you can edit that plist file to get (almost) exactly what you want from the auto completion dropdown. Warning: Make a backup of your plist before you go willy nilly mucking with it.  I cannot be held responsible if you mangle your plist!  Please read the notes at the end of the post regarding plist editing before you edit your plist.  Always make a backup!

So, where the hell is this file? It’s inside of the CSSEdit.app package.  This can be found in Applications – CSSEdit.app (right click and select “Show Package Contents”) – Contents – Resources – AutoCompletion.plist. (Edit – Nov. 16 2009: You can also download a zip file of my latest version of the .plist file.) (Remember: do not edit or replace your plist until you have made a backup of it!)

Make sure CSSEdit is not running and then right click on “AutoCompletion.plist” and select “Open With – Property List Editor.app”.  On Leopard (if my memory serves me correctly), you’ll have to have the Developer Tools/Xcode Tools installed from the Leopard DVD. Otherwise you can edit the plist as straight XML with a text editor like TextMate or TextEdit, but this tutorial uses the Property List Editor.

Once the Property List Editor is fired up, you should see something similar to the screen shot below:

Click on the arrow next to “Root” to expand it, and then do the same to expand one of the CSS properties.  In the example below, I’ve expanded the property “background”.  As you can see I’ve already added some custom values to the “background” property such as ‘url(../images/)’, ‘url()’, and ‘url(i/)’. These are all values I frequently use within a few different development environments.  You can add a new value to a property by having the property selected and then clicking the “New Child” button.  Once you’re inside of a property and adding values, the “New Child” button will change to “New Sibling” so you can add additional values within the same property. When you’re done, dont forget to Save.

The next example shows one of my motivating factors for editing the CSSEdit auto completion plist in the first place.  I like to use “text-indent: -9999px;” for Rundle/Phark image replacement, so I added “-9999px” as a possible value for the “text-indent” property.  Now all I have to type is “-” and hit “semicolon” (or “enter”) and I get “-9999px;” (or “-9999px”). Sweet.

Below is an example of some custom values that I added to the “background-image” property now showing up in the auto completion dropdown:

Properties and Values worth adding

If you’re like me and have the *pleasure* of doing a lot of IE6 debugging, then you might want to add “zoom” as one of your properties (“z-index” will still be the first auto complete option when you just type “z” so it’s pretty harmless).  Also “inline-block” (which FF3 now supports) as a value for the “display” property is handy for IE6 damage control.

Other values I’ve added:

  • for “background” and “background-image”: ‘url(../images/)’, ‘url()’, ‘url(i/)’, ‘url(../img/)’ – (your preferences may vary)
  • for “font-family”: ‘Arial’, ‘Helvetica’, ‘Georgia’ (see notes at end of post regarding (not) using spaces)
  • for “font-size”: ‘62.5%’
  • for “text-indent”: ‘-9999px’

You could really go nuts adding all of the CSS3 properties and values that CSSEdit lacks – not to mention browser specific properties and values for Safari/WebKit, Opera, and Firefox.  Since CSSEdit uses webkit for its on-the-fly preview, it seems a natual fit to at least add webkit properties (perhaps as an option) to the next update of CSSEdit.

Download the Modified .plist File

If you don’t want to spend all your time hacking the .plist file and just want to add more CSS3, Mozilla, and Webkit support to CSSEdit, you can download the modified auto completion .plist file here.

Disclaimers and Notices and Warnings – Oh My!

Always make a backup before editing your plist!

I’m no expert on plists, but it seems that things will go haywire if you use spaces.  I tried adding “transparent url(../images/) no-repeat 0 0″ as a possible value for the “background” property and things went wonky.  I did some digging and haven’t found The Dummy’s Guide to Editing Plist Files that I had hoped for, but I’m pretty certain that space characters are a plist no-no.  The same may or may not be true about quotes and/or double quotes but I’m not entirely sure.  Perhaps there is a delimiter that can be used to safely escape spaces and other special characters?  If anyone can shed some light on the do’s and dont’s of editing plist files, I’d be grateful!

end

Comments, Quips & Protestations

  1. 1 August 13, 2008 7:27 am Mark Aplet

    Great info Andy! I am going to download cssedit today and play around with it. Thanks for talking about it yesterday. It’s great to have personal reviews of software so you can make an unbiased opinion of the software. Not one based on advertising agendas.

  2. 2 August 17, 2008 2:00 pm links for 2008-08-17 :: What else is new?

    [...] Getting More Out of CSSEdit Part 2: Editing the Auto Completion Plist | Aloe Studios Blog (tags: webdesign tutorials mac css) [...]

  3. 3 August 18, 2008 1:00 pm links for 2008-08-18 :: What else is new?

    [...] Getting More Out of CSSEdit Part 2: Editing the Auto Completion Plist | Aloe Studios Blog (tags: webdesign tutorials mac css) [...]

  4. 4 April 18, 2009 4:47 pm CSSEdit Tip: How to add your own Custom Autocomplete Items to CSSEdit | mozami.net blog

    [...] View the full article over at the Aloe Studios Blog. [...]

  5. 5 December 15, 2009 4:04 pm Compartiendo desde delicious. 14 de Diciembre – 15 de Diciembre | David Táboas

    [...] Getting More Out of CSSEdit Part 2: Editing the Auto Completion Plist | Aloe Studios Blog – [...]

  6. 6 December 16, 2009 3:50 am adrinux

    Nice tip.

    If there’s one thing I’d like to see it’s this on github or similar. Might be easier to have a master with common improvements vs a fork/branch with personal stuff added too.

    But maybe that’s something I can do ? :)

  7. 7 February 15, 2010 3:11 am Ecenica

    Thanks for sharing your hack. Applied your plist and styles are showing perfectly. This will save thousands of keystrokes!

Leave a Reply

Anonymous cowards & comments demonstrating a lack of having read the material or a lack of common decency are subject to deletion