3 min read

(For more resources on Plone, see here.)

Text editors

The last key piece to successfully skinning a site is to choose a text editor or CSS editor that matches your needs and plays well with Plone. We are not talking about a word processor here, like Microsoft Word or Pages; rather, a text editor is a type of program used for editing plain text files. Text editors are often provided with operating systems or software development packages, and can be used to change configuration files and programming language source code.

We’ll look at a few of the more popular text editors that are appropriate for Plone development and theming.

TextMate

TextMate is a combination of text editor and programming tool that is exclusively for the Mac, and can be found at http://macromates.com.

One of the key joys of working with TextMate is that it lets you open up an entire file structure at once to make navigation between related files easier. For Plone, this is essential. Your average file structure will look something like this:

Skinner's Toolkit for Plone 3 Theming (Part 2)

Rather than opening the entire buildouts folder, or even the plonetheme.copperriver folder, generally you only want to open the structure closest to the files you need in order to keep performance snappy—in this case, mybuildout[rockaway]/src/plonetheme.copperriver/plonetheme/copperriver/:

Skinner's Toolkit for Plone 3 Theming (Part 2)

As you can see, it opens the entire project in a clean interface with an easily navigable structure. Without this feature, skinning for Plone would be much more time-consuming.

TextMate also offers numerous programmer-related tools:

  • You can open two files at once (or more), and using the diff option you can compare the files easily
  • Subversion (svn) support
  • Ability to search and replace in a project
  • Regular expression search and replace (grep)
  • Auto-indent for common actions such as pasting text
  • Auto-completion of brackets and other characters
  • Clipboard history
  • Foldable code blocks
  • Support for more than 50 languages
  • Numerous key combinations (for example, Apple + T opens a search window that makes it easy to locate a file)
  • Themable syntax highlight colors
  • Visual bookmarks to jump between places in a file
  • Copy/paste of columns of text
  • Bundles
  • And much, much more

The Bundle feature is one of the more interesting aspects of the tool. If you look at the HTML bundle, for example, it shows a list of common actions that you might wish to perform in a given document, and on the right, the code that spawns that action, and the hot-key that activates it.

Skinner's Toolkit for Plone 3 Theming (Part 2)

There’s even a Zope/Plone TextMate support bundle found at http://plone.org/products/textmate-support that was developed by some of Plone’s core developers. It enhances TextMate’s already existing support for Python, XML, (X)HTML, CSS, and Restructured Text by adding features aimed specifically at the modern day Zope and Plone developer.

For the geeks in the audience, the bundle’s features include: Doctest support (restructured text with inline Python syntax and auto-indent of python code), pdb support (for debugging), ZCML support (no more looking up directives with our handy and exhaustive snippets), and a ZPT syntax that marries the best of both worlds (XML strictness with the goodness of TextMate’s HTML support). This bundle plus TextMate’s other capabilities make switching to developing for Plone on a Mac a good idea any day!

As well as assigning a single key equivalent to a bundle item, it is possible to assign a tab trigger to the item. This is a sequence of text that you enter in the document and follow it by pressing the tab key. This will remove the sequence entered and then execute the bundle item. TextMate is full of hot-keys and features in general, yet it’s surprisingly compact. Thankfully, the documentation is thorough.

TextMate is a dream for themers and programmers alike. For those who are still new at CSS, another tool might be a good place to start, but for power users, TextMate is the primary tool of choice.


Subscribe to the weekly Packt Hub newsletter. We'll send you the results of our AI Now Survey, featuring data and insights from across the tech landscape.

* indicates required