Top Banner

of 101

GeanyMan Txt

Apr 06, 2018

Download

Documents

dani19xx
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/3/2019 GeanyMan Txt

    1/101

    .. |(version)| replace:: 0.21

    =======Geany=======

    -------------------------

    A fast, light, GTK+ IDE-------------------------

    :Authors: Enrico Trger,Nick Treleaven,Frank Lanitz,Colomban Wendling

    :Date: $Date: 2011-10-02 15:13:10 +0200 (dim. 02 oct. 2011) $:Version: |(version)|

    Copyright 2005-2011

    This document is distributed under the terms of the GNU General Public

    License as published by the Free Software Foundation; either version 2of the License, or (at your option) any later version. A copy of thislicense can be found in the file COPYING included with the source codeof this program, and also in the chapter GNU General Public License`_.

    .. contents::

    Introduction============

    About Geany-----------

    Geany is a small and lightweight Integrated Development Environment. Itwas developed to provide a small and fast IDE, which has only a fewdependencies on other packages. Another goal was to be as independentas possible from a particular Desktop Environment like KDE or GNOME -Geany only requires the GTK2 runtime libraries.

    Some basic features of Geany:

    * Syntax highlighting

    * Code folding* Autocompletion of symbols/words* Construct completion/snippets* Auto-closing of XML and HTML tags* Calltips* Many supported filetypes including C, Java, PHP, HTML, Python, Perl,Pascal, and others

    * Symbol lists* Code navigation

    1

  • 8/3/2019 GeanyMan Txt

    2/101

  • 8/3/2019 GeanyMan Txt

    3/101

    ---------------

    There are many binary packages available. For an up-to-date but maybeincomplete list see http://www.geany.org/Download/ThirdPartyPackages.

    Source compilation------------------

    Compiling Geany is quite easy.To do so, you need the GTK (>= 2.12.0) libraries and header files.You also need the Pango, GLib and ATK libraries and header files.All these files are available at http://www.gtk.org, but very oftenyour distro will provide development packages to save the trouble ofbuilding these yourself.

    Furthermore you need, of course, a C and C++ compiler. The GNU versionsof these tools are recommended.

    Autotools based build system^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    The Autotools based build system is very mature and has been well tested.To use it, you just need the Make tool, preferably GNU Make.

    Then run the following commands::

    $ ./configure$ make

    Then as root::

    % make install

    Waf based build system^^^^^^^^^^^^^^^^^^^^^^

    The Waf build system is still quite young and under heavy development but already in ausable state. In contrast to the Autotools system, Waf needs Python. So before using Waf, you needto install Python on your system.The advantage of the Waf build system over the Autotools based build system is that the wholebuild process might be a bit faster. Especially when you use the Wafcache feature for repetitive builds (e.g. when changing only a few source filesto test something) will become much faster since Waf will cache and re-use theunchanged built files and only compile the changed code again. See Waf Cache`_ for details.To build Geany with Waf as run::

    $ ./waf configure$ ./waf build

    Then as root::

    % ./waf install

    Waf cache

    3

  • 8/3/2019 GeanyMan Txt

    4/101

    `````````

    The Waf build system has a nice and interesting feature which can help to avoida lot of unnecessary rebuilding of unchanged code. This often happens when developing new featuresor trying to debug something in Geany.Waf is able to store and retrieve the object files from a cache. This cache is declaredusing the environment variable `WAFCACHE``.A possible location of the cache directory could be ``~/.cache/waf` . In order to make use of

    this, you first need to create this directory::

    $ mkdir -p ~/.cache/waf

    then add the environment variable to your shell configuration (the following example is forBash and should be adjusted to your used shell)::

    export WAFCACHE=/home/username/.cache/waf

    Remember to replace `username`` with your actual username.

    More information about the Waf cache feature are available athttp://code.google.com/p/waf/wiki/CacheObjectFiles.

    Cleaning the cache******************You should be careful about the size of the cache directory as it maygrow rapidly over time.Waf doesn't do any cleaning or other house-keeping of the cache yet, so you need to keep itclean by yourself.An easy way to keep it clean is to run the following command regularly to remove oldcached files::

    $ find /home/username/.cache/waf -mtime +14 -exec rm {} \;

    This will delete all files in the cache directory which are older than 14 days.

    For details about the ``find`` command and its options, check its manual page.

    Custom installation^^^^^^^^^^^^^^^^^^^The configure script supports several common options, for a detailedlist, type::

    $ ./configure --help

    or::

    $ ./waf --help

    (depending on which build system you use).

    You may also want to read the INSTALL file for advanced installationoptions.

    * See also `Compile-time options`_.

    4

  • 8/3/2019 GeanyMan Txt

    5/101

    Dynamic linking loader support and VTE^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^In the case that your system lacks dynamic linking loader support, youprobably want to pass the option `--disable-vte`` to the `configure``script. This prevents compiling Geany with dynamic linking loadersupport for automatically loading `libvte.so.4`` if available.

    Build problems

    ^^^^^^^^^^^^^^If there are any errors during compilation, check your buildenvironment and try to find the error, otherwise contact the mailinglist or one the authors. Sometimes you might need to ask for specifichelp from your distribution.

    Installation prefix-------------------If you want to find Geany's system files after installation you maywant to know the installation prefix.

    Pass the ``--print-prefix`` option to Geany to check this - see

    `Command line options`_. The first path is the prefix.

    On Unix-like systems this is commonly `/usr`` if you installed froma binary package, or ``/usr/local ` if you build from source.

    .. note::Editing system files is not necessary as you can use theper-user configuration files instead, which don't need rootpermissions. See `Configuration files`_.

    Usage=====

    Getting started---------------

    You can start Geany in the following ways:

    * From the Desktop Environment menu:

    Choose in your application menu of your used Desktop Environment:Development --> Geany.

    * From the command line:

    To start Geany from a command line, type the following and pressReturn::

    % geany

    The Geany workspace-------------------

    5

  • 8/3/2019 GeanyMan Txt

    6/101

    The Geany window is shown in the following figure:

    .. image:: ./images/main_window.png

    The workspace has the following parts:

    * The menu.

    * An optional toolbar.* An optional sidebar that can show the following tabs:

    * Documents - A document list, and* Symbols - A list of symbols in your code.

    * The main editor window.* An optional message window which can show the following tabs:

    * Status - A list of status messages.* Compiler - The output of compiling or building programs.* Messages - Results of 'Find Usage', 'Find Usage' 'Find in Files' and other actions* Scribble - A text scratchpad for any use.

    * Terminal - An optional terminal window.

    * A status bar

    Most of these can be configured in the `Interface preferences`_, the`View menu`_, or the popup menu for the relevant area.

    Additional tabs may be added to the sidebar and message window by plugins.

    The position of the tabs can be selected in the interface preferences.

    The sizes of the sidebar and message window can be adjusted bydragging the dividers.

    Command line options--------------------

    ============ ======================= =================================================Short option Long option Function============ ======================= =================================================*none* +number Set initial line number for the first opened file

    (same as --line, do not put a space between the + signand the number). E.g. "geany +7 foo.bar" will open thefile foo.bar and place the cursor in line 7.

    *none* --column Set initial column number for the first opened file.

    -c dir_name --config=directory_name Use an alternate configuration directory. The defaultconfiguration directory is `~/.config/geany/`` and thatis where ``geany.conf ` and other configuration filesreside.

    *none* --ft-names Print a list of Geany's internal filetype names (usefulfor snippets configuration).

    6

  • 8/3/2019 GeanyMan Txt

    7/101

    -g --generate-tags Generate a global tags file (see`Generating a global tags file`_).

    -P --no-preprocessing Don't preprocess C/C++ files when generating tags.

    -i --new-instance Do not open files in a running instance, force openinga new instance. Only available if Geany was compiled

    with support for Sockets.

    -l --line Set initial line number for the first opened file.

    *none* --list-documents Return a list of open documents in a running Geanyinstance.This can be used to read the currently opened documents inGeany from an external script or tool. The returned listis separated by newlines (LF) and consists of the full,UTF-8 encoded filenames of the documents.Only available if Geany was compiled with support forSockets.

    -m --no-msgwin Do not show the message window. Use this option if youdo not need compiler messages or VTE support.

    -n --no-ctags Do not load symbol completion and call tip data. Use thisoption if you do not want to use them.

    -p --no-plugins Do not load plugins or plugin support.

    *none* --print-prefix Print installation prefix, the data directory, the libdirectory and the locale directory (in that order) tostdout, one line each. This is mainly intended for pluginauthors to detect installation paths.

    -s --no-session Do not load the previous session's files.

    -t --no-terminal Do not load terminal support. Use this option if you donot want to load the virtual terminal emulator widgetat startup. If you do not have ``libvte.so.4 ` installed,then terminal-support is automatically disabled. Onlyavailable if Geany was compiled with support for VTE.

    *none* --socket-file Use this socket filename for communication with arunning Geany instance. This can be used with the followingcommand to execute Geany on the current workspace::

    geany --socket-file=/tmp/geany-sock-$(xprop -root _NET_CURR

    *none* --vte-lib Specify explicitly the path including filename or onlythe filename to the VTE library, e.g.``/usr/lib/libvte.so`` or ``libvte.so` . This option isonly needed when the auto-detection does not work. Onlyavailable if Geany was compiled with support for VTE.

    -v --verbose Be verbose (print useful status messages).

    7

  • 8/3/2019 GeanyMan Txt

    8/101

    -V --version Show version information and exit.

    -? --help Show help information and exit.

    *none* [files ...] Open all given files at startup. This option causesGeany to ignore loading stored files from the lastsession (if enabled).

    Geany also recognizes line and column information whenappended to the filename with colons, e.g."geany foo.bar:10:5" will open the file foo.bar andplace the cursor in line 10 at column 5.

    Projects can also be opened but a project file (\*.geany)must be the first non-option argument. All additionallygiven files are ignored.

    ============ ======================= =================================================

    You can also pass line number and column number information, e.g.::

    geany some_file.foo:55:4

    Geany supports all generic GTK options, a list is available on thehelp screen.

    General-------

    Startup^^^^^^^

    At startup, Geany loads all files from the last time Geany waslaunched. You can disable this feature in the preferences dialog(see `General Startup preferences`_). If you specify somefiles on the command line, only these files will be opened, but youcan find the files from the last session in the file menu under the"Recent files" item. By default this contains the last 10 recentlyopened files. You can change the number of recently opened files inthe preferences dialog.

    You can start several instances of Geany, but only the first willload files from the last session. To run a second instance of Geany,do not specify any filenames on the command-line, or disable opening

    files in a running instance using the appropriate command line option.

    Opening files from the command-line in a running instance^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^

    Geany detects if there is an an instance of itself already running and opens filesfrom the command-line in that instance. So, Geany canbe used to view and edit files by opening them from other programs

    8

  • 8/3/2019 GeanyMan Txt

    9/101

    such as a file manager.

    You can also pass line number and column number information, e.g.::

    geany some_file.foo:55:4

    This would open the file ``some_file.foo`` with the cursor on line 55,column 4.

    If you do not like this for some reason, you can disable using the firstinstance by using the appropriate command line option -- see the sectioncalled Command line options`_.

    Virtual terminal emulator widget (VTE)^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^

    If you have installed ``libvte.so`` on your system, it is loadedautomatically by Geany, and you will have a terminal widget in thenotebook at the bottom.

    If Geany cannot find any `libvte.so`` at startup, the terminal widgetwill not be loaded. So there is no need to install the package containingthis file in order to run Geany. Additionally, you can disable the useof the terminal widget by command line option, for more informationsee the section called Command line options`_.

    You can use this terminal (from now on called VTE) much as you woulda terminal program like xterm. There is basic clipboard support. Youcan paste the contents of the clipboard by pressing the right mousebutton to open the popup menu, and choosing Paste. To copy text fromthe VTE, just select the desired text and then press the right mousebutton and choose Copy from the popup menu. On systems running theX Window System you can paste the last selected text by pressing themiddle mouse button in the VTE (on 2-button mice, the middle buttoncan often be simulated by pressing both mouse buttons together).

    In the preferences dialog you can specify a shell which should bestarted in the VTE. To make the specified shell a login shell justuse the appropriate command line options for the shell. These optionsshould be found in the manual page of the shell. For zsh and bashyou can use the argument `--login``.

    .. note::Geany tries to load ``libvte.so``. If this fails, it tries to loadsome other filenames. If this fails too, you should check whether you

    installed libvte correctly. Again note, Geany will run without thislibrary.

    It could be, that the library is called something else than``libvte.so` (e.g. on FreeBSD 6.0 it is called `libvte.so.8` ). If soplease set a link to the correct file (as root)::

    # ln -s /usr/lib/libvte.so.X /usr/lib/libvte.so

    9

  • 8/3/2019 GeanyMan Txt

    10/101

    Obviously, you have to adjust the paths and set X to the number of your``libvte.so``.

    You can also specify the filename of the VTE library to use on the commandline (see the section called Command line options`_) or at compile timeby specifying the command line option ``--with-vte-module-path ` to./configure.

    Defining own widget styles using .gtkrc-2.0^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^

    You can define your widget style for many of Geany's GUI parts. Todo this, just edit your `.gtkrc-2.0`` (usually found in your homedirectory on UNIX-like systems and in the etc subdirectory of yourGeany installation on Windows).

    To have a defined style used by Geany you must assign it toat least one of Geany's widgets. For example use the following line::

    widget "Geany*" style "geanyStyle"

    This would assign your style "geany_style" to all Geanywidgets. You can also assign styles only to specific widgets. At themoment you can use the following widgets:

    * GeanyMainWindow* GeanyEditMenu* GeanyToolbarMenu* GeanyDialog* GeanyDialogPrefs* GeanyDialogProject* GeanyDialogSearch* GeanyMenubar* GeanyToolbar

    An example of a simple `.gtkrc-2.0` ::

    style "geanyStyle"{

    font_name="Sans 12"}widget "GeanyMainWindow" style "geanyStyle"

    style "geanyStyle"{

    font_name="Sans 10"}widget "GeanyPrefsDialog" style "geanyStyle"

    Documents---------

    Switching between documents

    10

  • 8/3/2019 GeanyMan Txt

    11/101

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

    The documents list and the editor tabs are two different waysto switch between documents using the mouse. When you hit the keycombination to move between tabs, the order is determined by the taborder. It is not alphabetical as shown in the documents list(regardless of whether or not editor tabs are visible).

    See the Notebook tab keybindings _ section for usefulshortcuts including for Most-Recently-Used document switching.

    Character sets and Unicode Byte-Order-Mark (BOM)------------------------------------------------

    Using character sets^^^^^^^^^^^^^^^^^^^^

    Geany provides support for detecting and converting character sets. Soyou can open and save files in different character sets, and even

    convert a file from one character set to another. To do this,Geany uses the character conversion capabilities of the GLib library.

    Only text files are supported, i.e. opening files which containNULL-bytes may fail. Geany will try to open the file anyway but it islikely that the file will be truncated because it can only be read upto the first occurrence of a NULL-byte. All characters after thisposition are lost and are not written when you save the file.

    Geany tries to detect the encoding of a file while opening it, butauto-detecting the encoding of a file is not easy and sometimes anencoding might not be detected correctly. In this case you have toset the encoding of the file manually in order to display itcorrectly. You can this in the file open dialog by selecting anencoding in the drop down box or by reloading the file with thefile menu item "Reload as". The auto-detection works well for mostencodings but there are also some encodings where it is known thatauto-detection has problems.

    There are different ways to set different encodings in Geany:

    * Using the file open dialog

    This opens the file with the encoding specified in the encoding dropdown box. If the encoding is set to "Detect from file" auto-detection

    will be used. If the encoding is set to "Without encoding (None)" thefile will be opened without any character conversion and Geany willnot try to auto-detect the encoding (see below for more information).

    * Using the "Reload as" menu item

    This item reloads the current file with the specified encoding. It canhelp if you opened a file and found out that the wrong encoding was used.

    11

  • 8/3/2019 GeanyMan Txt

    12/101

    * Using the "Set encoding" menu item

    Contrary to the above two options, this will not change or reloadthe current file unless you save it. It is useful when you want tochange the encoding of the file.

    * Specifying the encoding in the file itself

    As mentioned above, auto-detecting the encoding of a file may fail onsome encodings. If you know that Geany doesn't open a certain file,you can add the specification line, described in the next section,to the beginning of the file to force Geany to use a specificencoding when opening the file.

    In-file encoding specification^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Geany detects meta tags of HTML files which contain charset informationlike::

    and the specified charset is used when opening the file. This is useful if theencoding of the file cannot be detected properly.For non-HTML files you can also define a line like::

    /* geany_encoding=ISO-8859-15 */

    or::

    # geany_encoding=ISO-8859-15 #

    to force an encoding to be used. The #, /\* and \*/ are examplesof filetype-specific comment characters. It doesn't matter whichcharacters are around the string " geany_encoding=ISO-8859-15 " as longas there is at least one whitespace character before and after thisstring. Whitespace characters are in this case a space or tab character.An example to use this could be you have a file with ISO-8859-15encoding but Geany constantly detects the file encoding as ISO-8859-1.Then you simply add such a line to the file and Geany will open itcorrectly the next time.

    Since Geany 0.15 you can also use lines which match theregular expression used to find the encoding string:``coding[\t ]*[:=][\t ]*([a-z0-9-]+)[\t ]*``

    .. note::These specifications must be in the first 512 bytes of the file.Anything after the first 512 bytes will not be recognized.

    Some examples are::

    # encoding = ISO-8859-15

    12

  • 8/3/2019 GeanyMan Txt

    13/101

    or::

    # coding: ISO-8859-15

    Special encoding "None"^^^^^^^^^^^^^^^^^^^^^^^

    There is a special encoding "None" which uses no

    encoding. It is useful when you know that Geany cannot auto-detectthe encoding of a file and it is not displayed correctly. Especiallywhen the file contains NULL-bytes this can be useful to skip autodetection and open the file properly at least until the occurrenceof the first NULL-byte. Using this encoding opens the file as it iswithout any character conversion.

    Unicode Byte-Order-Mark (BOM)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Furthermore, Geany detects a Unicode Byte Order Mark (seehttp://en.wikipedia.org/wiki/Byte_Order_Mark for details). Of course,

    this feature is only available if the opened file is in a Unicodeencoding. The Byte Order Mark helps to detect the encoding of a file,e.g. whether it is UTF-16LE or UTF-16BE and so on. On Unix-like systemsusing a Byte Order Mark could cause some problems for programs notexpecting it, e.g. the compiler gcc stopswith stray errors, PHP does not parse a script containing a BOM andscript files starting with a she-bang maybe cannot be started. In thestatus bar you can easily see whether the file starts with a BOM ornot.

    If you want to set a BOM for a file or if you want to remove itfrom a file, just use the document menu and toggle the checkbox.

    .. note::If you are unsure what a BOM is or if you do not understand whereto use it, then it is probably not important for you and you cansafely ignore it.

    Editing-------

    Folding

    ^^^^^^^

    Geany provides basic code folding support. Folding means the ability toshow and hide parts of the text in the current file. You can hideunimportant code sections and concentrate on the parts you are working onand later you can show hidden sections again. In the editor window there isa small grey margin on the left side with [+] and [-] symbols whichshow hidden parts and hide parts of the file respectively. Byclicking on these icons you can simply show and hide sections which are

    13

  • 8/3/2019 GeanyMan Txt

    14/101

    marked by vertical lines within this margin. For many filetypes nestedfolding is supported, so there may be several fold points within otherfold points.

    .. note::You can customize the folding icon and line styles - see thefiletypes.common `Folding Settings`_.

    If you don't like it or don't need it at all, you can simply disablefolding support completely in the preferences dialog.

    The folding behaviour can be changed with the "Fold/Unfold all children ofa fold point" option in the preference dialog. If activated, Geany willunfold all nested fold points below the current one if they are alreadyfolded (when clicking on a [+] symbol).When clicking on a [-] symbol, Geany will fold all nested fold pointsbelow the current one if they are unfolded.

    This option can be inverted by pressing the Shiftkey while clicking on a fold symbol. That means, if the "Fold/Unfold allchildren of a fold point" option is enabled, pressing Shift will disable

    it for this click and vice versa.

    Column mode editing (rectangular selections)^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^

    There is basic support for column mode editing. To use it, create arectangular selection by holding down the Control and Shift keys(or Control and Alt if it doesn't work) whileselecting some text. It is also possible to create a zero-column selection.Once a rectangular selection exists you can start editing the text withinthis selection and the modifications will be done for every line in theselection.

    Drag and drop of text^^^^^^^^^^^^^^^^^^^^^

    If you drag selected text in the editor widget of Geany the text ismoved to the position where the mouse pointer is when releasing themouse button. Holding Control when releasing the mouse button willcopy 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 indentsettings are set in `Editor Indentation preferences`_ (see the linkfor more information).

    The default settings can be overridden per-document using the

    14

  • 8/3/2019 GeanyMan Txt

    15/101

    Document menu. They can also be overridden by projects - see`Project management`_.

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

    TABIndent with Tab characters.

    SPIndent with spaces.

    T/SIndent with tabs and spaces, depending on how much indentation ison a line.

    Applying new indentation settings`````````````````````````````````After changing the default settings you may wish to apply the newsettings 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 toscan each file as it's opened and set the indent type based onhow many lines start with a tab vs. 2 or more spaces.

    Auto-indentation^^^^^^^^^^^^^^^^

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

    Geany has four types of auto-indentation:

    NoneDisables auto-indentation completely.

    BasicAdds the same amount of whitespace on a new line as on the last line.

    Current charsDoes the same as *Basic* but also indents a new line after an openingbrace '{', and de-indents when typing a closing brace '}'. For Python,a new line will be indented after typing ':' at the end of theprevious line.

    Match braces

    Similar to *Current chars* but the closing brace will be aligned tomatch the indentation of the line with the opening brace.

    There is also XML-tag auto-indentation. This is enabled when themode is more than just Basic, and is also controlled by a filetypesetting - see `xml_indent_tags`_.

    Bookmarks

    15

  • 8/3/2019 GeanyMan Txt

    16/101

    ^^^^^^^^^

    Geany provides a handy bookmarking feature that lets you mark oneor more lines in a document, and return the cursor to them using akey combination.

    To place a mark on a line, either left-mouse-click in the left marginof the editor window, or else use Ctrl-m. This will

    produce a small green plus symbol in the margin. You can have as manymarks 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 onthe page, use Ctrl-, (control comma). Using the bookmarking featuretogether with the commands to switch from one editor tab to another(Ctrl-PgUp/PgDn and Ctrl-Tab) provides a particularly fast way tonavigate around multiple files.

    Code navigation history^^^^^^^^^^^^^^^^^^^^^^^

    To ease navigation in source files and especially betweendifferent files, Geany lets you jump between different navigationpoints. 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 positionand jumps to the new one. If you decide to go back to your previousposition in the file, just use "Navigate back a location". Toget back to the new position again, just use "Navigate forward alocation". This makes it easier to navigate in e.g. foreign codeand 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->SendSelection to* menu or keybindings. The output of the command will beused to replace the current selection. This makes it possible to usetext formatting tools with Geany in a general way.

    The selected text will be sent to the standard input of the executedcommand, so the command should be able to read from it and it shouldprint all results to its standard output which will be read byGeany. To help finding errors in executing the command, the output

    16

  • 8/3/2019 GeanyMan Txt

    17/101

    of the program's standard error will be printed on Geany's standardoutput.

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

    To add a custom command, use the *Send Selection to->Set CustomCommands* menu item. Click on *Add* to get a new item and type thecommand. 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.

    Context actions^^^^^^^^^^^^^^^

    You can execute the context action command on the current word at thecursor position or the available selection. This word or selectioncan be used as an argument to the command.The context action is invoked by a menu entry in the popup menu of theeditor and also a keyboard shortcut (see the section called`Keybindings`_).

    The command can be specified in the preferences dialog and also foreach filetype (see "context_action_cmd" in the section called`Filetype configuration`_). When the context action is invoked, the filetypespecific command is used if available, otherwise the commandspecified in the preferences dialog is executed.

    The current word or selection can be referred with the wildcard "%s"in the command, it will be replaced by the current word orselection before the command is executed.

    For example a context action can be used to open API documentationin a browser window, the command to open the PHP API documentationwould be::

    firefox "http://www.php.net/%s"

    when executing the command, the %s is substituted by the word nearthe cursor position or by the current selection. If the cursor is at

    the word "echo", a browser window will open(assumed your browser iscalled firefox) and it will open the address: http://www.php.net/echo.

    Autocompletion^^^^^^^^^^^^^^

    Geany can offer a list of possible completions for symbols defined in thetags and for all words in a document.

    17

  • 8/3/2019 GeanyMan Txt

    18/101

    The autocompletion list for symbols is presented when the first fewcharacters of the symbol are typed (configurable, see Editor Completionspreferences _, default 4) or when the *Complete word*keybinding is pressed (configurable, see Editor keybindings _,default Ctrl-Space).

    When the defined keybinding is typed and the *Autocomplete all words in

    document* preference (in `Editor Completions preferences`_)is selected then the autocompletion list will show all matching wordsin the document, if there are no matching symbols.

    If you don't want to use autocompletion it can be dismissed untilthe next symbol by pressing Escape. The autocompletion list is updatedas more characters are typed so that it only shows completions that startwith the characters typed so far. If no symbols begin with the sequence,the autocompletion window is closed.

    The up and down arrows will move the selected item. The highlighteditem on the autocompletion list can be chosen from the list by pressingEnter/Return. You can also double-click to select an item. The sequence

    will be completed to match the chosen item, and if the *Drop rest ofword on completion* preference is set (in Editor Completionspreferences _) then any characters after the cursor that matcha symbol or word are deleted.

    Word part completion````````````````````By default, pressing Tab will complete the selected item by word part;useful e.g. for adding the prefix `gtk_combo_box_entry_`` without typing itmanually:

    * gtk_com* gtk_combo_* gtk_combo_box_* gtk_combo_box_entry_* gtk_combo_box_entry_set_text_column

    The key combination can be changed from Tab - See Editor keybindings`_.If you clear/change the key combination for word part completion, Tabwill complete the whole word instead, like Enter.

    Scope autocompletion````````````````````E.g.::

    struct{int i;char c;

    } foo;

    When you type ``foo.`` it will show an autocompletion list with 'i' and'c' symbols.

    18

  • 8/3/2019 GeanyMan Txt

    19/101

    It only works for languages that set parent scope names for e.g. structmembers. Currently this means C-like languages. The C tag parser onlyparses global scopes, so this won't work for structs or objects declaredin local scope.

    User-definable snippets^^^^^^^^^^^^^^^^^^^^^^^

    Snippets are small strings or code constructs which can be replaced orcompleted to a more complex string. So you can save a lot of time whentyping common strings and letting Geany do the work for you.To know what to complete or replace Geany reads a configuration filecalled `snippets.conf`` at startup.

    Maybe you need to often type your name, so define a snippet like this::

    [Default]myname=Enrico Trger

    Every time you write ``myname`` in Geany, it will replace "myname"

    with "Enrico Trger". The key to start autocompletion can be changedin the preferences dialog, by default it is TAB. The corresponding keybindingis called Complete snippet`.

    **Paths**

    You can override the default snippets using the user``snippets.conf`` file. Use the *Tools->ConfigurationFiles->snippets.conf* menu item. See also Configuration file paths`_.

    This adds the default settings to the user file if the file doesn'texist. Alternatively the file can be created manually, adding onlythe settings you want to change. All missing settings will be readfrom the system snippets file.

    **Snippet groups**

    The file ``snippets.conf`` contains sections defining snippets thatare available for particular filetypes and in general.

    The two sections "Default" and "Special" apply to all filetypes."Default" contains all snippets which are available for everyfiletype and "Special" contains snippets which can only be used inother snippets. So you can define often used parts of snippets andjust use the special snippet as a placeholder (see the

    ``snippets.conf`` for details).

    You can define sections with the name of a filetype eg "C++". Thesnippets in that section are only available for use in files with thatfiletype. Snippets in filetype sections will hide snippets with thesame name in the "Default" section when used in a file of thatfiletype.

    **Substitution sequences for snippets**

    19

  • 8/3/2019 GeanyMan Txt

    20/101

    To define snippets you can use several special character sequences whichwill be replaced when using the snippet:

    ================ =========================================================\\n or %newline% Insert a new line (it will be replaced by the used EOL

    char(s): LF, CR/LF, or CR).

    \\t or %ws% Insert an indentation step, it will be replaced accordingto the current document's indent mode.

    \\s \\s to force whitespace at beginning or end of a value('key= value' won't work, use 'key=\\svalue')

    %cursor% Place the cursor at this position after completion hasbeen done. You can define multiple %cursor% wildcardsand use the keybinding `Move cursor in snippet` to jumpto the next defined cursor position in the completedsnippet.

    %...% "..." means the name of a key in the "Special" section.

    If you have defined a key "brace_open" in the "Special"section you can use %brace_open% in any other snippet.

    ================ =========================================================

    Snippet names must not contain spaces otherwise they won'twork correctly. But beside that you can define almost anystring as a snippet and use it later in Geany. It is not limitedto existing contructs of certain programming languages(like `if``,``for``, ``switch``). Define whatever you need.

    **Template wildcards**

    Since Geany 0.15 you can also use most of the available templates wildcardslisted in Template wildcards`_. All wildcards which are listed as`available in snippets` can be used. For instance to improve the above example::

    [Default]myname=My name is {developer}mysystem=My system: {command:uname -a}

    this will replace ``myname`` with "My name is " and the value of the templatepreference `developer` .

    **Word characters**

    You can change the way Geany recognizes the word to complete,that is how the start and end of a word is recognised when thesnippet completion is requested. The section "Special" maycontain a key "wordchars" which lists all characters a string may containto be recognized as a word for completion. Leave it commented to usedefault characters or define it to add or remove characters to fit yourneeds.

    Snippet keybindings

    20

  • 8/3/2019 GeanyMan Txt

    21/101

    ```````````````````

    Normally you would type the snippet name and press Tab. However, youcan define keybindings for snippets under the *Keybindings* group in``snippets.conf``::

    [Keybindings]for=7

    block_cursor=8

    .. note::Snippet keybindings may be overridden by Geany's configurablekeybindings.

    Inserting Unicode characters^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    You can insert Unicode code points by hitting Ctrl-Shift-u, then still holdingCtrl-Shift, type some hex digits representing the code point for the characteryou want and hit Enter or Return (still holding Ctrl-Shift). If you release

    Ctrl-Shift before hitting Enter or Return (or any other character), the codeinsertion is completed, but the typed character is also entered. In the caseof Enter/Return, it is a newline, as you might expect.

    In some earlier versions of Geany, you might need to first unbind Ctrl-Shift-uin the `keybinding preferences`_, then select *Tools->Reload Configuration*or restart Geany. Note that it works slightly differently from other GTKapplications, in that you'll need to continue to hold down the Ctrl and Shiftkeys while typing the code point hex digits (and the Enter or Return to finish the code point).

    Search, replace and go to-------------------------

    This section describes search-related commands from the Search menuand the editor window's popup menu:

    * Find* Find selection* Find usage* Find in files* Replace* Go to tag definition* Go to tag declaration

    * Go to line

    Toolbar entries^^^^^^^^^^^^^^^There are also two toolbar entries:

    * Search bar* Go to line entry

    21

  • 8/3/2019 GeanyMan Txt

    22/101

    There are keybindings to focus each of these - see `Focuskeybindings _. Pressing Escape will then focus the editor.

    Search bar``````````The quickest way to find some text is to use the search bar entry inthe toolbar. This performs a case-insensitive search in the currentdocument whilst you type. Pressing Enter will search again, and pressing

    Shift-Enter will search backwards.

    Find^^^^

    The Find dialog is used for finding text in one or more open documents.

    .. image:: ./images/find_dialog.png

    Matching options````````````````

    The syntax for the *Use regular expressions* option is shown in`Regular expressions _.

    .. note::*Use escape sequences* is implied for regular expressions.

    The *Use escape sequences* option will transform any escaped charactersinto their UTF-8 equivalent. For example, \\t will be transformed intoa tab character. Other recognized symbols are: \\\\, \\n, \\r, \\uXXXX(Unicode characters).

    Find all````````

    To find all matches, click on the Find All expander. This will revealseveral options:

    * In Document* In Session* Mark

    Find All In Document will show a list of matching lines in thecurrent document in the Messages tab of the Message Window. *Find AllIn Session* does the same for all open documents.

    Mark will highlight all matches in the current document with acolored box. These markers can be removed by selecting theRemove Markers command from the Document menu.

    Change font in search dialog text fields```````````` ```````````` ``````````` ``

    22

  • 8/3/2019 GeanyMan Txt

    23/101

    All search related dialogs use a Monospace for the text input fields toincrease the readability of input text. This is useful when you aretyping input such as regular expressions with spaces, periods and commas whichmight it hard to read with a proportional font.

    If you want to change the font, you can do this easilyby inserting the following style into your `.gtkrc-2.0``(usually found in your home directory on UNIX-like systems and in the

    etc subdirectory of your Geany installation on Windows)::

    style "search_style"{

    font_name="Monospace 8"}widget "GeanyDialogSearch.*.GtkEntry" style:highest "search_style"

    Please note the addition of ":highest" in the last line which sets the priorityof this style to the highest available. Otherwise, the style is ignoredfor the search dialogs.

    Find selection^^^^^^^^^^^^^^The *Find Next/Previous Selection* commands perform a search for thecurrent selected text. If nothing is selected, by default the currentword is used instead. This can be customized by the*find_selection_type* preference - see Various preferences _.

    ===== =============================================Value *find_selection_type* behaviour===== =============================================0 Use the current word (default).1 Try the X selection first, then current word.2 Repeat last search.===== =============================================

    Find usage^^^^^^^^^^

    Find usage searches all open files. It is similar to the Find All InSession option in the Find dialog.

    If there is a selection, then it is used as the search text; otherwisethe current word is used. The current word is either taken from theword nearest the edit cursor, or the word underneath the popup menu

    click position when the popup menu is used. The search results areshown in the Messages tab of the Message Window.

    Find in files^^^^^^^^^^^^^

    Find in files is a more powerful version of Find usage that searchesall files in a certain directory using the Grep tool. The Grep tool

    23

  • 8/3/2019 GeanyMan Txt

    24/101

    must be correctly set in Preferences to the path of the system's Greputility. GNU Grep is recommended (see note below).

    .. image:: ./images/find_in_files_dialog.png

    The *Files* setting allows to choose which files are included in thesearch, depending on the mode:

    AllSearch in all files;

    ProjectUse the current project's patterns, see Project properties _;

    CustomUse custom patterns.

    Both project and custom patterns use a glob-style syntax, eachpattern separated by a space. To search all ``.c`` and ``.h`` files,use: ``*.c *.h``.Note that an empty pattern list searches in all files ratherthan none.

    The *Encoding* field can be used to define the encoding of the filesto be searched. The entered search text is converted to the chosen encodingand the search results are converted back to UTF-8.

    The *Extra options* field is used to pass any additional arguments tothe grep tool.

    .. note::The *Files* setting uses `--include=`` when searching recursively,*Recurse in subfolders* uses ``-r``; both are GNU Grep options and maynot work with other Grep implementations.

    Filtering out version control files```````````` ```````````` `````````

    When using the *Recurse in subfolders* option with a directory that'sunder version control, you can set the *Extra options* field to filterout version control files.

    If you have GNU Grep >= 2.5.2 you can use the ``--exclude-dir``argument to filter out CVS and hidden directories like `.svn``.

    Example: `--exclude-dir=.svn --exclude-dir=CVS``

    If you have an older Grep, you can try using the ``--exclude`` flagto filter out filenames.

    SVN Example: `--exclude=*.svn-base `

    The --exclude argument only matches the file name part, not the path.

    Replace

    24

  • 8/3/2019 GeanyMan Txt

    25/101

    ^^^^^^^

    The Replace dialog is used for replacing text in one or more opendocuments.

    .. image:: ./images/replace_dialog.png

    The Replace dialog has the same options for matching text as the Find

    dialog. See the section Matching options`_.

    The *Use regular expressions* option allows regular expressions tobe used in the search string and back references in the replacementtext -- see the entry for '\\n' in `Regular expressions _.

    Replace all```````````

    To replace several matches, click on the *Replace All* expander. Thiswill reveal several options:

    * In Document

    * In Session* In Selection

    *Replace All In Document* will replace all matching text in thecurrent document. *Replace All In Session* does the same for all opendocuments. *Replace All In Selection* will replace all matching textin the current selection of the current document.

    Go to tag definition^^^^^^^^^^^^^^^^^^^^

    If the current word is the name of a tag definition (like a functionbody) and the file containing the tag definition is open, this commandwill switch to that file and go to the corresponding line number. Thecurrent word is either the word nearest the edit cursor,or the word underneath the popup menu click position when the popupmenu is used.

    .. note::If the current word's tag is on the current line, Geany will tryto look for a tag declaration instead, as this is more useful.Likewise 'Go to tag declaration' will search for a tag definitionin this case also.

    Go to tag declaration^^^^^^^^^^^^^^^^^^^^^

    Like Go to tag definition, but for a forward declaration such as aC function prototype or `extern`` declaration instead of a functionbody.

    25

  • 8/3/2019 GeanyMan Txt

    26/101

    Go to line^^^^^^^^^^

    Go to a particular line number in the current file.

    Regular expressions^^^^^^^^^^^^^^^^^^^

    You can use regular expressions in the Find and Replace dialogsby selecting the *Use regular expressions* check box (see `Matchingoptions`_). The syntax is POSIX compatible, as described in the tablebelow.

    .. note::1. The *Use escape sequences* dialog option always applies for regular

    expressions.2. Searching backwards with regular expressions is not supported.3. \\b, \\d, \\s, \\w are GNU extensions and may not be available

    on non-GNU POSIX systems unless you built Geany with the``--enable-gnu-regex`` option (this is always used on Windows).

    **In a regular expression, the following characters are interpreted:**

    ======= ============================================================. Matches any character.

    ( This marks the start of a region for tagging a match.

    ) This marks the end of a tagged region.

    \\n Where n is 1 through 9 refers to the first through ninth taggedregion when searching or replacing.

    Searching for (Wiki)\\1 matches WikiWiki.

    If the search string was Fred([1-9])XXX and thereplace string was Sam\\1YYY, when applied to Fred2XXX thiswould generate Sam2YYY.

    \\0 When replacing, the whole matching text.

    \\b This matches a word boundary.

    \\c A backslash followed by d, D, s, S, w or W, becomes acharacter class (both inside and outside sets []).

    * d: decimal digits* D: any char except decimal digits* s: whitespace (space, \\t \\n \\r \\f \\v)* S: any char except whitespace (see above)* w: alphanumeric & underscore* W: any char except alphanumeric & underscore

    \\x This allows you to use a character x that would otherwise have

    26

  • 8/3/2019 GeanyMan Txt

    27/101

    a special meaning. For example, \\[ would be interpreted as [and not as the start of a character set. Use \\\\ for a literalbackslash.

    [...] Matches one of the characters in the set. If the firstcharacter in the set is ^, it matches the characters NOT inthe set, i.e. complements the set. A shorthand S-E (startdash end) is used to specify a set of characters S up to E,

    inclusive.

    The special characters ] and - have no specialmeaning if they appear first in the set. - can also be lastin the set. To include both, put ] first: []A-Z-].

    Examples::

    []|-] matches these 3 chars[]-|] matches from ] to | chars[a-z] any lowercase alpha[^]-] any char except - and ][^A-Z] any char except uppercase alpha

    [a-zA-Z] any alpha

    ^ This matches the start of a line (unless used inside a set, seeabove).

    $ This matches the end of a line.

    \* This matches 0 or more times. For example, Sa*m matches Sm, Sam,Saam, Saaam and so on.

    \+ This matches 1 or more times. For example, Sa+m matches Sam,Saam, Saaam and so on.

    \? This matches 0 or 1 time(s). For example, Joh?n matches John, Jon.======= ============================================================

    .. note::This table is adapted from Scintilla and SciTE documentation,distributed under the License for Scintilla and SciTE`_.

    View menu---------The View menu allows various elements of the main window to be shown

    or hidden, and also provides various display-related editor options.

    Color schemes menu^^^^^^^^^^^^^^^^^^The Color schemes menu is available under the *View->Editor* submenu.It lists various color schemes for editor highlighting styles,including the default scheme first. Other items are available basedon what color scheme files Geany found at startup.

    27

  • 8/3/2019 GeanyMan Txt

    28/101

    Color scheme files are read from the Configuration file paths`_ underthe `colorschemes`` subdirectory. They should have the extension``.conf``. The default color schemeis read from `filetypes.common` .

    The [named_styles] section`_ is the same as for `filetypes.common``.

    .. note::

    Some filetypes do not yet support named styles so will ignoreany chosen color scheme.

    The `[theme_info]`` section can contain information about thetheme. The ``name`` and ``description`` keys are read to set themenu item text and tooltip, respectively. These keys can havetranslations, e.g.::

    key=Hellokey[de]=Hallokey[fr_FR]=Bonjour

    Tags

    ----

    Tags are information that relates symbols in a program with thesource file location of the declaration and definition.

    Geany has built-in functionality for generating tag information (aka"workspace tags") for supported filetypes when you open a file. Youcan also have Geany automatically load external tag files (aka "globaltags files") upon startup, or manually using *Tools --> Load Tags*.

    Geany uses its own tag file format, similar to what ``ctags`` uses(but is incompatible with ctags). You use Geany to generate globaltags files, as described below.

    Workspace tags^^^^^^^^^^^^^^

    Tags for each document are parsed whenever a file is loaded, saved ormodified (see *Symbol list update frequency* preference in the `EditorCompletions preferences`_). These are shown in the Symbol list in theSidebar. These tags are also used for autocompletion of symbols and calltipsfor all documents open in the current session that have the same filetype.

    The *Go to Tag* commands can be used with all workspace tags. See

    `Go to tag definition`_.

    Global tags^^^^^^^^^^^

    Global tags are used to provide autocompletion of symbols and calltipswithout having to open the corresponding source files. This is intendedfor library APIs, as the tags file only has to be updated when you upgrade

    28

  • 8/3/2019 GeanyMan Txt

    29/101

    the library.

    You can load a custom global tags file in two ways:

    * Using the *Load Tags* command in the Tools menu.* By moving or symlinking tags files to the ``tags`` subdirectory ofone of the `configuration file paths`_ before starting Geany.

    You can either download these files or generate your own. They havethe format::

    name.lang_ext.tags

    *lang_ext* is one of the extensions set for the filetype associatedwith the tags. See the section called Filetype extensions`_ formore information.

    Default global tags files`````````````````````````

    For some languages, a list of global tags is loaded when thecorresponding filetype is first used. Currently these are for:

    * C -- GTK+ and GLib* Pascal* PHP* HTML -- &symbol; completion, e.g. for ampersand, copyright, etc.* LaTeX* Python

    Global tags file format```````````````````````

    Global tags files can have two different formats:

    * Tagmanager format* Pipe-separated format

    The first line of global tags files should be a comment, introducedby ``#`` followed by a space and a string like ``format=pipe `or `format=tagmanager`` respectively, these are case-sensitive.This helps Geany to read the file properly. If this lineis missing, Geany tries to auto-detect the used format but thismight fail.

    The Tagmanager format is a bit more complex and is used for filescreated by the ``geany -g`` command. There is one tag per line.Different tag attributes like the return value or the argument listare separated with different characters indicating the type of thefollowing argument.

    The Pipe-separated format is easier to read and write.

    29

  • 8/3/2019 GeanyMan Txt

    30/101

    There is one tag per line and different tag attributes are separatedby the pipe character (``|``). A line looks like::

    basename|string|(string path [, string suffix])|

    | The first field is the tag name (usually a function name).| The second field is the type of the return value.| The third field is the argument list for this tag.

    | The fourth field is the description for this tag butcurrently unused and should be left empty.

    Except for the first field (tag name), all other field can be leftempty but the pipe separator must appear for them.

    You can easily write your own global tag files using this format.Just save them in your tags directory, as described earlier in thesection Global tags`_.

    Generating a global tags file`````````````````````````````

    You can generate your own global tags files by parsing a list ofsource files. The command is::

    geany -g [-P]

    * Tag File filename should be in the format described earlier --see the section called Global tags`_.

    * File list is a list of filenames, each with a full path (unlessyou are generating C/C++ tags and have set the CFLAGS environmentvariable appropriately).

    * `-P`` or `--no-preprocessing`` disables using the C pre-processorto process ``#include`` directives for C/C++ source files. Use thisoption if you want to specify each source file on the command-lineinstead of using a 'master' header file. Also can be useful if youdon't want to specify the CFLAGS environment variable.

    Example for the wxD library for the D programming language::

    geany -g wxd.d.tags /home/username/wxd/wx/*.d

    *Generating C/C++ tag files:*

    For C/C++ tag files, gcc and grep are required, so that header files

    can be preprocessed to include any other headers they depend upon.

    For C/C++ files, the environment variable CFLAGS should be set withappropriate `-I/path`` include paths. The following example works withthe bash shell, generating tags for the GnomeUI library::

    CFLAGS=`pkg-config --cflags libgnomeui-2.0` geany -g gnomeui.c.tags \/usr/include/libgnomeui-2.0/gnome.h

    30

  • 8/3/2019 GeanyMan Txt

    31/101

    You can adapt this command to use CFLAGS and header files appropriatefor whichever libraries you want.

    *Replacing the default C/C++ tags file:*

    Geany currently uses a default global tags file c99.tags forC and C++, commonly installed in /usr/share/geany. This file can

    be replaced with one containing tags parsed from a different setof header files. When Geany is next started, your custom tags filewill be loaded instead of the default c99.tags. You should keep acopy of the generated tags file because it will get overwritten whenupgrading Geany.

    C ignore.tags^^^^^^^^^^^^^

    You can ignore certain tags for C-based languages if they would leadto wrong parsing of the code. Use the *Tools->ConfigurationFiles->ignore.tags* menu item to open the user ``ignore.tags`` file.

    See also `Configuration file paths`_.

    List all tag names you want to ignore in this file, separated by spacesand/or newlines.

    Example::

    G_GNUC_NULL_TERMINATEDG_GNUC_PRINTFG_GNUC_WARN_UNUSED_RESULT

    This will parse code like:

    ``gchar **utils_strv_new(const gchar *first, ...)G_GNUC_NULL_TERMINATED;``

    More detailed information about ignore tags usage from the Exuberant Ctagsmanual page:

    Specifies a list of identifiers which are to be specially handledwhile parsing C and C++ source files. This option is specificallyprovided to handle special cases arising through the use ofpre-processor macros. When the identifiers listed are simple identifiers,these identifiers will be ignored during parsing of the source files.If an identifier is suffixed with a '+' character, ctags will also

    ignore any parenthesis-enclosed argument list which may immediatelyfollow the identifier in the source files.If two identifiers are separated with the '=' character, the firstidentifiers is replaced by the second identifiers for parsing purposes.

    For even more detailed information please read the manual page ofExuberant Ctags.

    31

  • 8/3/2019 GeanyMan Txt

    32/101

    Preferences-----------

    You may adjust Geany's settings using the Edit --> Preferencesdialog. Any changes you make there can be applied by hitting eitherthe Apply or the OK button. These settings will persist between Geanysessions. Note that most settings here have descriptive popup bubblehelp -- just hover the mouse over the item in question to get help

    on it.

    You may also adjust some View settings (under the View menu) thatpersist between Geany sessions. The settings under the Document menu,however, are only for the current document and revert to defaultswhen restarting Geany.

    .. note::In the paragraphs that follow, the text describing a dialog tabcomes after the screenshot of that tab.

    General Startup preferences

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_gen_startup.png

    Startup```````

    Load files from the last sessionOn startup, load the same files you had open the last time youused Geany.

    Load virtual terminal supportLoad the library for running a terminal in the message window area.

    Enable plugin supportAllow plugins to be used in Geany.

    Shutdown````````Save window position and geometry

    Save the current position and size of the main window so next timeyou open Geany it's in the same location.

    Confirm ExitHave a dialog pop up to confirm that you really want to quit Geany.

    Paths`````

    Startup pathPath to start in when opening or saving files.It must be an absolute path.Leave it blank to use the current working directory.

    32

  • 8/3/2019 GeanyMan Txt

    33/101

    Project filesPath to start in when opening project files.

    Extra plugin pathBy default Geany looks in the global installation path and in theconfiguration directory. In addition the path entered here will be searchedfor plugins. Usually you do not need to set an additional path to search forplugins. It might be useful when Geany is installed on a multi-user machine

    and additional plugins are available in a common location for all users.Leave blank to not set an additional lookup path.

    General Miscellaneous preferences^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_gen_misc.png

    Miscellaneous`````````````

    Beep on errors when compilation has finished

    Have the computer make a beeping sound when compilation of your programhas completed or any errors occurred.

    Switch status message list at new messageSwitch to the status message tab (in the notebook window at the bottom)once a new status message arrives.

    Suppress status messages in the status barRemove all messages from the status bar. The messages are still displayedin the status messages window.

    .. tip::Another option is to use the *Switch to Editor* keybinding - itreshows the document statistics on the status bar. See Focuskeybindings`_.

    Use Windows File Open/Save dialogsDefines whether to use the native Windows File Open/Save dialogs orwhether to use the GTK default dialogs.

    Auto-focus widgets (focus follows mouse)Give the focus automatically to widgets below the mouse cursor.This works for the main editor widget, the scribble, the toolbar search fieldgoto line fields and the VTE.

    Search``````

    Always wrap search and hide the Find dialogAlways wrap search around the document and hide the Find dialog after clickingFind Next/Previous.

    Use the current word under the cursor for Find dialogsUse current word under the cursor when opening the Find, Find in Files or Replace dialog and

    33

  • 8/3/2019 GeanyMan Txt

    34/101

    there is no selection. When this option is disabled, the search term last used in theappropriate Find dialog is used.

    Use the current file's directory for Find in FilesWhen opening the Find in Files dialog, set the directory to search to the directory of the curreactive file. When this option is disabled, the directory of the last use of the Find in Filesdialog is used.

    Projects````````

    Use project-based session filesSave your current session when closing projects. You will be able toresume different project sessions, automatically opening the filesyou had open previously.

    Store project file inside the project base directoryWhen creating new projects, the default path for the project file containsthe project base path. Without this option enabled, the default project filepath is one level above the project base path.In either case, you can easily set the final project file path in the

    *New Project* dialog. This option provides the more commondefaults automatically for convenience.

    Interface preferences^^^^^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_interface_interface.png

    Sidebar```````

    Show sidebarWhether to show the sidebar at all.

    Show symbol listShow the list of functions, variables, and other information in thecurrent document you are editing.

    Show documents listShow all the documents you have open currently. This can be used tochange between documents (see `Switching between documents`_) andto perform some common operations such as saving, closing and reloading.

    Position

    Whether to place the sidebar on the left or right of the editor window.

    Fonts`````

    EditorChange the font used to display documents.

    Symbol list

    34

  • 8/3/2019 GeanyMan Txt

    35/101

    Change the font used for the Symbols sidebar tab.

    Message windowChange the font used for the message window area.

    Miscellaneous`````````````

    Show status barShow the status bar at the bottom of the main window. It gives information aboutthe file you are editing like the line and column you are on, whether anymodifications were done, the file encoding, the filetype and other information.

    Interface Notebook tab preferences^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^

    .. image:: ./images/pref_dialog_interface_notebook.png

    Editor tabs```````````

    Show editor tabsShow a notebook tab for all documents so you can switch between themusing the mouse (instead of using the Documents window).

    Show close buttonsMake each tab show a close button so you can easily close opendocuments.

    Placement of new file tabsWhether to create a document with its notebook tab to the left orright of all existing tabs.

    Next to currentWhether to place file tabs next to the current tabrather than at the edges of the notebook.

    Double-clicking hides all additional widgetsWhether to call the View->Toggle All Additional Widgets commandwhen double-clicking on a notebook tab.

    Tab positions`````````````

    EditorSet the positioning of the editor's notebook tabs to the right,

    left, top, or bottom of the editing window.

    SidebarSet the positioning of the sidebar's notebook tabs to the right,left, top, or bottom of the sidebar window.

    Message windowSet the positioning of the message window's notebook tabs to theright, left, top, or bottom of the message window.

    35

  • 8/3/2019 GeanyMan Txt

    36/101

    Interface Toolbar preferences^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Affects the main toolbar underneath the menu bar.

    .. image:: ./images/pref_dialog_interface_toolbar.png

    Toolbar```````

    Show ToolbarWhether to show the toolbar.

    Append Toolbar to the MenuAllows to append the toolbar to the main menu bar instead of placing it below.This is useful to save vertical space.

    Customize ToolbarSee Customizing the toolbar`_.

    Appearance``````````

    Icon StyleSelect the toolbar icon style to use - either icons and text, justicons or just text.The choice System default uses whatever icon style is set by GTK.

    Icon sizeSelect the size of the icons you see (large, small or very small).The choice System default uses whatever icon size is set by GTK.

    Editor Features preferences^^^^^^^^^^^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_edit_features.png

    Features````````

    Line wrappingShow long lines wrapped around to new display lines.

    "Smart" home keyWhether to move the cursor to the first non-whitespace characteron the line when you hit the home key on your keyboard. Pressing itagain will go to the very start of the line.

    Disable Drag and DropDo not allow the dragging and dropping of selected text in documents.

    Code folding

    36

  • 8/3/2019 GeanyMan Txt

    37/101

    Allow groups of lines in a document to be collapsed for easiernavigation/editing.

    Fold/Unfold all children of a fold pointWhether to fold/unfold all child fold points when a parent lineis folded.

    Use indicators to show compile errors

    Underline lines with compile errors using red squiggles to indicatethem in the editor area.

    Newline strip trailing spacesRemove any white space at the end of the line when you hit theEnter/Return key.

    Line breaking columnThe editor column number to insert a newline at when Line Breakingis enabled for the current document.

    Comment toggle markerA string which is added when toggling a line comment in a source file.

    It is used to mark the comment as toggled.

    Editor Indentation preferences^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_edit_indentation.png

    Indentation group`````````````````

    See Indentation`_ for more information.

    WidthThe width of a single indent size in spaces. By default the indentsize is equivalent to 4 spaces.

    Detect width from fileTry to detect and set the indent width based on file content, whena file is opened.

    TypeWhen Geany inserts indentation, whether to use:

    * Just Tabs

    * Just Spaces* Tabs and Spaces, depending on how much indentation is on a line

    The *Tabs and Spaces* indent type is also known as *Soft tabsupport* in some other editors.

    Detect type from fileTry to detect and set the indent type based on file content, whena file is opened.

    37

  • 8/3/2019 GeanyMan Txt

    38/101

    Auto-indent modeThe type of auto-indentation you wish to use after pressing Enter,if any.

    BasicJust add the indentation of the previous line.

    Current chars

    Add indentation based on the current filetype and any characters atthe end of the line such as ``{``, ``}`` for C, ``:`` for Python.

    Match bracesLike *Current chars* but for C-like languages, make a closing``}`` brace line up with the matching opening brace.

    Tab key indentsIf set, pressing tab will indent the current line or selection, andunindent when pressing Shift-tab. Otherwise, the tab key willinsert a tab character into the document (which can be differentfrom indentation, depending on the indent type).

    .. note::

    There are also separate configurable keybindings for indent &unindent, but this preference allows the tab key to have differentmeanings in different contexts - e.g. for snippet completion.

    Editor Completions preferences^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_edit_completions.png

    Completions```````````

    Snippet CompletionWhether to replace special keywords after typing Tab into apre-defined text snippet.See User-definable snippets`_.

    XML/HTML tag auto-closingWhen you open an XML/HTML tag automatically generate itscompletion tag.

    Automatic continuation multi-line commentsContinue automatically multi-line comments in languages like C, C++and Java when a new line is entered inside such a comment.With this option enabled, Geany will insert a ``*`` on every new line

    inside a multi-line comment, for example when you press return in thefollowing C code::

    /** This is a C multi-line comment, press

    then Geany would insert::

    *

    38

  • 8/3/2019 GeanyMan Txt

    39/101

    on the next line with the correct indentation based on the previous line,as long as the multi-line is not closed by ``*/``.

    Autocomplete symbolsWhen you start to type a symbol name, look for the full string toallow it to be completed for you.

    Autocomplete all words in documentWhen you start to type a word, Geany will search the whole document forwords starting with the typed part to complete it, assuming thereare no tag names to show.

    Drop rest of word on completionRemove any word part to the right of the cursor when choosing acompletion list item.

    Characters to type for autocompletionNumber of characters of a word to type before autocompletion isdisplayed.

    Completion list heightThe number of rows to display for the autocompletion window.

    Max. symbol name suggestionsThe maximum number of items in the autocompletion list.

    Symbol list update frequencyThe minimum delay (in milliseconds) between two symbol list updates.

    This option determines how frequently the tag list is updated for thecurrent document. The smaller the delay, the more up-to-date the symbollist (and then the completions); but rebuilding the symbol list has acost in performance, especially with large files.

    The default value is 250ms, which means the symbol list will be updatedat most four times per second, even if the document changes continuously.

    A value of 0 disables automatic updates, so the symbol list will only beupdated upon document saving.

    Auto-close quotes and brackets``````````````````````````````

    Geany can automatically insert a closing bracket and quote characters when

    you open them. For instance, you type a ``(`` and Geany will automaticallyinsert `)``. With the following options, you can define for whichcharacters this should work.

    Parenthesis ( )Auto-close parenthesis when typing an opening one

    Curly brackets { }Auto-close curly brackets (braces) when typing an opening one

    39

  • 8/3/2019 GeanyMan Txt

    40/101

    Square brackets [ ]Auto-close square brackets when typing an opening one

    Single quotes ' 'Auto-close single quotes when typing an opening one

    Double quotes " "

    Auto-close double quotes when typing an opening one

    Editor Display preferences^^^^^^^^^^^^^^^^^^^^^^^^^^

    This is for visual elements displayed in the editor window.

    .. image:: ./images/pref_dialog_edit_display.png

    Display```````

    Invert syntax highlighting colorsInvert all colors, by default this makes white text on a blackbackground.

    Show indendation guidesShow vertical lines to help show how much leading indentation thereis on each line.

    Show whitespacesMark all tabs with an arrow "-->" symbol and spaces with dots toshow which kinds of whitespace are used.

    Show line endingsDisplay a symbol everywhere that a carriage return or line feedis present.

    Show line numbersShow or hide the Line Number margin.

    Show markers marginShow or hide the small margin right of the line numbers, which is usedto mark lines.

    Stop scrolling at last lineWhen enabled Geany stops scrolling when at the last line of the document.

    Otherwise you can scroll one more page even if there are no real lines.

    Long line marker````````````````

    The long line marker helps to indicate overly-long lines, or as a hintto the user for when to break the line.

    40

  • 8/3/2019 GeanyMan Txt

    41/101

    TypeLine

    Show a thin vertical line in the editor window at the given columnposition.

    BackgroundChange the background color of characters after the given columnposition to the color set below. (This is recommended over the*Line* setting if you use proportional fonts).

    DisabledDon't mark long lines at all.

    Long line markerSet this value to a value greater than zero to specify the columnwhere it should appear.

    Long line marker colorSet the color of the long line marker.

    Virtual spaces``````````````

    Virtual space is space beyond the end of each line.The cursor may be moved into virtual space but no real space will beadded to the document until there is some text typed or some othertext insertion command is used.

    DisabledDo not show virtual spaces

    Only for rectangular selectionsOnly show virtual spaces beyond the end of lines when drawing a rectangular selection

    AlwaysAlways show virtual spaces beyond the end of lines

    Files preferences^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_files.png

    New files`````````

    Open new documents from the command-line

    Whether to create new documents when passing filenames that don'texist from the command-line.

    Default encoding (new files)The type of file encoding you wish to use when creating files.

    Used fixed encoding when opening filesAssume all files you are opening are using the type of encoding specified below.

    41

  • 8/3/2019 GeanyMan Txt

    42/101

    Default encoding (existing files)Opens all files with the specified encoding instead of auto-detecting it.Use this option when it's not possible for Geany to detect the exact encoding.

    Default end of line charactersThe end of line characters to which should be used for new files.On Windows systems, you generally want to use CR/LF which are the commoncharacters to mark line breaks.

    On Unix-like systems, LF is default and CR is used on MAC systems.

    Saving files````````````Perform formatting operations when a document is saved. Thesecan each be undone with the Undo command.

    Ensure newline at file endAdd a newline at the end of the document if one is missing.

    Ensure consistent line endingsEnsures that newline characters always get converted beforesaving, avoiding mixed line endings in the same file.

    Strip trailing spacesRemove the trailing spaces on each line of the document.

    Replace tabs by spaceReplace all tabs in the document with the equivalent number of spaces.

    .. note::It is better to use spaces to indent than use this preference - see`Indentation`_.

    Miscellaneous`````````````

    Recent files list lengthThe number of files to remember in the recently used files list.

    Disk check timeoutThe number of seconds to periodically check the current document'sfile on disk in case it has changed. Setting it to 0 will disablethis feature.

    .. note::These checks are only performed on local files. Remote files arenot checked for changes due to performance issues

    (remote files are files in ``~/.gvfs/``).

    Tools preferences^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_tools.png

    Tool paths

    42

  • 8/3/2019 GeanyMan Txt

    43/101

    ``````````

    TerminalThe location of your terminal executable.

    BrowserThe location of your web browser executable.

    GrepThe location of the grep executable.

    .. note::For Windows users: at the time of writing it is recommended to usethe grep.exe from the UnxUtils project(http://sourceforge.net/projects/unxutils). The grep.exe from theMingw project for instance might not work with Geany at the moment.

    Commands````````

    Context action

    Set this to a command to execute on the current word.You can use the "%s" wildcard to pass the current word below the cursorto the specified command.

    Template preferences^^^^^^^^^^^^^^^^^^^^

    This data is used as meta data for various template text to insert intoa document, such as the file header. You only need to set fields thatyou want to use in your template files.

    .. image:: ./images/pref_dialog_templ.png

    Template data`````````````

    DeveloperThe name of the developer who will be creating files.

    InitialsThe initials of the developer.

    Mail addressThe email address of the developer.

    .. note::You may wish to add anti-spam markup, e.g. ``namesiteext` .

    CompanyThe company the developer is working for.

    Initial versionThe initial version of files you will be creating.

    43

  • 8/3/2019 GeanyMan Txt

    44/101

    YearSpecify a format for the the {year} wildcard. You can use any conversion specifierswhich can be used with the ANSI C strftime function. For details please seehttp://man.cx/strftime.

    DateSpecify a format for the the {date} wildcard. You can use any conversion specifiers

    which can be used with the ANSI C strftime function. For details please seehttp://man.cx/strftime.

    Date & TimeSpecify a format for the the {datetime} wildcard. You can use any conversion specifierswhich can be used with the ANSI C strftime function. For details please seehttp://man.cx/strftime.

    Keybinding preferences^^^^^^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_keys.png

    There are some commands listed in the keybinding dialog that are not, by default,bound to a key combination, and may not be available as a menu item.

    .. note::For more information see the section Keybindings _.

    Printing preferences^^^^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_printing.png

    Use external command for printingUse a system command to print your file out.

    Use native GTK printingLet the GTK GUI toolkit handle your print request.

    Print line numbersPrint the line numbers on the left of your paper.

    Print page numberPrint the page number on the bottom right of your paper.

    Print page headerPrint a header on every page that is sent to the printer.

    Use base name of the printed fileDon't use the entire path for the header, only the filename.

    Date formatHow the date should be printed. You can use the same formatspecifiers as in the ANSI C function strftime(). For details please

    44

  • 8/3/2019 GeanyMan Txt

    45/101

    see http://man.cx/strftime.

    Various preferences^^^^^^^^^^^^^^^^^^^

    .. image:: ./images/pref_dialog_various.png

    Rarely used preferences, explained in the table below. A few of them requirerestart to take effect, and a few other will only affect newly opened or createddocuments before restart.

    ================================ ========================================= ========== ===========Key Description Default Applies================================ ========================================= ========== ===========**Editor related**use_gtk_word_boundaries Whether to look for the end of a word true to new

    when using word-boundary related documentsScintilla commands (see `Scintillakeyboard commands`_).

    brace_match_ltgt Whether to highlight angle brackets. false immediately

    complete_snippets_whilst_editing Whether to allow completion of snippets false immediatelywhen editing an existing line (i.e. thereis some text after the current cursorposition on the line). Only used when thekeybinding `Complete snippet` is set to``Space``.

    show_editor_scrollbars Whether to display scrollbars. If set to true immediatelyfalse, the horizontal and verticalscrollbars are hidden completely.

    indent_hard_tab_width The size of a tab character. Don't change 8 immediatelyit unless you really need to; use theindentation settings instead.

    **Interface related**show_symbol_list_expanders Whether to show or hide the small true to new

    expander icons on the symbol list documentsallow_always_save treeview. Whether files can be saved false immediately

    always, even if they don't have anychanges. By default, the Save button andmenu item are disabled when a file isunchanged. When setting this option totrue, the Save button and menu item arealways active and files can be saved.

    compiler_tab_autoscroll Whether to automatically scroll to the true immediatelylast line of the output in the Compilertab.

    statusbar_template The status bar statistics line format. See below. immediately(Search in src/ui_utils.c for details).new_document_after_close Whether to open a new document after all false immediately

    documents have been closed.msgwin_status_visible Whether to show the Status tab in the true immediately

    Messages Windowmsgwin_compiler_visible Whether to show the Compiler tab in the true immediately

    Messages Windowmsgwin_messages_visible Whether to show the Messages tab in the true immediately

    45

  • 8/3/2019 GeanyMan Txt

    46/101

    Messages Windowmsgwin_scribble_visible Whether to show the Scribble tab in the true immediately

    Messages Window================================ ========================================= ========== ===========

    By default, statusbar_template is empty. This tells Geany to use itsinternal default, which is currently:

    ``line: %l / %L\t col: %c\t sel: %s\t %w %t %mmode: %M encoding: %e filetype: %f

    Note that ``\t`` = tab.

    ================================ =========================================== ======== ===========Key Description Default Applies================================ =========================================== ======== ===========**VTE related**emulation Terminal emulation mode. Only change this xterm immediately

    if you have VTE termcap files other than``vte/termcap/xterm``.

    send_selection_unsafe By default, Geany strips any trailing false immediatelynewline characters from the current

    selection before sending it to the terminalto not execute arbitrary code. This ismainly a security feature.If, for whatever reasons, you really wantit to be executed directly, set this optionto true.

    **File related**use_atomic_file_saving Defines the mode how Geany saves files to false immediately

    disk. If disabled, Geany directly writesthe content of the document to disk. Thismight cause loss of data when there isno more free space on disk to save thefile. When set to true, Geany first savesthe contents into a temporary file and ifthis succeeded, the temporary file ismoved to the real file to save.This gives better error checking in case ofno more free disk space. But it alsodestroys hard links of the original fileand its permissions (e.g. executable flagsare reset). Use this with care as it canbreak things seriously.The better approach would be to ensure yourdisk won't run out of free space.

    use_gio_unsafe_file_saving Whether to use GIO as the unsafe file true immediately

    saving backend. It is better on mostsituations but is known not to workcorrectly on some complex setups.

    gio_unsafe_save_backup Make a backup when using GIO unsafe file false immediatelysaving. Backup is named filename~`.

    **Search related**find_selection_type See `Find selection`_. 0 immediately**Build Menu related**number_ft_menu_items The maximum number of menu items in the 2 on restart

    46

  • 8/3/2019 GeanyMan Txt

    47/101

    filetype section of the Build menu.number_non_ft_menu_items The maximum number of menu items in the 3 on restart

    independent section of the Build menu.number_exec_menu_items The maximum number of menu items in the 2 on restart

    execute section of the Build menu.================================ =========================================== ======== ===========

    Terminal (VTE) preferences^^^^^^^^^^^^^^^^^^^^^^^^^^

    See also: Virtual terminal emulator widget (VTE)`_.

    .. image:: ./images/pref_dialog_vte.png

    Terminal widget```````````````

    Terminal fontSelect the font that will be used in the terminal emulation control.

    Foreground colorSelect the font color.

    Background colorSelect the background color of the terminal.

    Scrollback linesThe number of lines buffered so that you can scroll though the history.

    ShellThe location of the shell on your system.

    Scroll on keystrokeScroll the terminal to the prompt line when pressing a key.

    Scroll on outputScroll the output down.

    Cursor blinksLet the terminal cursor blink.

    Override Geany keybindingsAllow the VTE to receive keyboard shortcuts (apart from focus commands).

    Disable menu shortcut key (F10 by default)

    Disable the menu shortcut when you are in the virtual terminal.

    Follow path of the current fileMake the path of the terminal change according to the path of thecurrent file.

    Execute programs in VTEExecute programs in the virtual terminal instead of using the externalterminal tool. Note that if you run multiple execute commands at once

    47

  • 8/3/2019 GeanyMan Txt

    48/101

    the output may become mixed together in the VTE.

    Don't use run scriptDon't use the simple run script which is usually used to displaythe exit status of the executed program.This can be useful if you already have a program running in the VTElike a Python console (e.g. ipython). Use this with care.

    Project management------------------

    Project management is optional in Geany. Currently it can be used for:

    * Storing and opening session files on a project basis.* Overriding default settings with project equivalents.* Configuring the Build menu on a project basis.

    A list of session files can be stored and opened with the projectwhen the *Use project-based session files* preference is enabled,in the *Project* group of the `Preferences`_ dialog.

    As long as a project is open, the Build menu will usethe items defined in project's settings, instead of the defaults.See Build Menu Configuration`_ for information on configuring the menu.

    The current project's settings are saved when it is closed, or whenGeany is shutdown. When restarting Geany, the previously opened projectfile that was in use at the end of the last session will be reopened.

    The project menu items are detailed below.

    New project^^^^^^^^^^^

    To create a new project, fill in the *Name*