Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Controlling the Appearance of the Code Editor

Xcode gives you a great deal of flexibility to customize the appearance of the editor. You can change the fonts and colors used to display text in the editor to suit your own preferences. You can also control the amount of information that Xcode displays about file locations and contents. This section describes how to change the default font and text editing colors for Xcode editors, and how to use the gutter, page guide, and file history menu to locate information in a file.

In this section:

Setting Default Fonts and Colors
Displaying a Page Guide
Displaying the Editor Gutter
Viewing Column and Line Positions


Setting Default Fonts and Colors

You can change the font and colors used for text editing in Xcode in the Xcode Preferences window. Choose Xcode > Preferences and select Fonts & Colors. The Editor Font section displays the font used for text in the editor; to change this font, click the Set Font button.

Note: This font is also used for all text, regardless of its role, when syntax coloring is enabled, unless you specify otherwise. See “Setting Syntax Coloring” for more information.

To change the colors used in the editor, use the Editor Colors options. To change the color of an item, click its color well and choose a new color. You can change the default color for the following elements:

Displaying a Page Guide

To help keep code lines no longer than a specified length, you can have Xcode display a guide line in every code editor at that column position in the file. To display a guide line, open the Text Editing pane of Xcode Preferences and select “Show page guide” in Display Options. Enter the location, in number of characters, at which you want the guide line displayed in the text field titled “Display at column.” Xcode displays a gray line in the right margin of all open editors, at the specified column.

Xcode does not wrap your code lines when they reach the guide line. The line serves only as a guide.

Displaying the Editor Gutter

The gutter that appears on the left side of a code editor helps you quickly locate items in a file. This gutter can display:

You can control the visibility of the gutter in a single editor or set the default behavior for all editors. To change the visibility of the gutter for all editors that you open, standalone and attached, open the Text Editing pane of Xcode Preferences and use the “Show gutter” option in Display Options. If this option is selected, as it is by default, the gutter is visible in all editors that you open. Otherwise, the gutter appears in all code editors only when you start debugging.

To show or hide the gutter in a particular instance of the editor, bring the window to the front and use the View > Hide Gutter and View > Show Gutter commands.

Viewing Column and Line Positions

As you’ve seen in “The Navigation Bar,” the File History pop-up menu in the navigation bar not only lets you move between currently open files, it also shows you your current location in the file. For the file currently open in the editor, the File History menu shows the name and the line number of the line containing the insertion point. You can also have the File History menu display the column position of the insertion point; that is, the offset of the insertion point, in number of characters, from the left margin of the editor. Figure 15-8 shows the location of the current insertion point in the File History menu.


Figure 15-8  Line and column positions in the File History pop-up menu

Figure 15-8 Line and column positions in the File History pop-up menu

By default, Xcode does not display the column position of the insertion point. To change this, open the Text Editing pane of Xcode Preferences and select “Show column position.”



< Previous PageNext Page > Hide TOC


Last updated: 2006-11-07




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice