Chapter 3. Editing

Table of Contents
Editing Commands
CUTE Commands

There are three ways to edit text in CUTE. First you can use keyboard commands, either directly or by means of macros. Second you can use a CUTE command, which you type in the command box on the toolbar. Finally you can write python scripts, which are discussed in the 'Programming CUTE' chapter.

A CUTE command can be undone by typing Ctrl+Z. The available editing commands can be seen in the 'Options > Configure Shortcuts' menu item.

Editing Commands

CUTE is designed for supporting as much programming languages as possible, thus many common editing commands are defined. The python interface is for new language specific commands.

Text Modification, Cut, Copy and Paste

You can edit text in CUTE just like in any text editor which is compatible with common GUI standards. Two editing modes are supported: inserting and overwriting. Switch between them by pressing Ins. If there is text selected, Cut it with Shift+Del and Paste it with Shift+Ins (the key-bindings may be altered to those of your choosing). Please note that there are two different clipboards available: the X Window clipboard and the clipboard of the current view. When you mark text with the mouse it is copied to the X clipboard and can be pasted by a middle click of the mouse. If your mouse has only two buttons, middle clicks can usually be emulated by clicking the left and right buttons at the same time.

Selection

There are two text selection modes available. The default is Stream selection (where the mouse selects all the text between left button down and left up), but you can switch to rectangle mode by pressing Ctrl+Alt during the selection process (this selects only the text within the rectangular area defined by the mouse). Double-clicking selects a word, where a word is defined as the text between two delimiters (what constitutes a delimiter depends on the current language).

Bookmarks

A bookmark is a highlit line in a file and is created by clicking the margin. The bookmark adjusts automatically when lines are deleted or inserted. You can jump to a bookmark by right clicking the mouse and selecting one from the Bookmarks sub menu (or use the Search menu). To delete one, just click on the margin. If a project is loaded, any bookmarks are stored in the project file.

Autocompletion

Autocompletion completes the current word if a similar word is found. In the options dialog you can select either the current file or the current tags file as the autocompletion source. After you have typed several characters of a word, the autocompletion list will automatically pop up. The number of chars to type before this happens can be defined in the Threshold option in the options dialog. If you prefer to control autocompletion yourself, put a huge number in Threshold so that it never triggers; then when you want to autocomplete a word, type (by default) Ctrl+Return.

Indentation

Indentation is configured by four options: indentationsUseTabs, autoIndent, tabIndents and backspaceUnindents. Normally pressing Tab inserts a tab, but if you set the indentationsUseTabs option you can press Tab anywhere in the line and the whole line will indent one tabs-worth. If autoindent is enabled, when a new line is created by pressing Return, it inherits the current indentation level. indentationsUseTabs decides whether tabs or spaces are used for indentation. The number of spaces is set with the tabWidth option, which you can also set in the Options > Tab Size menu.

Folding and Zooming

Depending on the current programming language, Folding can be used to hide parts of the code e.g. the body of a function or an if statement can be hidden. CUTE supports multifont editing, thus it is laborious to set each font size separately. Zooming increments or decrements each font size.