Sie sind auf Seite 1von 2

Drag and drop of text

If you drag selected text in the editor widget of Geany the text is moved to the position where the mouse pointer is
when releasing the mouse button. Holding Control when releasing the mouse button will copy the text instead.
This behaviour was changed in Geany 0.11 - before the selected text was copied to the new position.

Indentation
Geany allows each document to indent either with a tab character, multiple spaces or a combination of both. The
default indent settings are set in Editor Indentation preferences (see the link for more information).

The default settings can be overridden per-document using the Document menu. They can also be overridden by
projects - see Project management.

The indent mode for the current document is shown on the status bar as follows:

TAB
Indent with Tab characters.
SP
Indent with spaces.
T/S
Indent with tabs and spaces, depending on how much indentation is on a line.

Applying new indentation settings


After changing the default settings you may wish to apply the new settings to every document in the current
session. To do this use the Project->Apply Default Indentation menu item.

Detecting indent type


The Detect from file indentation preference can be used to scan each file as it's opened and set the indent type
based on how many lines start with a tab vs. 2 or more spaces.

Auto-indentation
When enabled, auto-indentation happens when pressing Enter in the Editor. It adds a certain amount of indentation
to the new line so the user doesn't always have to indent each line manually.

Geany has four types of auto-indentation:

None
Disables auto-indentation completely.
Basic
Adds the same amount of whitespace on a new line as on the last line.
Current chars
Does the same as Basic but also indents a new line after an opening brace '{', and de-indents when typing a
closing brace '}'. For Python, a new line will be indented after typing ':' at the end of the previous line.
Match braces
Similar to Current chars but the closing brace will be aligned to match the indentation of the line with the
opening brace.

There is also XML-tag auto-indentation. This is enabled when the mode is more than just Basic, and is also
controlled by a filetype setting - see xml_indent_tags.

Bookmarks
Geany provides a handy bookmarking feature that lets you mark one or more lines in a document, and return the
cursor to them using a key combination.
To place a mark on a line, either left-mouse-click in the left margin of the editor window, or else use Ctrl-m. This
will produce a small green plus symbol in the margin. You can have as many marks in a document as you like.
Click again (or use Ctrl-m again) to remove the bookmark. To remove all the marks in a given document, use
"Remove Markers" in the Document menu.

To navigate down your document, jumping from one mark to the next, use Ctrl-. (control period). To go in the
opposite direction on the page, use Ctrl-, (control comma). Using the bookmarking feature together with the
commands to switch from one editor tab to another (Ctrl-PgUp/PgDn and Ctrl-Tab) provides a particularly fast
way to navigate around multiple files.

Code navigation history


To ease navigation in source files and especially between different files, Geany lets you jump between different
navigation points. Currently, this works for the following:

 Go to tag declaration
 Go to tag definition
 Symbol list items
 Build errors
 Message items

When using one of these actions, Geany remembers your current position and jumps to the new one. If you decide
to go back to your previous position in the file, just use "Navigate back a location". To get back to the new
position again, just use "Navigate forward a location". This makes it easier to navigate in e.g. foreign code and
between different files.

Sending text through custom commands


You can define several custom commands in Geany and send the current selection to one of these commands
using the Edit->Format->Send Selection to menu or keybindings. The output of the command will be used to
replace the current selection. This makes it possible to use text formatting tools with Geany in a general way.

The selected text will be sent to the standard input of the executed command, so the command should be able to
read from it and it should print all results to its standard output which will be read by Geany. To help finding
errors in executing the command, the output of the program's standard error will be printed on Geany's standard
output.

If there is no selection, the whole current line is used instead.

To add a custom command, use the Send Selection to->Set Custom Commands menu item. Click on Add to get a
new item and type the command. You can also specify some command line options. Empty commands are not
saved.

Normal shell quoting is supported, so you can do things like:

 sed 's/\./(dot)/g'
The above example would normally be done with the Replace all function, but it can be handy to have common
commands already set up.

Das könnte Ihnen auch gefallen