Книга: Embedded Linux development using Eclipse

Editor Preferences

Editor Preferences

General editor preferences include the ability to change various colors. I find the default color for highlighting matching braces to be a bit “subtle.” To change it, select Matching brackets highlight under Appearance color options: and then click on the Color: button.

A few of the more interesting editor preference subcategories are described here.

Content AssistWith Content Assist, the C/C++ editor can offer suggestions about key words and phrases commonly used in C. Type part of a keyword followed by Ctrl+Space to bring up a list of suggestions. When the list has been reduced to one item, the editor can automatically insert that item into your code.

The related auto-completion feature can use “.”, “->”, and “::” as triggers to invoke auto-completion on structures and class definitions.

Content Assist is based on templates that can be specified under Template preferences (see below).

FoldingFolding hides the detailed contents of selected regions in a source file. This can be a useful strategy for browsing through large files. Figure 3.21 is an example of a file with functions and macros folded. Click on the “+” icon next to the name to see the contents of a specific function or macro.


Figure 3.21: Folded source file.

Folding preferences let you select if folding is enabled when a new editor is opened, and which sections of code will be folded.

Syntax Coloring There are a large number of semantic elements to which specific coloring and font styles can be assigned. Many of these are not enabled by default and among those that are enabled many share the same coloring. Here’s your chance to “go wild,” if you’re so inclined, and create some exciting color schemes.

Templates Templates are the basis for Content Assist. There’s a default set of templates representing common C/C++ code snippets. You can add your own templates with New, and Edit existing templates.

Typing Typing preferences are another way in which the editor provides assistance. You can tell the editor to automatically close quoted strings, parentheses, brackets, and braces. When you type an opening parenthesis or bracket, the editor automatically inserts the matching close and positions the cursor between them. Type what should be enclosed, then hit Enter to position the cursor just beyond the matching close.

Оглавление книги

Оглавление статьи/книги

Генерация: 4.080. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз