[filetype config] Remove outdated comment (#3449)
[geany-mirror.git] / doc / geany.txt
blob7121177f8c6fd3b9f3b5d79a0476b2ca54ab1cbe
1 .. |(version)| replace:: 1.39
2 .. -*- reStructuredText -*-
4 =======
5  Geany
6 =======
8 -------------------------
9  A fast, light, GTK+ IDE
10 -------------------------
12 :Authors: Enrico Tröger,
13           Nick Treleaven,
14           Frank Lanitz,
15           Colomban Wendling,
16           Matthew Brush
17 :Date: 2021-10-09
18 :Version: |(version)|
20 Copyright © 2005 The Geany contributors
22 This document is distributed under the terms of the GNU General Public
23 License as published by the Free Software Foundation; either version 2
24 of the License, or (at your option) any later version. A copy of this
25 license can be found in the file COPYING included with the source code
26 of this program, and also in the chapter `GNU General Public License`_.
29 .. contents::
33 Introduction
34 ============
37 About Geany
38 -----------
40 Geany is a small and lightweight Integrated Development Environment. It
41 was developed to provide a small and fast IDE, which has only a few
42 dependencies on other packages. Another goal was to be as independent
43 as possible from a particular Desktop Environment like KDE or GNOME -
44 Geany only requires the GTK+ runtime libraries.
46 Some basic features of Geany:
48 * Syntax highlighting
49 * Code folding
50 * Autocompletion of symbols/words
51 * Construct completion/snippets
52 * Auto-closing of XML and HTML tags
53 * Calltips
54 * Many supported filetypes including C, Java, PHP, HTML, Python, Perl,
55   Pascal, and others
56 * Symbol lists
57 * Code navigation
58 * Build system to compile and execute your code
59 * Simple project management
60 * Plugin interface
64 Where to get it
65 ---------------
67 You can obtain Geany from https://www.geany.org/ or perhaps also from
68 your distribution. For a list of available packages, please see
69 https://www.geany.org/Download/ThirdPartyPackages.
73 License
74 -------
76 Geany is distributed under the terms of the GNU General Public License
77 as published by the Free Software Foundation; either version 2 of
78 the License, or (at your option) any later version. A copy of this
79 license can be found in the file COPYING included with the source
80 code of this program and in the chapter, `GNU General Public License`_.
82 The included Scintilla library (found in the subdirectory
83 ``scintilla/``) has its own license, which can be found in the chapter,
84 `License for Scintilla and SciTE`_.
88 About this document
89 -------------------
91 This documentation is available in HTML and text formats.
92 The latest version can always be found at https://www.geany.org/.
94 If you want to contribute to it, see `Contributing to this document`_.
99 Installation
100 ============
103 Requirements
104 ------------
106 You will need the GTK (>= 2.24) libraries and their dependencies
107 (Pango, GLib and ATK). Your distro should provide packages for these,
108 usually installed by default. For Windows, you can download an installer
109 from the website which bundles these libraries.
112 Binary packages
113 ---------------
115 There are many binary packages available. For an up-to-date but maybe
116 incomplete list see https://www.geany.org/Download/ThirdPartyPackages.
119 Source compilation
120 ------------------
122 Compiling Geany is quite easy.
123 To do so, you need the GTK (>= 2.24) libraries and header files.
124 You also need the Pango, GLib and ATK libraries and header files.
125 All these files are available at http://www.gtk.org, but very often
126 your distro will provide development packages to save the trouble of
127 building these yourself.
129 Furthermore you need, of course, a C and C++ compiler. The GNU versions
130 of these tools are recommended.
132 Autotools based build system
133 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
135 To compile Geany yourself, you just need the Make tool, preferably GNU Make.
137 Then run the following commands::
139     $ ./configure
140     $ make
142 Then as root::
144     % make install
146 Or via sudo::
148     % sudo make install
150 Custom installation
151 ^^^^^^^^^^^^^^^^^^^
152 The configure script supports several common options, for a detailed
153 list, type::
155     $ ./configure --help
158 You may also want to read the INSTALL file for advanced installation
159 options.
161 * See also `Compile-time options`_.
163 Dynamic linking loader support and VTE
164 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165 In the case that your system lacks dynamic linking loader support, you
166 probably want to pass the option ``--disable-vte`` to the ``configure``
167 script. This prevents compiling Geany with dynamic linking loader
168 support for automatically loading ``libvte.so.4`` if available.
170 Build problems
171 ^^^^^^^^^^^^^^
172 If there are any errors during compilation, check your build
173 environment and try to find the error, otherwise contact the mailing
174 list or one the authors. Sometimes you might need to ask for specific
175 help from your distribution.
178 Installation prefix
179 -------------------
180 If you want to find Geany's system files after installation you may
181 want to know the installation prefix.
183 Pass the ``--print-prefix`` option to Geany to check this - see
184 `Command line options`_. The first path is the prefix.
186 On Unix-like systems this is commonly ``/usr`` if you installed from
187 a binary package, or ``/usr/local`` if you build from source.
189 .. note::
190     Editing system files is not necessary as you should use the
191     per-user configuration files instead, which don't need root
192     permissions. See `Configuration files`_.
195 Usage
196 =====
199 Getting started
200 ---------------
202 You can start Geany in the following ways:
204 * From the Desktop Environment menu:
206   Choose in your application menu of your used Desktop Environment:
207   Development --> Geany.
209   At Windows-systems you will find Geany after installation inside
210   the application menu within its special folder.
212 * From the command line:
214   To start Geany from a command line, type the following and press
215   Return::
217       % geany
219 The Geany workspace
220 -------------------
222 The Geany window is shown in the following figure:
224 .. image:: ./images/main_window.png
226 The workspace has the following parts:
228 * The menu.
229 * An optional toolbar.
230 * An optional sidebar that can show the following tabs:
232   * Documents - A document list, see `Document list views`_.
233   * Symbols - A list of symbols in your code.
235 * The main editor window.
236 * An optional message window which can show the following tabs:
238   * Status - A list of status messages.
239   * Compiler - The output of compiling or building programs.
240   * Messages - Results of 'Find Usage', 'Find in Files' and other actions
241   * Scribble - A text scratchpad for any use.
242   * Terminal - An optional terminal window.
244 * A status bar
246 Most of these can be configured in the `Interface preferences`_, the
247 `View menu`_, or the popup menu for the relevant area.
249 Additional tabs may be added to the sidebar and message window by plugins.
251 The position of the tabs can be selected in the interface preferences.
253 The sizes of the sidebar and message window can be adjusted by
254 dragging the dividers.
256 Sidebar Usage
257 ^^^^^^^^^^^^^
259 The sidebar has a right click menu that can control what is visible and
260 has actions specific to the tab (other tabs added by plugins are
261 described by that plugin documentation):
263 * Symbols
265   * expand/collapse the tree
266   * control sorting order
267   * control whether to group symbols by their type
268   * locate the symbol in documents
270   The symbols tab can also be filtered by typing a string into
271   the entry at the top of the tab. All symbols that contain the entered
272   string as a substring will be shown in the tree. Multiple filters can
273   be separated by a space.
275 * Documents
277   * expand/collapse the tree
278   * save to or reload from files
279   * search tree based at selected file
280   * show or hide the document paths
282 Command line options
283 --------------------
285 ============  =======================  =================================================
286 Short option  Long option              Function
287 ============  =======================  =================================================
288 *none*        +number                  Set initial line number for the first opened file
289                                        (same as --line, do not put a space between the + sign
290                                        and the number). E.g. "geany +7 foo.bar" will open the
291                                        file foo.bar and place the cursor in line 7.
293 *none*        --column                 Set initial column number for the first opened file.
295 -c dir_name   --config=directory_name  Use an alternate configuration directory. The default
296                                        configuration directory is ``~/.config/geany/`` and that
297                                        is where ``geany.conf`` and other configuration files
298                                        reside.
300 *none*        --ft-names               Print a list of Geany's internal filetype names (useful
301                                        for snippets configuration).
303 -g            --generate-tags          Generate a global tags file (see
304                                        `Generating a global tags file`_).
306 -P            --no-preprocessing       Don't preprocess C/C++ files when generating tags file.
308 -i            --new-instance           Do not open files in a running instance, force opening
309                                        a new instance. Only available if Geany was compiled
310                                        with support for Sockets.
312 -l            --line                   Set initial line number for the first opened file.
314 *none*        --list-documents         Return a list of open documents in a running Geany
315                                        instance.
316                                        This can be used to read the currently opened documents in
317                                        Geany from an external script or tool. The returned list
318                                        is separated by newlines (LF) and consists of the full,
319                                        UTF-8 encoded filenames of the documents.
320                                        Only available if Geany was compiled with support for
321                                        Sockets.
323 -m            --no-msgwin              Do not show the message window. Use this option if you
324                                        do not need compiler messages or VTE support.
326 -n            --no-ctags               Do not load symbol completion and call tip data. Use this
327                                        option if you do not want to use them.
329 -p            --no-plugins             Do not load plugins or plugin support.
331 *none*        --print-prefix           Print installation prefix, the data directory, the lib
332                                        directory and the locale directory (in that order) to
333                                        stdout, one line each. This is mainly intended for plugin
334                                        authors to detect installation paths.
336 -r            --read-only              Open all files given on the command line in read-only mode.
337                                        This only applies to files opened explicitly from the command
338                                        line, so files from previous sessions or project files are
339                                        unaffected.
341 -s            --no-session             Do not load the previous session's files.
343 -t            --no-terminal            Do not load terminal support. Use this option if you do
344                                        not want to load the virtual terminal emulator widget
345                                        at startup. If you do not have ``libvte.so.4`` installed,
346                                        then terminal-support is automatically disabled. Only
347                                        available if Geany was compiled with support for VTE.
349 *none*        --socket-file            Use this socket filename for communication with a
350                                        running Geany instance. This can be used with the following
351                                        command to execute Geany on the current workspace::
353                                          geany --socket-file=/tmp/geany-sock-$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}')
355 *none*        --vte-lib                Specify explicitly the path including filename or only
356                                        the filename to the VTE library, e.g.
357                                        ``/usr/lib/libvte.so`` or ``libvte.so``. This option is
358                                        only needed when the auto-detection does not work. Only
359                                        available if Geany was compiled with support for VTE.
361 -v            --verbose                Be verbose (print useful status messages).
363 -V            --version                Show version information and exit.
365 -?            --help                   Show help information and exit.
367 *none*        *files ...*              Open all given filenames at startup.
368                                        If a running instance is detected, pass filenames
369               *file:line ...*          to it instead.
371               *file:line:col ...*      Geany also recognizes line and column information when
372                                        appended to the filename with colons, e.g.
373                                        ``geany foo.bar:10:5`` will open the file ``foo.bar`` and
374                                        place the cursor in line 10 at column 5.
376                                        If a filename does not exist, create a new document 
377                                        with the desired filename if the
378                                        *Open new files from the command-line* 
379                                        `file pref <#files-preferences>`_ is set.
381                                        A project can also be opened, but the project filename (\*.geany)
382                                        must be the first non-option argument. Any other
383                                        project filenames will be opened as text files.
384 ============  =======================  =================================================
386 Geany also supports all generic GTK options, a list is available on the
387 help screen.
391 General
392 -------
394 Startup
395 ^^^^^^^
396 At startup, Geany loads all files from the last time Geany was
397 launched. You can disable this feature in the preferences dialog
398 (see `General Startup preferences`_).
400 You can start several instances of Geany, but only the first will
401 load files from the last session. In the subsequent instances, you
402 can find these files in the file menu under the *Recent files* item.
403 By default this contains the last 10 recently opened files. You can
404 change the number of recently opened files in the 
405 `Files tab <#files-preferences>`_ of the preferences dialog.
407 To run a second instance of Geany, do not specify any filenames on
408 the command-line, or disable opening files in a running instance
409 using the ``-i`` `command line option <#command-line-options>`_.
412 Opening files
413 ^^^^^^^^^^^^^
415 Open dialog
416 ```````````
417 The *File->Open* command will show a dialog to choose one or more text 
418 files to open. There is a list of file filters on the right with the 
419 following items:
421 * All files (default)
422 * All source - a combination of all the patterns for each filetype (see 
423   `Filetype extensions`_)
424 * Individual filetypes
426 Clicking *More options* will reveal controls to open files with a 
427 specific filetype and/or encoding (see `Character sets and Unicode 
428 Byte-Order-Mark (BOM)`_).
431 Opening files from the command-line in a running instance
432 `````````````````````````````````````````````````````````
434 Geany detects if there is an instance of itself already running and opens files
435 from the command-line in that instance. So, Geany can
436 be used to view and edit files by opening them from other programs
437 such as a file manager.
439 You can also pass line number and column number information, e.g.::
441     geany some_file.foo:55:4
443 This would open the file ``some_file.foo`` with the cursor on line 55,
444 column 4.
446 If you do not like this for some reason, you can disable using the first
447 instance by using the appropriate command line option -- see the section
448 called `Command line options`_.
451 Virtual terminal emulator widget (VTE)
452 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
454 If you have installed ``libvte.so`` on your system, it is loaded
455 automatically by Geany, and you will have a terminal widget in the
456 notebook at the bottom.
458 If Geany cannot find any ``libvte.so`` at startup, the terminal widget
459 will not be loaded. So there is no need to install the package containing
460 this file in order to run Geany. Additionally, you can disable the use
461 of the terminal widget by command line option, for more information
462 see the section called `Command line options`_.
464 You can use this terminal (from now on called VTE) much as you would
465 a terminal program like xterm. There is basic clipboard support. You
466 can paste the contents of the clipboard by pressing the right mouse
467 button to open the popup menu, and choosing Paste. To copy text from
468 the VTE, just select the desired text and then press the right mouse
469 button and choose Copy from the popup menu. On systems running the
470 X Window System you can paste the last selected text by pressing the
471 middle mouse button in the VTE (on 2-button mice, the middle button
472 can often be simulated by pressing both mouse buttons together).
474 In the preferences dialog you can specify a shell which should be
475 started in the VTE. To make the specified shell a login shell just
476 use the appropriate command line options for the shell. These options
477 should be found in the manual page of the shell. For zsh and bash
478 you can use the argument ``--login``.
480 .. note::
481     Geany tries to load ``libvte.so``. If this fails, it tries to load
482     some other filenames. If this fails too, you should check whether you
483     installed libvte correctly. Again note, Geany will run without this
484     library.
486 It could be, that the library is called something else than
487 ``libvte.so`` (e.g. on FreeBSD 6.0 it is called ``libvte.so.8``). If so
488 please set a link to the correct file (as root)::
490     # ln -s /usr/lib/libvte.so.X /usr/lib/libvte.so
492 Obviously, you have to adjust the paths and set X to the number of your
493 ``libvte.so``.
495 You can also specify the filename of the VTE library to use on the command
496 line (see the section called `Command line options`_) or at compile time
497 by specifying the command line option ``--with-vte-module-path`` to
498 ./configure.
501 Customizing Geany's appearance using GTK+ CSS
502 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
504 To override GTK+ CSS styles, you can use traditional mechanisms or you
505 can create a file named ``geany.css`` in the user configuration directory
506 (usually ``~/.config/geany``) which will be loaded after other CSS styles
507 are applied to allow overriding the default styles.
509 Geany offers a number of CSS IDs which can be used to taylor its
510 appearance. Among the more interesting include:
512 * ``geany-compiler-context`` - the style used for build command output surrounding errors
513 * ``geany-compiler-error`` - the style used for build command errors
514 * ``geany-compiler-message`` - the style other output encountered while running build command
515 * ``geany-document-status-changed`` - the style for document tab labels when the document is changed
516 * ``geany-document-status-disk-changed`` - the style for document tab labels when the file on disk has changed
517 * ``geany-document-status-readyonly``` - the style for document tab labels when the document is read-only
518 * ``geany-search-entry-no-match`` - the style of find/replace dialog entries when no match is found
519 * ``geany-terminal-dirty`` - the style for the message window Terminal tab label when the terminal output has changed.
522 Documents
523 ---------
525 Switching between documents
526 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
528 The documents list and the editor tabs are two different ways
529 to switch between documents using the mouse. When you hit the key
530 combination to move between tabs, the order is determined by the tab
531 order. It is not alphabetical as shown in the documents list
532 (regardless of whether or not editor tabs are visible).
534 See the `Notebook tab keybindings`_ section for useful
535 shortcuts including for Most-Recently-Used document switching.
537 Document list views
538 ^^^^^^^^^^^^^^^^^^^
540 There are three different ways to display documents on the sidebar if *Show
541 documents list* is active.  To switch between views press the right mouse button
542 on the documents list and select one of these items:
544 Documents Only
545     Show only file names of open documents in sorted order.
547     .. image:: ./images/sidebar_documents_only.png
549 Show Paths
550     Show open documents as a two-level tree in which first level is the paths
551     of directories containing open files and the second level is the file names of
552     the documents open in that path.  All documents with the same path are grouped
553     together under the same first level item.  Paths are in sorted order and
554     documents are sorted within each group.
556     .. image:: ./images/sidebar_show_paths.png
558 Show Tree
559     Show paths as above, but as a multiple level partial tree.  The tree is only
560     expanded at positions where two or more directory paths to open documents
561     share the same prefix.  The common prefix is shown as a parent level, and
562     the remainder of those paths are shown as child levels.  This applies
563     recursively down the paths making a tree to the file names of open documents,
564     which are grouped in sorted order as an additional level below the last path
565     segment.
567     For convenience two common file locations are handled specially, open
568     files below the users home directory and open files below an open project
569     base path.  Each of these is moved to its own top level tree instead of
570     being in place in the normal tree.  The top level of these trees are each
571     labelled differently.  For the home directory tree the path of the home
572     directory is shown as ``~``, and for the project tree the path to the project
573     base path is shown simply as the project name.
575     .. image:: ./images/sidebar_show_tree.png
577 In all cases paths and file names that do not fit in the width available are ellipsised.
579 Cloning documents
580 ^^^^^^^^^^^^^^^^^
581 The `Document->Clone` menu item copies the current document's text,
582 cursor position and properties into a new untitled document. If
583 there is a selection, only the selected text is copied. This can be
584 useful when making temporary copies of text or for creating
585 documents with similar or identical contents.
587 Automatic filename insertion on `Save As...`
588 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
589 If a document is saved via `Document->Save As...` then the filename is
590 automatically inserted into the comment header replacing text like
591 `untitled.ext` in the first 3 lines of the file. E.g. if a new ``.c``
592 file is created using `File->New (with Template)` then the text `untitled.c`
593 in line 2 would be replaced with the choosen file name on `Save As...`
594 (this example assumes the default file templates being used).
597 Character sets and Unicode Byte-Order-Mark (BOM)
598 ------------------------------------------------
601 Using character sets
602 ^^^^^^^^^^^^^^^^^^^^
604 Geany provides support for detecting and converting character sets. So
605 you can open and save files in different character sets, and even
606 convert a file from one character set to another. To do this,
607 Geany uses the character conversion capabilities of the GLib library.
609 Only text files are supported, i.e. opening files which contain
610 NULL-bytes may fail. Geany will try to open the file anyway but it is
611 likely that the file will be truncated because it can only be read up
612 to the first occurrence of a NULL-byte. All characters after this
613 position are lost and are not written when you save the file.
615 Geany tries to detect the encoding of a file while opening it, but
616 auto-detecting the encoding of a file is not easy and sometimes an
617 encoding might not be detected correctly. In this case you have to
618 set the encoding of the file manually in order to display it
619 correctly. You can this in the file open dialog by selecting an
620 encoding in the drop down box or by reloading the file with the
621 file menu item "Reload as". The auto-detection works well for most
622 encodings but there are also some encodings where it is known that
623 auto-detection has problems.
625 There are different ways to set different encodings in Geany:
627 * Using the file open dialog
629   This opens the file with the encoding specified in the encoding drop
630   down box. If the encoding is set to "Detect from file" auto-detection
631   will be used. If the encoding is set to "Without encoding (None)" the
632   file will be opened without any character conversion and Geany will
633   not try to auto-detect the encoding (see below for more information).
635 * Using the "Reload as" menu item
637   This item reloads the current file with the specified encoding. It can
638   help if you opened a file and found out that the wrong encoding was used.
640 * Using the "Set encoding" menu item
642   Contrary to the above two options, this will not change or reload
643   the current file unless you save it. It is useful when you want to
644   change the encoding of the file.
646 * Specifying the encoding in the file itself
648   As mentioned above, auto-detecting the encoding of a file may fail on
649   some encodings. If you know that Geany doesn't open a certain file,
650   you can add the specification line, described in the next section,
651   to the beginning of the file to force Geany to use a specific
652   encoding when opening the file.
655 In-file encoding specification
656 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
658 Geany detects meta tags of HTML files which contain charset information
659 like::
661     <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15" />
663 and the specified charset is used when opening the file. This is useful if the
664 encoding of the file cannot be detected properly.
665 For non-HTML files you can also define a line like::
667     /* geany_encoding=ISO-8859-15 */
669 or::
671     # geany_encoding=ISO-8859-15 #
673 to force an encoding to be used. The #, /\* and \*/ are examples
674 of filetype-specific comment characters. It doesn't matter which
675 characters are around the string " geany_encoding=ISO-8859-15 " as long
676 as there is at least one whitespace character before and after this
677 string. Whitespace characters are in this case a space or tab character.
678 An example to use this could be you have a file with ISO-8859-15
679 encoding but Geany constantly detects the file encoding as ISO-8859-1.
680 Then you simply add such a line to the file and Geany will open it
681 correctly the next time.
683 Since Geany 0.15 you can also use lines which match the
684 regular expression used to find the encoding string:
685 ``coding[\t ]*[:=][\t ]*([a-z0-9-]+)[\t ]*``
687 .. note::
688     These specifications must be in the first 512 bytes of the file.
689     Anything after the first 512 bytes will not be recognized.
691 Some examples are::
693     # encoding = ISO-8859-15
695 or::
697     # coding: ISO-8859-15
699 Special encoding "None"
700 ^^^^^^^^^^^^^^^^^^^^^^^
702 There is a special encoding "None" which uses no
703 encoding. It is useful when you know that Geany cannot auto-detect
704 the encoding of a file and it is not displayed correctly. Especially
705 when the file contains NULL-bytes this can be useful to skip auto
706 detection and open the file properly at least until the occurrence
707 of the first NULL-byte. Using this encoding opens the file as it is
708 without any character conversion.
711 Unicode Byte-Order-Mark (BOM)
712 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
714 Furthermore, Geany detects a Unicode Byte Order Mark (see
715 http://en.wikipedia.org/wiki/Byte_Order_Mark for details). Of course,
716 this feature is only available if the opened file is in a Unicode
717 encoding. The Byte Order Mark helps to detect the encoding of a file,
718 e.g. whether it is UTF-16LE or UTF-16BE and so on. On Unix-like systems
719 using a Byte Order Mark could cause some problems for programs not
720 expecting it, e.g. the compiler gcc stops
721 with stray errors, PHP does not parse a script containing a BOM and
722 script files starting with a she-bang maybe cannot be started. In the
723 status bar you can easily see whether the file starts with a BOM or
724 not.
726 If you want to set a BOM for a file or if you want to remove it
727 from a file, just use the document menu and toggle the checkbox.
729 .. note::
730     If you are unsure what a BOM is or if you do not understand where
731     to use it, then it is probably not important for you and you can
732     safely ignore it.
736 Editing
737 -------
740 Folding
741 ^^^^^^^
743 Geany provides basic code folding support. Folding means the ability to
744 show and hide parts of the text in the current file. You can hide
745 unimportant code sections and concentrate on the parts you are working on
746 and later you can show hidden sections again. In the editor window there is
747 a small grey margin on the left side with [+] and [-] symbols which
748 show hidden parts and hide parts of the file respectively. By
749 clicking on these icons you can simply show and hide sections which are
750 marked by vertical lines within this margin. For many filetypes nested
751 folding is supported, so there may be several fold points within other
752 fold points.
754 .. note::
755     You can customize the folding icon and line styles - see the
756     filetypes.common `Folding Settings`_.
758 If you don't like it or don't need it at all, you can simply disable
759 folding support completely in the preferences dialog.
761 The folding behaviour can be changed with the "Fold/Unfold all children of
762 a fold point" option in the preference dialog. If activated, Geany will
763 unfold all nested fold points below the current one if they are already
764 folded (when clicking on a [+] symbol).
765 When clicking on a [-] symbol, Geany will fold all nested fold points
766 below the current one if they are unfolded.
768 This option can be inverted by pressing the Shift
769 key while clicking on a fold symbol. That means, if the "Fold/Unfold all
770 children of a fold point" option is enabled, pressing Shift will disable
771 it for this click and vice versa.
774 Column mode editing (rectangular selections)
775 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
777 There is basic support for column mode editing. To use it, create a
778 rectangular selection by holding down the Control and Shift keys
779 (or Alt and Shift on Windows) while selecting some text.
780 Once a rectangular selection exists you can start editing the text within
781 this selection and the modifications will be done for every line in the
782 selection.
784 It is also possible to create a zero-column selection - this is
785 useful to insert text on multiple lines.
787 Drag and drop of text
788 ^^^^^^^^^^^^^^^^^^^^^
790 If you drag selected text in the editor widget of Geany the text is
791 moved to the position where the mouse pointer is when releasing the
792 mouse button. Holding Control when releasing the mouse button will
793 copy the text instead. This behaviour was changed in Geany 0.11 -
794 before the selected text was copied to the new position.
797 Indentation
798 ^^^^^^^^^^^
800 Geany allows each document to indent either with a tab character,
801 multiple spaces or a combination of both.
803 The *Tabs* setting indents with one tab character per indent level, and
804 displays tabs as the indent width.
806 The *Spaces* setting indents with the number of spaces set in the indent
807 width for each level.
809 The *Tabs and Spaces* setting indents with spaces as above, then converts
810 as many spaces as it can to tab characters at the rate of one tab for
811 each multiple of the `Various preference` setting
812 *indent_hard_tab_width* (default 8) and displays tabs as the
813 *indent_hard_tab_width* value.
815 The default indent settings are set in `Editor Indentation
816 preferences`_ (see the link for more information).
818 The default settings can be overridden per-document using the
819 Document menu. They can also be overridden by projects - see
820 `Project management`_.
822 The indent mode for the current document is shown on the status bar
823 as follows:
826     Indent with Tab characters.
828     Indent with spaces.
830     Indent with tabs and spaces, depending on how much indentation is
831     on a line.
833 Applying new indentation settings
834 `````````````````````````````````
835 After changing the default settings you may wish to apply the new
836 settings to every document in the current session. To do this use the
837 *Project->Apply Default Indentation* menu item.
839 Detecting indent type
840 `````````````````````
841 The *Detect from file* indentation preference can be used to
842 scan each file as it's opened and set the indent type based on
843 how many lines start with a tab vs. 2 or more spaces.
846 Auto-indentation
847 ^^^^^^^^^^^^^^^^
849 When enabled, auto-indentation happens when pressing *Enter* in the
850 Editor. It adds a certain amount of indentation to the new line so the
851 user doesn't always have to indent each line manually.
853 Geany has four types of auto-indentation:
855 None
856     Disables auto-indentation completely.
857 Basic
858     Adds the same amount of whitespace on a new line as on the previous line.
859     For the *Tabs* and the *Spaces* indent types the indentation will use the
860     same combination of characters as the previous line.  The
861     *Tabs and Spaces* indentation type converts as explained above.
862 Current chars
863     Does the same as *Basic* but also indents a new line after an opening
864     brace '{', and de-indents when typing a closing brace '}'. For Python,
865     a new line will be indented after typing ':' at the end of the
866     previous line.
867 Match braces
868     Similar to *Current chars* but the closing brace will be aligned to
869     match the indentation of the line with the opening brace.  This
870     requires the filetype to be one where Geany knows that the Scintilla
871     lexer understands matching braces (C, C++, D, HTML, Pascal, Bash,
872     Perl, TCL).
874 There is also XML-tag auto-indentation. This is enabled when the
875 mode is more than just Basic, and is also controlled by a filetype
876 setting - see `xml_indent_tags`_.
879 Bookmarks
880 ^^^^^^^^^
882 Geany provides a handy bookmarking feature that lets you mark one
883 or more lines in a document, and return the cursor to them using a
884 key combination.
886 To place a mark on a line, either left-mouse-click in the left margin
887 of the editor window, or else use Ctrl-m. This will
888 produce a small green plus symbol in the margin. You can have as many
889 marks in a document as you like. Click again (or use Ctrl-m again)
890 to remove the bookmark. To remove all the marks in a given document,
891 use "Remove Markers" in the Document menu.
893 To navigate down your document, jumping from one mark to the next,
894 use Ctrl-. (control period). To go in the opposite direction on
895 the page, use Ctrl-, (control comma). Using the bookmarking feature
896 together with the commands to switch from one editor tab to another
897 (Ctrl-PgUp/PgDn and Ctrl-Tab) provides a particularly fast way to
898 navigate around multiple files.
901 Code navigation history
902 ^^^^^^^^^^^^^^^^^^^^^^^
904 To ease navigation in source files and especially between
905 different files, Geany lets you jump between different navigation
906 points. Currently, this works for the following:
908 * `Go to symbol declaration`_
909 * `Go to symbol definition`_
910 * Symbol list items
911 * Build errors
912 * Message items
914 When using one of these actions, Geany remembers your current position
915 and jumps to the new one. If you decide to go back to your previous
916 position in the file, just use "Navigate back a location". To
917 get back to the new position again, just use "Navigate forward a
918 location". This makes it easier to navigate in e.g.  foreign code
919 and between different files.
922 Sending text through custom commands
923 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
925 You can define several custom commands in Geany and send the current
926 selection to one of these commands using the *Edit->Format->Send
927 Selection to* menu or keybindings. The output of the command will be
928 used to replace the current selection. This makes it possible to use
929 text formatting tools with Geany in a general way.
931 The selected text will be sent to the standard input of the executed
932 command, so the command should be able to read from it and it should
933 print all results to its standard output which will be read by
934 Geany. To help finding errors in executing the command, the output
935 of the program's standard error will be printed on Geany's standard
936 output.
938 If there is no selection, the whole current line is used instead.
940 To add a custom command, use the *Send Selection to->Set Custom
941 Commands* menu item. Click on *Add* to get a new item and type the
942 command. You can also specify some command line options. Empty
943 commands are not saved.
945 Normal shell quoting is supported, so you can do things like:
947 * ``sed 's/\./(dot)/g'``
949 The above example would normally be done with the `Replace all`_
950 function, but it can be handy to have common commands already set up.
952 Note that the command is not run in a shell, so if you want to use
953 shell features like pipes and command chains, you need to explicitly
954 launch the shell and pass it your command:
956 * ``sh -c 'sort | uniq'``
959 Context actions
960 ^^^^^^^^^^^^^^^
962 You can execute the context action command on the current word at the
963 cursor position or the available selection.  This word or selection
964 can be used as an argument to the command.
965 The context action is invoked by a menu entry in the popup menu of the
966 editor and also a keyboard shortcut (see the section called
967 `Keybindings`_).
969 The command can be specified in the preferences dialog and also for
970 each filetype (see "context_action_cmd" in the section called
971 `Filetype configuration`_). When the context action is invoked, the filetype
972 specific command is used if available, otherwise the command
973 specified in the preferences dialog is executed.
975 The current word or selection can be referred with the wildcard "%s"
976 in the command, it will be replaced by the current word or
977 selection before the command is executed.
979 For example a context action can be used to open API documentation
980 in a browser window, the command to open the PHP API documentation
981 would be::
983     firefox "http://www.php.net/%s"
985 when executing the command, the %s is substituted by the word near
986 the cursor position or by the current selection. If the cursor is at
987 the word "echo", a browser window will open(assumed your browser is
988 called firefox) and it will open the address: http://www.php.net/echo.
991 Autocompletion
992 ^^^^^^^^^^^^^^
994 Geany can offer a list of possible completions for symbols defined in the
995 tags files and for all words in open documents.
997 The autocompletion list for symbols is presented when the first few
998 characters of the symbol are typed (configurable, see `Editor Completions
999 preferences`_, default 4) or when the *Complete word*
1000 keybinding is pressed (configurable, see `Editor keybindings`_,
1001 default Ctrl-Space).
1003 For some languages the autocompletion list is ordered by heuristics to
1004 attempt to show names that are more likely to be what the user wants
1005 close to the top of the list.
1007 When the defined keybinding is typed and the *Autocomplete all words in
1008 document* preference (in `Editor Completions preferences`_)
1009 is selected then the autocompletion list will show all matching words
1010 in the document, if there are no matching symbols.
1012 If you don't want to use autocompletion it can be dismissed until
1013 the next symbol by pressing Escape. The autocompletion list is updated
1014 as more characters are typed so that it only shows completions that start
1015 with the characters typed so far. If no symbols begin with the sequence,
1016 the autocompletion window is closed.
1018 The up and down arrows will move the selected item. The highlighted
1019 item on the autocompletion list can be chosen from the list by pressing
1020 Enter/Return. You can also double-click to select an item. The sequence
1021 will be completed to match the chosen item, and if the *Drop rest of
1022 word on completion* preference is set (in `Editor Completions
1023 preferences`_) then any characters after the cursor that match
1024 a symbol or word are deleted.
1026 Word part completion
1027 ````````````````````
1028 By default, pressing Tab will complete the selected item by word part;
1029 useful e.g. for adding the prefix ``gtk_combo_box_entry_`` without typing it
1030 manually:
1032 * gtk_com<TAB>
1033 * gtk_combo_<TAB>
1034 * gtk_combo_box_<e><TAB>
1035 * gtk_combo_box_entry_<s><ENTER>
1036 * gtk_combo_box_entry_set_text_column
1038 The key combination can be changed from Tab - See `Editor keybindings`_.
1039 If you clear/change the key combination for word part completion, Tab
1040 will complete the whole word instead, like Enter.
1042 Scope autocompletion
1043 ````````````````````
1044 E.g.::
1046     struct
1047     {
1048         int i;
1049         char c;
1050     } foo;
1052 When you type ``foo.`` it will show an autocompletion list with 'i' and
1053 'c' symbols.
1055 It only works for languages that set parent scope names for e.g. struct
1056 members. Most languages only parse global definitions and so scope
1057 autocompletion will not work for names declared in local scope
1058 (e.g. inside functions). A few languages parse both local and global
1059 symbols (e.g. C/C++ parsers) and for these parsers scope autocompletion
1060 works also for local variables.
1063 User-definable snippets
1064 ^^^^^^^^^^^^^^^^^^^^^^^
1066 Snippets are small strings or code constructs which can be replaced or
1067 completed to a more complex string. So you can save a lot of time when
1068 typing common strings and letting Geany do the work for you.
1069 To know what to complete or replace Geany reads a configuration file
1070 called ``snippets.conf`` at startup.
1072 Maybe you need to often type your name, so define a snippet like this::
1074     [Default]
1075     myname=Enrico Tröger
1077 Every time you write ``myname`` <TAB> in Geany, it will replace "myname"
1078 with "Enrico Tröger". The key to start autocompletion can be changed
1079 in the preferences dialog, by default it is TAB. The corresponding keybinding
1080 is called `Complete snippet`.
1082 **Paths**
1084 You can override the default snippets using the user
1085 ``snippets.conf`` file. Use the *Tools->Configuration
1086 Files->snippets.conf* menu item. See also `Configuration file paths`_.
1088 This adds the default settings to the user file if the file doesn't
1089 exist. Alternatively the file can be created manually, adding only
1090 the settings you want to change. All missing settings will be read
1091 from the system snippets file.
1093 **Snippet groups**
1095 The file ``snippets.conf`` contains sections defining snippets that
1096 are available for particular filetypes and in general.
1098 The two sections "Default" and "Special" apply to all filetypes.
1099 "Default" contains all snippets which are available for every
1100 filetype and "Special" contains snippets which can only be used in
1101 other snippets. So you can define often used parts of snippets and
1102 just use the special snippet as a placeholder (see the
1103 ``snippets.conf`` for details).
1105 You can define sections with the name of a filetype eg "C++".  The
1106 snippets in that section are only available for use in files with that
1107 filetype.  Snippets in filetype sections will hide snippets with the
1108 same name in the "Default" section when used in a file of that
1109 filetype.
1111 **Substitution sequences for snippets**
1113 To define snippets you can use several special character sequences which
1114 will be replaced when using the snippet:
1116 ================  =========================================================
1117 \\n or %newline%  Insert a new line (it will be replaced by the used EOL
1118                   char(s): LF, CR/LF, or CR).
1120 \\t or %ws%       Insert an indentation step, it will be replaced according
1121                   to the current document's indent mode.
1123 \\s               \\s to force whitespace at beginning or end of a value
1124                   ('key= value' won't work, use 'key=\\svalue')
1126 %cursor%          Place the cursor at this position after completion has
1127                   been done. You can define multiple %cursor% wildcards
1128                   and use the keybinding `Move cursor in snippet` to jump
1129                   to the next defined cursor position in the completed
1130                   snippet.
1132 %...%             "..." means the name of a key in the "Special" section.
1133                   If you have defined a key "brace_open" in the "Special"
1134                   section you can use %brace_open% in any other snippet.
1135 ================  =========================================================
1137 Snippet names must not contain spaces otherwise they won't
1138 work correctly. But beside that you can define almost any
1139 string as a snippet and use it later in Geany. It is not limited
1140 to existing constructs of certain programming languages(like ``if``,
1141 ``for``, ``switch``). Define whatever you need.
1143 **Template wildcards**
1145 Since Geany 0.15 you can also use most of the available templates wildcards
1146 listed in `Template wildcards`_. All wildcards which are listed as
1147 `available in snippets` can be used. For instance to improve the above example::
1149     [Default]
1150     myname=My name is {developer}
1151     mysystem=My system: {command:uname -a}
1153 this will replace ``myname`` with "My name is " and the value of the template
1154 preference ``developer``.
1156 **Word characters**
1158 You can change the way Geany recognizes the word to complete,
1159 that is how the start and end of a word is recognised when the
1160 snippet completion is requested. The section "Special" may
1161 contain a key "wordchars" which lists all characters a string may contain
1162 to be recognized as a word for completion. Leave it commented to use
1163 default characters or define it to add or remove characters to fit your
1164 needs.
1166 Snippet keybindings
1167 ```````````````````
1169 Normally you would type the snippet name and press Tab. However, you
1170 can define keybindings for snippets under the *Keybindings* group in
1171 ``snippets.conf``::
1173     [Keybindings]
1174     for=<Ctrl>7
1175     block_cursor=<Ctrl>8
1177 .. note::
1178     Snippet keybindings may be overridden by Geany's configurable
1179     keybindings.
1182 Inserting Unicode characters
1183 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1185 You can insert Unicode code points by hitting Ctrl-Shift-u, then still holding
1186 Ctrl-Shift, type some hex digits representing the code point for the character
1187 you want and hit Enter or Return (still holding Ctrl-Shift). If you release
1188 Ctrl-Shift before hitting Enter or Return (or any other character), the code
1189 insertion is completed, but the typed character is also entered.  In the case
1190 of Enter/Return, it is a newline, as you might expect.
1193 In some earlier versions of Geany, you might need to first unbind Ctrl-Shift-u
1194 in the `keybinding preferences`_, then select *Tools->Reload Configuration*
1195 or restart Geany. Note that it works slightly differently from other GTK
1196 applications, in that you'll need to continue to hold down the Ctrl and Shift
1197 keys while typing the code point hex digits (and the Enter or Return to finish the code point).
1200 Inserting color values
1201 ^^^^^^^^^^^^^^^^^^^^^^
1203 You can insert a color value by selecting *Tools->Color Chooser* from the menu.
1204 A dialog appears to select the wanted color. If the cursor is placed inside a
1205 *#RRGGBB* format color value then the dialog will show that color after opening.
1206 On clicking on *Apply* or *Select* the code for the chosen color will be inserted
1207 in the format *#RRGGBB*. If text is selected, then it will be replaced with the
1208 color code on the first click on *Apply* or *Select*. If no text is selected or
1209 on subsequent clicks the color code is inserted at the current cursor position.
1212 Search, replace and go to
1213 -------------------------
1215 This section describes search-related commands from the Search menu
1216 and the editor window's popup menu:
1218 * Find
1219 * Find selection
1220 * Find usage
1221 * Find in files
1222 * Replace
1223 * Go to symbol definition
1224 * Go to symbol declaration
1225 * Go to line
1227 See also `Search`_ preferences.
1229 Toolbar entries
1230 ^^^^^^^^^^^^^^^
1231 There are also two toolbar entries:
1233 * Search bar
1234 * Go to line entry
1236 There are keybindings to focus each of these - see `Focus
1237 keybindings`_. Pressing Escape will then focus the editor.
1239 Search bar
1240 ``````````
1241 The quickest way to find some text is to use the search bar entry in
1242 the toolbar. This performs a case-insensitive search in the current
1243 document whilst you type. Pressing Enter will search again, and pressing
1244 Shift-Enter will search backwards.
1246 Find
1247 ^^^^
1249 The Find dialog is used for finding text in one or more open documents.
1251 .. image:: ./images/find_dialog.png
1254 Matching options
1255 ````````````````
1257 The syntax for the *Use regular expressions* option is shown in
1258 `Regular expressions`_.
1260 .. note::
1261     *Use escape sequences* is implied for regular expressions.
1263 The *Use multi-line matching* option enables multi-line regular
1264 expressions instead of single-line ones.  See `Regular expressions`_ for
1265 more details on the differences between the two modes.
1267 The *Use escape sequences* option will transform any escaped characters
1268 into their UTF-8 equivalent. For example, \\t will be transformed into
1269 a tab character. Other recognized symbols are: \\\\, \\n, \\r, \\uXXXX
1270 (Unicode characters).
1273 Find all
1274 ````````
1276 To find all matches, click on the Find All expander. This will reveal
1277 several options:
1279 * In Document
1280 * In Session
1281 * Mark
1283 Find All In Document will show a list of matching lines in the
1284 current document in the Messages tab of the Message Window. *Find All
1285 In Session* does the same for all open documents.
1287 Mark will highlight all matches in the current document with a
1288 colored box. These markers can be removed by selecting the
1289 Remove Markers command from the Document menu.
1292 Change font in search dialog text fields
1293 ````````````````````````````````````````
1295 All search related dialogs use a Monospace font for the text input fields to
1296 increase the readability of input text. This is useful when you are
1297 typing input such as regular expressions with spaces, periods and commas which
1298 might be hard to read with a proportional font.
1300 If you want to change the font, you can do this easily by using the following
1301 custom CSS snippet, see `Customizing Geany's appearance using GTK+ CSS`_::
1303     #GeanyDialogSearch GtkEntry /* GTK < 3.20 */,
1304     #GeanyDialogSearch entry /* GTK >= 3.20 */ {
1305         font: 8pt monospace;
1306     }
1309 Find selection
1310 ^^^^^^^^^^^^^^
1311 The *Find Next/Previous Selection* commands perform a search for the
1312 current selected text. If nothing is selected, by default the current
1313 word is used instead. This can be customized by the
1314 *find_selection_type* preference - see `Various preferences`_.
1316 =====   =============================================
1317 Value   *find_selection_type* behaviour
1318 =====   =============================================
1319 0       Use the current word (default).
1320 1       Try the X selection first, then current word.
1321 2       Repeat last search.
1322 =====   =============================================
1325 Find usage
1326 ^^^^^^^^^^
1328 *Find Usage* searches all open files. It is similar to the *Find All In
1329 Session* option in the Find dialog.
1331 If there is a selection, then it is used as the search text; otherwise
1332 the current word is used. The current word is either taken from the
1333 word nearest the edit cursor, or the word underneath the popup menu
1334 click position when the popup menu is used. The search results are
1335 shown in the Messages tab of the Message Window.
1337 .. note::
1338     You can also use Find Usage for symbol list items from the popup
1339     menu.
1342 Find in files
1343 ^^^^^^^^^^^^^
1345 *Find in Files* is a more powerful version of *Find Usage* that searches
1346 all files in a certain directory using the Grep tool. The Grep tool
1347 must be correctly set in Preferences to the path of the system's Grep
1348 utility. GNU Grep is recommended (see note below).
1350 .. image:: ./images/find_in_files_dialog.png
1352 The *Search* field is initially set to the current word in the editor
1353 (depending on `Search`_ preferences).
1355 The *Files* setting allows to choose which files are included in the
1356 search, depending on the mode:
1359     Search in all files;
1360 Project
1361     Use the current project's patterns, see `Project properties`_;
1362 Custom
1363     Use custom patterns.
1365 Both project and custom patterns use a glob-style syntax, each
1366 pattern separated by a space. To search all ``.c`` and ``.h`` files,
1367 use: ``*.c *.h``.
1368 Note that an empty pattern list searches in all files rather
1369 than none.
1371 The *Directory* field is initially set to the current document's directory,
1372 unless this field has already been edited and the current document has
1373 not changed. Otherwise, the current document's directory is prepended to
1374 the drop-down history. This can be disabled - see `Search`_ preferences.
1376 The *Encoding* field can be used to define the encoding of the files
1377 to be searched. The entered search text is converted to the chosen encoding
1378 and the search results are converted back to UTF-8.
1380 The *Extra options* field is used to pass any additional arguments to
1381 the grep tool.
1383 .. note::
1384     The *Files* setting uses ``--include=`` when searching recursively,
1385     *Recurse in subfolders* uses ``-r``; both are GNU Grep options and may
1386     not work with other Grep implementations.
1389 Filtering out version control files
1390 ```````````````````````````````````
1392 When using the *Recurse in subfolders* option with a directory that's
1393 under version control, you can set the *Extra options* field to filter
1394 out version control files.
1396 If you have GNU Grep >= 2.5.2 you can use the ``--exclude-dir``
1397 argument to filter out CVS and hidden directories like ``.svn``.
1399 Example: ``--exclude-dir=.svn --exclude-dir=CVS``
1401 If you have an older Grep, you can try using the ``--exclude`` flag
1402 to filter out filenames.
1404 SVN Example: ``--exclude=*.svn-base``
1406 The --exclude argument only matches the file name part, not the path.
1409 Replace
1410 ^^^^^^^
1412 The Replace dialog is used for replacing text in one or more open
1413 documents.
1415 .. image:: ./images/replace_dialog.png
1417 The Replace dialog has the same options for matching text as the Find
1418 dialog. See the section `Matching options`_.
1420 The *Use regular expressions* option allows regular expressions to
1421 be used in the search string and back references in the replacement
1422 text -- see the entry for '\\n' in `Regular expressions`_.
1424 Replace all
1425 ```````````
1427 To replace several matches, click on the *Replace All* expander. This
1428 will reveal several options:
1430 * In Document
1431 * In Session
1432 * In Selection
1434 *Replace All In Document* will replace all matching text in the
1435 current document. *Replace All In Session* does the same for all open
1436 documents. *Replace All In Selection* will replace all matching text
1437 in the current selection of the current document.
1440 Go to symbol definition
1441 ^^^^^^^^^^^^^^^^^^^^^^^
1443 If the current word or selection is the name of a symbol definition
1444 (e.g. a function name) and the file containing the symbol definition is
1445 open, this command will switch to that file and go to the
1446 corresponding line number. The current word is either the word
1447 nearest the edit cursor, or the word underneath the popup menu click
1448 position when the popup menu is used.
1450 If there are more symbols with the same name to which the goto can be performed,
1451 a pop up is shown with a list of all the occurrences. After selecting a symbol
1452 from the list Geany jumps to the corresponding symbol location. Geany tries to
1453 suggest the nearest symbol (symbol from the current file, other open documents
1454 or current directory) as the best candidate for the goto and places this symbol
1455 at the beginning of the list typed in boldface.
1457 .. note::
1458     If the corresponding symbol is on the current line, Geany will first
1459     look for a symbol declaration instead, as this is more useful.
1460     Likewise *Go to symbol declaration* will search for a symbol definition
1461     first in this case also.
1464 Go to symbol declaration
1465 ^^^^^^^^^^^^^^^^^^^^^^^^
1467 Like *Go to symbol definition*, but for a forward declaration such as a
1468 C function prototype or ``extern`` declaration instead of a function
1469 body.
1472 Go to line
1473 ^^^^^^^^^^
1475 Go to a particular line number in the current file.
1478 Regular expressions
1479 ^^^^^^^^^^^^^^^^^^^
1481 You can use regular expressions in the Find and Replace dialogs
1482 by selecting the *Use regular expressions* check box (see `Matching
1483 options`_). The syntax is Perl compatible. Basic syntax is described
1484 in the table below. For full details, see
1485 https://www.geany.org/manual/gtk/glib/glib-regex-syntax.html.
1487 By default regular expressions are matched on a line-by-line basis.
1488 If you are interested in multi-line regular expressions, matched against
1489 the whole buffer at once, see the section `Multi-line regular expressions`_
1490 below.
1492 .. note::
1493     1. The *Use escape sequences* dialog option always applies for regular
1494        expressions.
1495     2. Searching backwards with regular expressions is not supported.
1496     3. The *Use multi-line matching* dialog option to select single or
1497        multi-line matching.
1499 **In a regular expression, the following characters are interpreted:**
1501 ======= ============================================================
1502 .       Matches any character.
1504 (       This marks the start of a region for tagging a match.
1506 )       This marks the end of a tagged region.
1508 \\n     Where n is 1 through 9 refers to the first through ninth tagged
1509         region when searching or replacing.
1511         Searching for (Wiki)\\1 matches WikiWiki.
1513         If the search string was Fred([1-9])XXX and the
1514         replace string was Sam\\1YYY, when applied to Fred2XXX this
1515         would generate Sam2YYY.
1517 \\0     When replacing, the whole matching text.
1519 \\b     This matches a word boundary.
1521 \\c     A backslash followed by d, D, s, S, w or W, becomes a
1522         character class (both inside and outside sets []).
1524         * d: decimal digits
1525         * D: any char except decimal digits
1526         * s: whitespace (space, \\t \\n \\r \\f \\v)
1527         * S: any char except whitespace (see above)
1528         * w: alphanumeric & underscore
1529         * W: any char except alphanumeric & underscore
1531 \\x     This allows you to use a character x that would otherwise have
1532         a special meaning. For example, \\[ would be interpreted as [
1533         and not as the start of a character set. Use \\\\ for a literal
1534         backslash.
1536 [...]   Matches one of the characters in the set. If the first
1537         character in the set is ^, it matches the characters NOT in
1538         the set, i.e. complements the set. A shorthand S-E (start
1539         dash end) is used to specify a set of characters S up to E,
1540         inclusive.
1542         The special characters ] and - have no special
1543         meaning if they appear first in the set. - can also be last
1544         in the set. To include both, put ] first: []A-Z-].
1546         Examples::
1548         []|-]    matches these 3 chars
1549         []-|]    matches from ] to | chars
1550         [a-z]    any lowercase alpha
1551         [^]-]    any char except - and ]
1552         [^A-Z]   any char except uppercase alpha
1553         [a-zA-Z] any alpha
1555 ^       This matches the start of a line (unless used inside a set, see
1556         above).
1558 $       This matches the end of a line.
1560 \*      This matches 0 or more times. For example, Sa*m matches Sm, Sam,
1561         Saam, Saaam and so on.
1563 \+      This matches 1 or more times. For example, Sa+m matches Sam,
1564         Saam, Saaam and so on.
1566 \?      This matches 0 or 1 time(s). For example, Joh?n matches John, Jon.
1567 ======= ============================================================
1569 .. note::
1570     This table is adapted from Scintilla and SciTE documentation,
1571     distributed under the `License for Scintilla and SciTE`_.
1574 Multi-line regular expressions
1575 ``````````````````````````````
1577 .. note::
1578     The *Use multi-line matching* dialog option enables multi-line
1579     regular expressions.
1581 Multi-line regular expressions work just like single-line ones but a
1582 match can span several lines.
1584 While the syntax is the same, a few practical differences applies:
1586 ======= ============================================================
1587 .       Matches any character but newlines.  This behavior can be changed
1588         to also match newlines using the (?s) option, see
1589         https://www.geany.org/manual/gtk/glib/glib-regex-syntax.html#idp5671632
1591 [^...]  A negative range (see above) *will* match newlines if they are
1592         not explicitly listed in that negative range.  For example, range
1593         [^a-z] will match newlines, while range [^a-z\\r\\n] won't.
1594         While this is the expected behavior, it can lead to tricky
1595         problems if one doesn't think about it when writing an expression.
1596 ======= ============================================================
1599 View menu
1600 ---------
1601 The View menu allows various elements of the main window to be shown
1602 or hidden, and also provides various display-related editor options.
1604 Color schemes dialog
1605 ^^^^^^^^^^^^^^^^^^^^
1606 The Color Schemes dialog is available under the *View->Change Color Scheme*
1607 menu item. It lists various color schemes for editor highlighting
1608 styles, including the default scheme first. Other items are available
1609 based on what color scheme files Geany found at startup.
1611 Color scheme files are read from the `Configuration file paths`_ under
1612 the ``colorschemes`` subdirectory. They should have the extension
1613 ``.conf``. The default color scheme
1614 is read from ``filetypes.common``.
1616 The `[named_styles] section`_  and `[named_colors] section`_ are the
1617 same as for ``filetypes.common``.
1619 The ``[theme_info]`` section can contain information about the
1620 theme. The ``name`` and ``description`` keys are read to set the
1621 menu item text and tooltip, respectively. These keys can have
1622 translations, e.g.::
1624     key=Hello
1625     key[de]=Hallo
1626     key[fr_FR]=Bonjour
1628 Symbols and tags files
1629 ----------------------
1631 Upon opening, files of supported filetypes are parsed to extract the symbol
1632 information (aka "workspace symbols"). You can also have Geany automatically
1633 load external files containing the symbol information (aka "global
1634 tags files") upon startup, or manually using *Tools --> Load Tags File*.
1636 Geany uses its own tags file format, similar to what ``ctags`` uses
1637 (but is incompatible with ctags). You use Geany to generate global
1638 tags files, as described below.
1641 Workspace symbols
1642 ^^^^^^^^^^^^^^^^^
1644 Each document is parsed for symbols whenever a file is loaded, saved or
1645 modified (see *Symbol list update frequency* preference in the `Editor
1646 Completions preferences`_). These are shown in the Symbol list in the
1647 Sidebar. These symbols are also used for autocompletion and calltips
1648 for all documents open in the current session that have the same filetype.
1650 The *Go to Symbol* commands can be used with all workspace symbols. See
1651 `Go to symbol definition`_.
1654 Global tags files
1655 ^^^^^^^^^^^^^^^^^
1657 Global tags files are used to provide symbols for autocompletion and calltips
1658 without having to open the source files containing these symbols. This is intended
1659 for library APIs, as the tags file only has to be updated when you upgrade
1660 the library.
1662 You can load a custom global tags file in two ways:
1664 * Using the *Load Tags File* command in the Tools menu.
1665 * By moving or symlinking tags files to the ``tags`` subdirectory of
1666   one of the `configuration file paths`_ before starting Geany.
1668 You can either download these files or generate your own. They have
1669 the format::
1671     name.lang_ext.tags
1673 *lang_ext* is one of the extensions set for the filetype associated
1674 with the tags parser. See the section called `Filetype extensions`_ for
1675 more information.
1678 Default global tags files
1679 `````````````````````````
1681 Some global tags files are distributed with Geany and will be loaded
1682 automatically when the corresponding filetype is first used. Currently
1683 this includes global tags files for these languages:
1685 * C
1686 * Pascal
1687 * PHP
1688 * HTML -- &symbol; completion, e.g. for ampersand, copyright, etc.
1689 * LaTeX
1690 * Python
1693 Global tags file format
1694 ```````````````````````
1696 Global tags files can have three different formats:
1698 * Tagmanager format
1699 * Pipe-separated format
1700 * CTags format
1702 The first line of global tags files should be a comment, introduced
1703 by ``#`` followed by a space and a string like ``format=pipe``,
1704 ``format=ctags`` or ``format=tagmanager`` respectively, these are
1705 case-sensitive.  This helps Geany to read the file properly. If this
1706 line is missing, Geany tries to auto-detect the used format but this
1707 might fail.
1710 The Tagmanager format is a bit more complex and is used for files
1711 created by the ``geany -g`` command. There is one symbol per line.
1712 Different symbol attributes like the return value or the argument list
1713 are separated with different characters indicating the type of the
1714 following argument.  This is the more complete and recommended tags file
1715 format.
1717 Pipe-separated format
1718 *********************
1719 The Pipe-separated format is easier to read and write.
1720 There is one symbol per line and different symbol attributes are separated
1721 by the pipe character (``|``). A line looks like::
1723     basename|string|(string path [, string suffix])|
1725 | The first field is the symbol name (usually a function name).
1726 | The second field is the type of the return value.
1727 | The third field is the argument list for this symbol.
1728 | The fourth field is the description for this symbol but
1729   currently unused and should be left empty.
1731 Except for the first field (symbol name), all other field can be left
1732 empty but the pipe separator must appear for them.
1734 You can easily write your own global tags files using this format.
1735 Just save them in your tags directory, as described earlier in the
1736 section `Global tags files`_.
1738 CTags format
1739 ************
1740 This is the format that ctags generates, and that is used by Vim.
1741 This format is compatible with the format historically used by Vi.
1743 The format is described at http://ctags.sourceforge.net/FORMAT, but
1744 for the full list of existing extensions please refer to ctags.
1745 However, note that Geany may actually only honor a subset of the
1746 existing extensions.
1748 Generating a global tags file
1749 `````````````````````````````
1751 You can generate your own global tags files by parsing a list of
1752 source files. The command is::
1754     geany -g [-P] <Tags File> <File list>
1756 * Tags File filename should be in the format described earlier --
1757   see the section called `Global tags files`_.
1758 * File list is a list of filenames, each with a full path (unless
1759   you are generating C/C++ tags files and have set the CFLAGS environment
1760   variable appropriately).
1761 * ``-P`` or ``--no-preprocessing`` disables using the C pre-processor
1762   to process ``#include`` directives for C/C++ source files. Use this
1763   option if you want to specify each source file on the command-line
1764   instead of using a 'master' header file. Also can be useful if you
1765   don't want to specify the CFLAGS environment variable.
1767 Example for the wxD library for the D programming language::
1769     geany -g wxd.d.tags /home/username/wxd/wx/*.d
1772 Generating C/C++ tags files
1773 ***************************
1774 You may need to first setup the `C ignore.tags`_ file.
1776 For C/C++ tags files gcc is required by default, so that header files
1777 can be preprocessed to include any other headers they depend upon. If
1778 you do not want this, use the ``-P`` option described above.
1780 For preprocessing, the environment variable CFLAGS should be set with
1781 appropriate ``-I/path`` include paths. The following example works with
1782 the bash shell, generating a tags file for the GnomeUI library::
1784     CFLAGS=`pkg-config --cflags libgnomeui-2.0` geany -g gnomeui.c.tags \
1785     /usr/include/libgnomeui-2.0/gnome.h
1787 You can adapt this command to use CFLAGS and header files appropriate
1788 for whichever libraries you want.
1791 Generating tags files on Windows
1792 ********************************
1793 This works basically the same as on other platforms::
1795     "c:\program files\geany\bin\geany" -g c:\mytags.php.tags c:\code\somefile.php
1798 C ignore.tags
1799 ^^^^^^^^^^^^^
1801 You can ignore certain symbols for C-based languages if they would lead
1802 to wrong parsing of the code. Use the *Tools->Configuration
1803 Files->ignore.tags* menu item to open the user ``ignore.tags`` file.
1804 See also `Configuration file paths`_.
1806 List all symbol names you want to ignore in this file, separated by spaces
1807 and/or newlines.
1809 Example::
1811     G_GNUC_NULL_TERMINATED
1812     G_GNUC_PRINTF
1813     G_GNUC_WARN_UNUSED_RESULT
1814     BAR
1816 This will ignore the above macros and will correctly detect 'Foo' as a type
1817 instead of 'BAR' in the following code:
1819 ``struct Foo BAR { int i; };``
1821 In addition, it is possible to specify macro definition similarly to the
1822 gcc '-D' option:
1824     <macro>=<definition>
1825     Defines a C preprocessor <macro>. This emulates the behavior  of
1826     the corresponding gcc option. All types of macros are supported,
1827     including the  ones  with  parameters  and  variable  arguments.
1828     Stringification, token pasting and recursive macro expansion are
1829     also supported.
1831 For even more detailed information please read the manual page of
1832 Universal Ctags.
1835 Preferences
1836 -----------
1838 You may adjust Geany's settings using the Edit --> Preferences
1839 dialog. Any changes you make there can be applied by hitting either
1840 the Apply or the OK button. These settings will persist between Geany
1841 sessions. Note that most settings here have descriptive popup bubble
1842 help -- just hover the mouse over the item in question to get help
1843 on it.
1845 You may also adjust some View settings (under the View menu) that
1846 persist between Geany sessions. The settings under the Document menu,
1847 however, are only for the current document and revert to defaults
1848 when restarting Geany.
1850 .. note::
1851     In the paragraphs that follow, the text describing a dialog tab
1852     comes after the screenshot of that tab.
1855 General Startup preferences
1856 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1858 .. image:: ./images/pref_dialog_gen_startup.png
1860 Startup
1861 ```````
1863 Load files from the last session
1864     On startup, load the same files you had open the last time you
1865     used Geany.
1867 Load virtual terminal support
1868     Load the library for running a terminal in the message window area.
1870 Enable plugin support
1871     Allow plugins to be used in Geany.
1873 Shutdown
1874 ````````
1875 Save window position and geometry
1876     Save the current position and size of the main window so next time
1877     you open Geany it's in the same location.
1879 Confirm Exit
1880     Have a dialog pop up to confirm that you really want to quit Geany.
1882 Paths
1883 `````
1885 Startup path
1886     Path to start in when opening or saving files.
1887     It must be an absolute path.
1889 Project files
1890     Path to start in when opening project files.
1892 Extra plugin path
1893     By default Geany looks in the system installation and the user
1894     configuration - see `Plugins`_. In addition the path entered here will be
1895     searched.
1896     Usually you do not need to set an additional path to search for
1897     plugins. It might be useful when Geany is installed on a multi-user machine
1898     and additional plugins are available in a common location for all users.
1899     Leave blank to not set an additional lookup path.
1902 General Miscellaneous preferences
1903 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1905 .. image:: ./images/pref_dialog_gen_misc.png
1907 Miscellaneous
1908 `````````````
1910 Beep on errors when compilation has finished
1911     Have the computer make a beeping sound when compilation of your program
1912     has completed or any errors occurred.
1914 Switch status message list at new message
1915     Switch to the status message tab (in the notebook window at the bottom)
1916     once a new status message arrives.
1918 Suppress status messages in the status bar
1919     Remove all messages from the status bar. The messages are still displayed
1920     in the status messages window.
1922     .. tip::
1923         Another option is to use the *Switch to Editor* keybinding - it
1924         reshows the document statistics on the status bar. See `Focus
1925         keybindings`_.
1927 Auto-focus widgets (focus follows mouse)
1928     Give the focus automatically to widgets below the mouse cursor.
1929     This works for the main editor widget, the scribble, the toolbar search field
1930     go to line fields and the VTE.
1932 Search
1933 ``````
1935 Always wrap search
1936     Always wrap search around the document when finding a match.
1938 Hide the Find dialog
1939     Hide the `Find`_ dialog after clicking Find Next/Previous.
1941 Use the current word under the cursor for Find dialogs
1942     Use current word under the cursor when opening the Find, Find in Files or Replace dialog and
1943     there is no selection. When this option is disabled, the search term last used in the
1944     appropriate Find dialog is used.
1946 Use the current file's directory for Find in Files
1947     When opening the Find in Files dialog, set the directory to search to the directory of the current
1948     active file. When this option is disabled, the directory of the last use of the Find in Files
1949     dialog is used. See `Find in Files`_ for details.
1951 Projects
1952 ````````
1954 Use project-based session files
1955     Save your current session when closing projects. You will be able to
1956     resume different project sessions, automatically opening the files
1957     you had open previously.
1959 Store project file inside the project base directory
1960     When creating new projects, the default path for the project file contains
1961     the project base path. Without this option enabled, the default project file
1962     path is one level above the project base path.
1963     In either case, you can easily set the final project file path in the
1964     *New Project* dialog. This option provides the more common
1965     defaults automatically for convenience.
1968 Interface preferences
1969 ^^^^^^^^^^^^^^^^^^^^^
1971 .. image:: ./images/pref_dialog_interface_interface.png
1973 Sidebar
1974 ```````
1976 Show sidebar
1977     Whether to show the sidebar at all.
1979 Show symbol list
1980     Show the list of functions, variables, and other information in the
1981     current document you are editing.
1983 Show documents list
1984     Show all the documents you have open currently. This can be used to
1985     change between documents (see `Switching between documents`_) and
1986     to perform some common operations such as saving, closing and reloading.
1988 Position
1989     Whether to place the sidebar on the left or right of the editor window.
1991 Message window
1992 ``````````````
1994 Position
1995     Whether to place the message window on the bottom or right of the editor window.
1997 Fonts
1998 `````
2000 Editor
2001     Change the font used to display documents.
2003 Symbol list
2004     Change the font used for the Symbols sidebar tab.
2006 Message window
2007     Change the font used for the message window area.
2009 Miscellaneous
2010 `````````````
2012 Show status bar
2013     Show the status bar at the bottom of the main window. It gives information about
2014     the file you are editing like the line and column you are on, whether any
2015     modifications were done, the file encoding, the filetype and other information.
2017 Interface Notebook tab preferences
2018 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020 .. image:: ./images/pref_dialog_interface_notebook.png
2022 Editor tabs
2023 ```````````
2025 Show editor tabs
2026     Show a notebook tab for all documents so you can switch between them
2027     using the mouse (instead of using the Documents window).
2029 Show close buttons
2030     Make each tab show a close button so you can easily close open
2031     documents.
2033 Placement of new file tabs
2034     Whether to create a document with its notebook tab to the left or
2035     right of all existing tabs.
2037 Next to current
2038     Whether to place file tabs next to the current tab
2039     rather than at the edges of the notebook.
2041 Double-clicking hides all additional widgets
2042     Whether to call the View->Toggle All Additional Widgets command
2043     when double-clicking on a notebook tab.
2045 Tab label length
2046     If filenames are long, set the number of characters that should be
2047     visible on each tab's label.
2049 Tab positions
2050 `````````````
2052 Editor
2053     Set the positioning of the editor's notebook tabs to the right,
2054     left, top, or bottom of the editing window.
2056 Sidebar
2057     Set the positioning of the sidebar's notebook tabs to the right,
2058     left, top, or bottom of the sidebar window.
2060 Message window
2061     Set the positioning of the message window's notebook tabs to the
2062     right, left, top, or bottom of the message window.
2065 Interface Toolbar preferences
2066 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2068 Affects the main toolbar underneath the menu bar.
2070 .. image:: ./images/pref_dialog_interface_toolbar.png
2072 Toolbar
2073 ```````
2075 Show Toolbar
2076     Whether to show the toolbar.
2078 Append Toolbar to the Menu
2079     Allows to append the toolbar to the main menu bar instead of placing it below.
2080     This is useful to save vertical space.
2082 Customize Toolbar
2083     See `Customizing the toolbar`_.
2085 Appearance
2086 ``````````
2088 Icon Style
2089     Select the toolbar icon style to use - either icons and text, just
2090     icons or just text.
2091     The choice System default uses whatever icon style is set by GTK.
2093 Icon size
2094     Select the size of the icons you see (large, small or very small).
2095     The choice System default uses whatever icon size is set by GTK.
2098 Editor Features preferences
2099 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2101 .. image:: ./images/pref_dialog_edit_features.png
2103 Features
2104 ````````
2106 Line wrapping
2107     Show long lines wrapped around to new display lines.
2109 .. _smart_home_key:
2111 "Smart" home key
2112     Whether to move the cursor to the first non-whitespace character
2113     on the line when you hit the home key on your keyboard. Pressing it
2114     again will go to the very start of the line.
2116 Disable Drag and Drop
2117     Do not allow the dragging and dropping of selected text in documents.
2119 Code folding
2120     Allow groups of lines in a document to be collapsed for easier
2121     navigation/editing.
2123 Fold/Unfold all children of a fold point
2124     Whether to fold/unfold all child fold points when a parent line
2125     is folded.
2127 Use indicators to show compile errors
2128     Underline lines with compile errors using red squiggles to indicate
2129     them in the editor area.
2131 Newline strips trailing spaces
2132     Remove any whitespace at the end of the line when you hit the
2133     Enter/Return key. See also `Strip trailing spaces`_.  Note
2134     auto indentation is calculated before stripping, so although this
2135     setting will clear a blank line, it will not set the next line
2136     indentation back to zero.
2138 Line breaking column
2139     The editor column number to insert a newline at when Line Breaking
2140     is enabled for the current document.
2142 Comment toggle marker
2143     A string which is added when toggling a line comment in a source file.
2144     It is used to mark the comment as toggled.
2147 Editor Indentation preferences
2148 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2150 .. image:: ./images/pref_dialog_edit_indentation.png
2152 Indentation group
2153 `````````````````
2155 See `Indentation`_ for more information.
2157 Width
2158     The width of a single indent size in spaces. By default the indent
2159     size is equivalent to 4 spaces.
2161 Detect width from file
2162     Try to detect and set the indent width based on file content, when
2163     a file is opened.
2165 Type
2166     When Geany inserts indentation, whether to use:
2168     * Just Tabs
2169     * Just Spaces
2170     * Tabs and Spaces, depending on how much indentation is on a line
2172     The *Tabs and Spaces* indent type is also known as *Soft tab
2173     support* in some other editors.
2175 Detect type from file
2176     Try to detect and set the indent type based on file content, when
2177     a file is opened.
2179 Auto-indent mode
2180     The type of auto-indentation you wish to use after pressing Enter,
2181     if any.
2183     Basic
2184         Just add the indentation of the previous line.
2185     Current chars
2186         Add indentation based on the current filetype and any characters at
2187         the end of the line such as ``{``, ``}`` for C, ``:`` for Python.
2188     Match braces
2189         Like *Current chars* but for C-like languages, make a closing
2190         ``}`` brace line up with the matching opening brace.
2192 Tab key indents
2193     If set, pressing tab will indent the current line or selection, and
2194     unindent when pressing Shift-tab. Otherwise, the tab key will
2195     insert a tab character into the document (which can be different
2196     from indentation, depending on the indent type).
2198     .. note::
2199         There are also separate configurable keybindings for indent &
2200         unindent, but this preference allows the tab key to have different
2201         meanings in different contexts - e.g. for snippet completion.
2203 Backspace key unindents
2204     If set, pressing backspace while the cursor is in leading whitespace
2205     will reduce the indentation level, unless the indentation mode is tabs.
2206     Otherwise, the backspace key will delete the character before the cursor.
2208 Editor Completions preferences
2209 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2211 .. image:: ./images/pref_dialog_edit_completions.png
2213 Completions
2214 ```````````
2216 Snippet Completion
2217     Whether to replace special keywords after typing Tab into a
2218     pre-defined text snippet.
2219     See `User-definable snippets`_.
2221 XML/HTML tag auto-closing
2222     When you open an XML/HTML tag automatically generate its
2223     completion tag.
2225 Automatic continuation multi-line comments
2226     Continue automatically multi-line comments in languages like C, C++
2227     and Java when a new line is entered inside such a comment.
2228     With this option enabled, Geany will insert a ``*`` on every new line
2229     inside a multi-line comment, for example when you press return in the
2230     following C code::
2232      /*
2233       * This is a C multi-line comment, press <Return>
2235     then Geany would insert::
2237       *
2239     on the next line with the correct indentation based on the previous line,
2240     as long as the multi-line is not closed by ``*/``. If the previous line
2241     has no ``*`` prefix, no ``*`` will be added to the new line.
2243 Autocomplete symbols
2244     When you start to type a symbol name, look for the full string to
2245     allow it to be completed for you.
2247 Autocomplete all words in document
2248     When you start to type a word, Geany will search the whole document for
2249     words starting with the typed part to complete it, assuming there
2250     are no symbol names to show.
2252 Drop rest of word on completion
2253     Remove any word part to the right of the cursor when choosing a
2254     completion list item.
2256 Characters to type for autocompletion
2257     Number of characters of a word to type before autocompletion is
2258     displayed.
2260 Completion list height
2261     The number of rows to display for the autocompletion window.
2263 Max. symbol name suggestions
2264     The maximum number of items in the autocompletion list.
2266 Symbol list update frequency
2267     The minimum delay (in milliseconds) between two symbol list updates.
2269     This option determines how frequently the symbol list is updated for the
2270     current document. The smaller the delay, the more up-to-date the symbol
2271     list (and then the completions); but rebuilding the symbol list has a
2272     cost in performance, especially with large files.
2274     The default value is 250ms, which means the symbol list will be updated
2275     at most four times per second, even if the document changes continuously.
2277     A value of 0 disables automatic updates, so the symbol list will only be
2278     updated upon document saving.
2281 Auto-close quotes and brackets
2282 ``````````````````````````````
2284 Geany can automatically insert a closing bracket and quote characters when
2285 you open them. For instance, you type a ``(`` and Geany will automatically
2286 insert ``)``. With the following options, you can define for which
2287 characters this should work.
2289 Parenthesis ( )
2290     Auto-close parenthesis when typing an opening one
2292 Curly brackets { }
2293     Auto-close curly brackets (braces) when typing an opening one
2295 Square brackets [ ]
2296     Auto-close square brackets when typing an opening one
2298 Single quotes ' '
2299     Auto-close single quotes when typing an opening one
2301 Double quotes " "
2302     Auto-close double quotes when typing an opening one
2305 Editor Display preferences
2306 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2308 This is for visual elements displayed in the editor window.
2310 .. image:: ./images/pref_dialog_edit_display.png
2312 Display
2313 ```````
2315 Invert syntax highlighting colors
2316     Invert all colors, by default this makes white text on a black
2317     background.
2319 Show indendation guides
2320     Show vertical lines to help show how much leading indentation there
2321     is on each line.
2323 Show whitespaces
2324     Mark all tabs with an arrow "-->" symbol and spaces with dots to
2325     show which kinds of whitespace are used.
2327 Show line endings
2328     Display a symbol everywhere that a carriage return or line feed
2329     is present.
2331 Show only non-default line endings
2332     Shows line ending characters only when they differ from the
2333     file default line ending character.
2335 Show line numbers
2336     Show or hide the Line Number margin.
2338 Show markers margin
2339     Show or hide the small margin right of the line numbers, which is used
2340     to mark lines.
2342 Stop scrolling at last line
2343     When enabled Geany stops scrolling when at the last line of the document.
2344     Otherwise you can scroll one more page even if there are no real lines.
2346 Lines visible around the cursor
2347     The number of lines to maintain between the cursor and the top and bottom
2348     edges of the view. This allows some lines of context around the cursor to
2349     always be visible. If *Stop scrolling at last line* is disabled, the cursor
2350     will never reach the bottom edge when this value is greater than 0.
2353 Long line marker
2354 ````````````````
2356 The long line marker helps to indicate overly-long lines, or as a hint
2357 to the user for when to break the line.
2359 Type
2360     Line
2361         Show a thin vertical line in the editor window at the given column
2362         position.
2363     Background
2364         Change the background color of characters after the given column
2365         position to the color set below. (This is recommended over the
2366         *Line* setting if you use proportional fonts).
2367     Disabled
2368         Don't mark long lines at all.
2370 Long line marker
2371     Set this value to a value greater than zero to specify the column
2372     where it should appear.
2374 Long line marker color
2375     Set the color of the long line marker.
2378 Virtual spaces
2379 ``````````````
2381 Virtual space is space beyond the end of each line.
2382 The cursor may be moved into virtual space but no real space will be
2383 added to the document until there is some text typed or some other
2384 text insertion command is used.
2386 Disabled
2387     Do not show virtual spaces
2389 Only for rectangular selections
2390     Only show virtual spaces beyond the end of lines when drawing a rectangular selection
2392 Always
2393     Always show virtual spaces beyond the end of lines
2396 Files preferences
2397 ^^^^^^^^^^^^^^^^^
2399 .. image:: ./images/pref_dialog_files.png
2401 New files
2402 `````````
2404 Open new documents from the command-line
2405     Whether to create new documents when passing filenames that don't
2406     exist from the command-line.
2408 Default encoding (new files)
2409     The type of file encoding you wish to use when creating files.
2411 Used fixed encoding when opening files
2412     Assume all files you are opening are using the type of encoding specified below.
2414 Default encoding (existing files)
2415     Opens all files with the specified encoding instead of auto-detecting it.
2416     Use this option when it's not possible for Geany to detect the exact encoding.
2418 Default end of line characters
2419     The end of line characters to which should be used for new files.
2420     On Windows systems, you generally want to use CR/LF which are the common
2421     characters to mark line breaks.
2422     On Unix-like systems, LF is default and CR is used on MAC systems.
2424 Saving files
2425 ````````````
2426 Perform formatting operations when a document is saved. These
2427 can each be undone with the Undo command.
2429 Ensure newline at file end
2430     Add a newline at the end of the document if one is missing.
2432 Ensure consistent line endings
2433     Ensures that newline characters always get converted before
2434     saving, avoiding mixed line endings in the same file.
2436 .. _Strip trailing spaces:
2438 Strip trailing spaces
2439     Remove any whitespace at the end of each document line.
2441     .. note::
2442         This does not apply to Diff documents, e.g. patch files.
2444 Replace tabs with spaces
2445     Replace all tabs in the document with the equivalent number of spaces.
2447     .. note::
2448         It is better to use spaces to indent than use this preference - see
2449         `Indentation`_.
2451 Miscellaneous
2452 `````````````
2454 Recent files list length
2455     The number of files to remember in the recently used files list.
2457 Disk check timeout
2458     The number of seconds to periodically check the current document's
2459     file on disk in case it has changed. Setting it to 0 will disable
2460     this feature.
2462     .. note::
2463         These checks are only performed on local files. Remote files are
2464         not checked for changes due to performance issues
2465         (remote files are files in ``~/.gvfs/``).
2468 Tools preferences
2469 ^^^^^^^^^^^^^^^^^
2471 .. image:: ./images/pref_dialog_tools.png
2473 Tool paths
2474 ``````````
2476 Terminal
2477     The command to execute a script in a terminal.  Occurrences of %c
2478     in the command are substituted with the run script name, see
2479     `Terminal emulators`_.
2481 Browser
2482     The location of your web browser executable.
2484 Grep
2485     The location of the grep executable.
2487 .. note::
2488     For Windows users: at the time of writing it is recommended to use
2489     the grep.exe from the UnxUtils project
2490     (http://sourceforge.net/projects/unxutils). The grep.exe from the
2491     Mingw project for instance might not work with Geany at the moment.
2493 Commands
2494 ````````
2496 Context action
2497     Set this to a command to execute on the current word.
2498     You can use the "%s" wildcard to pass the current word below the cursor
2499     to the specified command.
2502 Template preferences
2503 ^^^^^^^^^^^^^^^^^^^^
2504 See `Templates`_.
2506 This data is used as meta data for various template text to insert into
2507 a document, such as the file header. You only need to set fields that
2508 you want to use in your template files.
2510 .. image:: ./images/pref_dialog_templ.png
2512 Template data
2513 `````````````
2514 See `Template meta data`_.
2516 Developer
2517     The name of the developer who will be creating files.
2519 Initials
2520     The initials of the developer.
2522 Mail address
2523     The email address of the developer.
2525     .. note::
2526         You may wish to add anti-spam markup, e.g. ``name<at>site<dot>ext``.
2528 Company
2529     The company the developer is working for.
2531 Initial version
2532     The initial version of files you will be creating.
2534 Year
2535     Specify a format for the ``{year}`` wildcard.
2537 Date
2538     Specify a format for the ``{date}`` wildcard.
2540 Date & Time
2541     Specify a format for the ``{datetime}`` wildcard.
2543 See `Date & time wildcards`_ for more information.
2546 Keybinding preferences
2547 ^^^^^^^^^^^^^^^^^^^^^^
2549 .. image:: ./images/pref_dialog_keys.png
2551 There are some commands listed in the keybinding dialog that are not, by default,
2552 bound to a key combination, and may not be available as a menu item.
2554 .. note::
2555     For more information see the section `Keybindings`_.
2558 Printing preferences
2559 ^^^^^^^^^^^^^^^^^^^^
2561 .. image:: ./images/pref_dialog_printing.png
2563 Use external command for printing
2564     Use a system command to print your file out.
2566 Use native GTK printing
2567     Let the GTK GUI toolkit handle your print request.
2569 Print line numbers
2570     Print the line numbers on the left of your paper.
2572 Print page number
2573     Print the page number on the bottom right of your paper.
2575 Print page header
2576     Print a header on every page that is sent to the printer.
2578 Use base name of the printed file
2579     Don't use the entire path for the header, only the filename.
2581 Date format
2582     How the date should be printed. For a list of available conversion
2583     specifiers see https://docs.gtk.org/glib/method.DateTime.format.html.
2586 Various preferences
2587 ^^^^^^^^^^^^^^^^^^^
2589 .. image:: ./images/pref_dialog_various.png
2591 Rarely used preferences, explained in the table below. A few of them require
2592 restart to take effect, and a few other will only affect newly opened or created
2593 documents before restart.
2595 ================================  ===========================================  ==========  ===========
2596 Key                               Description                                  Default     Applies
2597 ================================  ===========================================  ==========  ===========
2598 **``editor`` group**
2599 use_gtk_word_boundaries           Whether to look for the end of a word        true        to new
2600                                   when using word-boundary related                         documents
2601                                   Scintilla commands (see `Scintilla
2602                                   keyboard commands`_).
2603 brace_match_ltgt                  Whether to highlight <, > angle brackets.    false       immediately
2604 complete_snippets_whilst_editing  Whether to allow completion of snippets      false       immediately
2605                                   when editing an existing line (i.e. there
2606                                   is some text after the current cursor
2607                                   position on the line). Only used when the
2608                                   keybinding `Complete snippet` is set to
2609                                   ``Space``.
2610 show_editor_scrollbars            Whether to display scrollbars. If set to     true        immediately
2611                                   false, the horizontal and vertical
2612                                   scrollbars are hidden completely.
2613 indent_hard_tab_width             The size of a tab character. Don't change    8           immediately
2614                                   it unless you really need to; use the
2615                                   indentation settings instead.
2616 editor_ime_interaction            Input method editor (IME)'s candidate        0           to new
2617                                   window behaviour. May be 0 (windowed) or                 documents
2618                                   1 (inline)
2619 **``interface`` group**
2620 show_symbol_list_expanders        Whether to show or hide the small            true        to new
2621                                   expander icons on the symbol list                        documents
2622                                   treeview.
2623 compiler_tab_autoscroll           Whether to automatically scroll to the       true        immediately
2624                                   last line of the output in the Compiler
2625                                   tab.
2626 statusbar_template                The status bar statistics line format.       See below.  immediately
2627                                   (See `Statusbar Templates`_ for details).
2628 new_document_after_close          Whether to open a new document after all     false       immediately
2629                                   documents have been closed.
2630 msgwin_status_visible             Whether to show the Status tab in the        true        immediately
2631                                   Messages Window
2632 msgwin_compiler_visible           Whether to show the Compiler tab in the      true        immediately
2633                                   Messages Window
2634 msgwin_messages_visible           Whether to show the Messages tab in the      true        immediately
2635                                   Messages Window
2636 msgwin_scribble_visible           Whether to show the Scribble tab in the      true        immediately
2637                                   Messages Window
2638 warn_on_project_close             Whether to show a warning when opening       true        immediately
2639                                   a project while one is already open.
2640 **``terminal`` group**
2641 send_selection_unsafe             By default, Geany strips any trailing        false       immediately
2642                                   newline characters from the current
2643                                   selection before sending it to the terminal
2644                                   to not execute arbitrary code. This is
2645                                   mainly a security feature.
2646                                   If, for whatever reasons, you really want
2647                                   it to be executed directly, set this option
2648                                   to true.
2649 send_cmd_prefix                   String with which prefix the commands sent   Empty       immediately
2650                                   to the shell.  This may be used to tell
2651                                   some shells (BASH with ``HISTCONTROL`` set
2652                                   to ``ignorespace``, ZSH with
2653                                   ``HIST_IGNORE_SPACE`` enabled, etc.) from
2654                                   putting these commands in their history by
2655                                   setting this to a space.  Note that leading
2656                                   spaces must be escaped using `\s` in the
2657                                   configuration file.
2658 **``files`` group**
2659 allow_always_save                 Whether files can be saved always, even      false       immediately
2660                                   if they don't have any changes.
2661                                   By default, the Save button and menu
2662                                   item are disabled when a file is
2663                                   unchanged. When setting this option to
2664                                   true, the Save button and menu item are
2665                                   always active and files can be saved.
2666 use_atomic_file_saving            Defines the mode how Geany saves files to    false       immediately
2667                                   disk. If disabled, Geany directly writes
2668                                   the content of the document to disk. This
2669                                   might cause loss of data when there is
2670                                   no more free space on disk to save the
2671                                   file. When set to true, Geany first saves
2672                                   the contents into a temporary file and if
2673                                   this succeeded, the temporary file is
2674                                   moved to the real file to save.
2675                                   This gives better error checking in case of
2676                                   no more free disk space. But it also
2677                                   destroys hard links of the original file
2678                                   and its permissions (e.g. executable flags
2679                                   are reset). Use this with care as it can
2680                                   break things seriously.
2681                                   The better approach would be to ensure your
2682                                   disk won't run out of free space.
2683 use_gio_unsafe_file_saving        Whether to use GIO as the unsafe file        true        immediately
2684                                   saving backend. It is better on most
2685                                   situations but is known not to work
2686                                   correctly on some complex setups.
2687 gio_unsafe_save_backup            Make a backup when using GIO unsafe file     false       immediately
2688                                   saving. Backup is named `filename~`.
2689 keep_edit_history_on_reload       Whether to maintain the edit history when    true        immediately
2690                                   reloading a file, and allow the operation
2691                                   to be reverted.
2692 reload_clean_doc_on_file_change   Whether to automatically reload documents    false       immediately
2693                                   that have no changes but which have changed
2694                                   on disk.
2695                                   If unsaved changes exist then the user is
2696                                   prompted to reload manually.
2697 save_config_on_file_change        Automatically save Geany's configuration     true        immediately
2698                                   to disk once the document list changes
2699                                   (i.e. new documents are opened, saved or
2700                                   closed). This helps to prevent accidentally
2701                                   losing the session file list or other
2702                                   changed settings when Geany is not shut
2703                                   down cleanly. Disable this option if your
2704                                   configuration directory is on a slow drive,
2705                                   network share or similar and you experience
2706                                   problems.
2707 extract_filetype_regex            Regex to extract filetype name from file     See link    immediately
2708                                   via capture group one.
2709                                   See `ft_regex`_ for default.
2710 **``search`` group**
2711 find_selection_type               See `Find selection`_.                       0           immediately
2712 replace_and_find_by_default       Set ``Replace & Find`` button as default so  true        immediately
2713                                   it will be activated when the Enter key is
2714                                   pressed while one of the text fields has
2715                                   focus.
2716 **``build`` group**
2717 number_ft_menu_items              The maximum number of menu items in the      2           on restart
2718                                   filetype build section of the Build menu.
2719 number_non_ft_menu_items          The maximum number of menu items in the      3           on restart
2720                                   independent build section.
2721 number_exec_menu_items            The maximum number of menu items in the      2           on restart
2722                                   execute section of the Build menu.
2723 **``socket`` group**
2724 socket_remote_cmd_port            TCP port number to be used for inter         2           on restart
2725                                   process communication (i.e. with other
2726                                   Geany instances, e.g. "Open with Geany").
2727                                   Only available on Windows, valid port
2728                                   range: 1024 to 65535.
2729 ================================  ===========================================  ==========  ===========
2731 Statusbar Templates
2732 ```````````````````
2734 The default statusbar template is (note ``\t`` = tab):
2736 ``line: %l / %L\t col: %c\t sel: %s\t %w      %t      %mEOL: %M      encoding: %e      filetype: %f      scope: %S``
2738 Settings the preference to an empty string will also cause Geany to use this
2739 internal default.
2741 The following format characters are available for the statusbar template:
2743 ============  ===========================================================
2744 Placeholder   Description
2745 ============  ===========================================================
2746   ``%l``      The current line number starting at 1
2747   ``%L``      The total number of lines
2748   ``%c``      The current column number starting at 0, including virtual
2749               space.
2750   ``%C``      The current column number starting at 1, including virtual
2751               space.
2752   ``%s``      The number of selected characters or if only whole lines
2753               selected, the number of selected lines.
2754   ``%n``      The number of selected characters, even if only whole lines
2755               are selected.
2756   ``%w``      Shows ``RO`` when the document is in read-only mode,
2757               otherwise shows whether the editor is in overtype (OVR)
2758               or insert (INS) mode.
2759   ``%t``      Shows the indentation mode, either tabs (TAB),
2760               spaces (SP) or both (T/S).
2761   ``%m``      Shows whether the document is modified (MOD) or nothing.
2762   ``%M``      The name of the document's line-endings (ex. ``Unix (LF)``)
2763   ``%e``      The name of the document's encoding (ex. UTF-8).
2764   ``%f``      The filetype of the document (ex. None, Python, C, etc).
2765   ``%S``      The name of the scope where the caret is located.
2766   ``%p``      The caret position in the entire document starting at 0.
2767   ``%r``      Shows whether the document is read-only (RO) or nothing.
2768   ``%Y``      The Scintilla style number at the caret position. This is
2769               useful if you're debugging color schemes or related code.
2770 ============  ===========================================================
2772 Terminal (VTE) preferences
2773 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2775 See also: `Virtual terminal emulator widget (VTE)`_.
2777 .. image:: ./images/pref_dialog_vte.png
2779 Terminal widget
2780 ```````````````
2782 Terminal font
2783     Select the font that will be used in the terminal emulation control.
2785 Foreground color
2786     Select the font color.
2788 Background color
2789     Select the background color of the terminal.
2791 Background image
2792     Select the background image to show behind the terminal's text.
2794 Scrollback lines
2795     The number of lines buffered so that you can scroll though the history.
2797 Shell
2798     The location of the shell on your system.
2800 Scroll on keystroke
2801     Scroll the terminal to the prompt line when pressing a key.
2803 Scroll on output
2804     Scroll the output down.
2806 Cursor blinks
2807     Let the terminal cursor blink.
2809 Override Geany keybindings
2810     Allow the VTE to receive keyboard shortcuts (apart from focus commands).
2812 Disable menu shortcut key (F10 by default)
2813     Disable the menu shortcut when you are in the virtual terminal.
2815 Follow path of the current file
2816     Make the path of the terminal change according to the path of the
2817     current file.
2819 Execute programs in VTE
2820     Execute programs in the virtual terminal instead of using the external
2821     terminal tool.  Note that if you run multiple execute commands at once
2822     the output may become mixed together in the VTE.
2824 Don't use run script
2825     Don't use the simple run script which is usually used to display
2826     the exit status of the executed program.
2827     This can be useful if you already have a program running in the VTE
2828     like a Python console (e.g. ipython). Use this with care.
2831 Project management
2832 ------------------
2834 Project management is optional in Geany. Currently it can be used for:
2836 * Storing and opening session files on a project basis.
2837 * Overriding default settings with project equivalents.
2838 * Configuring the Build menu on a project basis.
2840 A list of session files can be stored and opened with the project
2841 when the *Use project-based session files* preference is enabled,
2842 in the `Projects`_ group of the `General Miscellaneous preferences`_ tab
2843 of the `Preferences`_ dialog.
2845 As long as a project is open, the Build menu will use
2846 the items defined in project's settings, instead of the defaults.
2847 See `Build Menu Configuration`_ for information on configuring the menu.
2849 The current project's settings are saved when it is closed, or when
2850 Geany is shutdown. When restarting Geany, the previously opened project
2851 file that was in use at the end of the last session will be reopened.
2853 The project menu items are detailed below.
2856 New project
2857 ^^^^^^^^^^^
2859 There are two ways of creating new projects, either by using
2860 *Project->New* menu item or by using *Project->New from Folder* menu
2861 item.
2864     This method is more suitable for creating new, empty projects from
2865     scratch at the default location without having any existing sources.
2867     To create a new project, fill in the *Name* field. By default this
2868     will setup a new project file ``~/projects/name/name.geany``.
2870     The *Base path* text field is setup to use ``~/projects/name``. This
2871     can safely be set to any existing path -- it will not touch the file
2872     structure contained in it.
2874 New from Folder
2875     This method is more suitable when there is already some folder
2876     containing source files for which you want to create a new project.
2878     When using this method, Geany first opens a directory selection
2879     dialog to select the folder containing the sources, and the
2880     *Base path* field is set to that value.
2882     Afterwards, Geany shows the same dialog as the *Project->New*
2883     method but already pre-filled with the values based on the
2884     *Base path* selection. The *Name* field is filled with the folder
2885     name, the *Filename* field is filled with
2886     ``base_path/name.geany`` and the *Base path* field is filled with
2887     the path specified in the previous dialog.
2890 Project properties
2891 ^^^^^^^^^^^^^^^^^^
2893 You can set an optional description for the project. Currently it's
2894 only used for the ``{description}}`` template wildcard - see `Dynamic wildcards`_.
2896 The *Base path* field is used as the directory to run the Build menu commands.
2897 The specified path can be an absolute path or it is considered to be
2898 relative to the project's file name.
2900 The *File patterns* field allows to specify a list of file patterns for the
2901 project, which can be used in the `Find in files`_ dialog.
2903 The *Indentation* tab allows you to override the default
2904 `Indentation`_ settings.
2907 Open project
2908 ^^^^^^^^^^^^
2910 The Open command displays a standard file chooser, starting in
2911 ``~/projects``. Choose a project file named with the ``.geany``
2912 extension.
2914 When project session support is enabled, Geany will close the currently
2915 open files and open the session files associated with the project.
2918 Close project
2919 ^^^^^^^^^^^^^
2921 Project file settings are saved when the project is closed.
2923 When project session support is enabled, Geany will close the project
2924 session files and open any previously closed default session files.
2927 Build menu
2928 ----------
2929 After editing code with Geany, the next step is to compile, link, build,
2930 interpret, run etc.  As Geany supports many languages each with a different
2931 approach to such operations, and as there are also many language independent
2932 software building systems, Geany does not have a built-in build system, nor
2933 does it limit which system you can use.  Instead the build menu provides
2934 a configurable and flexible means of running any external commands to
2935 execute your preferred build system.
2937 This section provides a description of the default configuration of the
2938 build menu and then covers how to configure it, and where the defaults fit in.
2940 Running the commands from within Geany has two benefits:
2942 * The current file is automatically saved before the command is run.
2943 * The output is captured in the Compiler notebook tab and parsed for
2944   warnings or errors.
2946 Warnings and errors that can be parsed for line numbers will be shown in
2947 red in the Compiler tab and you can click on them to switch to the relevant
2948 source file (or open it) and mark the line number.  Also lines with
2949 warnings or errors are marked in the source, see `Indicators`_ below.
2951 .. tip::
2952     If Geany's default error message parsing does not parse errors for
2953     the tool you're using, you can set a custom regex in the
2954     `Set Build Commands dialog`_, see `Build Menu Configuration`_.
2956 Indicators
2957 ^^^^^^^^^^
2959 Indicators are red squiggly underlines which are used to highlight
2960 errors which occurred while compiling the current file. So you can
2961 easily see where your code failed to compile. You can remove them by
2962 selecting *Remove Error Indicators* in the Document menu.
2964 If you do not like this feature, you can disable it - see `Editor Features
2965 preferences`_.
2968 Default build menu items
2969 ^^^^^^^^^^^^^^^^^^^^^^^^
2970 Depending on the current file's filetype, the default Build menu will contain
2971 the following items:
2973 * Compile
2974 * Build
2975 * Lint
2976 * Make All
2977 * Make Custom Target
2978 * Make Object
2979 * Next Error
2980 * Previous Error
2981 * Execute
2982 * Set Build Menu Commands
2985 Compile
2986 ```````
2988 The Compile command has different uses for different kinds of files.
2990 For compilable languages such as C and C++, the Compile command is
2991 set up to compile the current source file into a binary object file.
2993 Java source files will be compiled to class file bytecode.
2995 Interpreted languages such as Perl, Python, Ruby will compile to
2996 bytecode if the language supports it, or will run a syntax check,
2997 or if that is not available will run the file in its language interpreter.
2999 Build
3000 `````
3002 For compilable languages such as C and C++, the Build command will link
3003 the current source file's equivalent object file into an executable. If
3004 the object file does not exist, the source will be compiled and linked
3005 in one step, producing just the executable binary.
3007 Interpreted languages do not use the Build command.
3009 .. note::
3010     If you need complex settings for your build system, or several
3011     different settings, then writing a Makefile and using the Make
3012     commands is recommended; this will also make it easier for users to
3013     build your software.
3015 Lint
3016 ````
3018 Source code linters are often used to find code that doesn't correspond to
3019 certain style guidelines: non-portable code, common or hard to find
3020 errors, code "smells", variables used before being set, unused functions,
3021 division by zero, constant conditions, etc. Linters inspect the code and
3022 issue warnings much like the compilers do. This is formally referred to as
3023 static code analysis.
3025 Some common linters are pre-configured for you in the Build menu (``pep8``
3026 for Python, ``cppcheck`` for C/C++, JSHint for JavaScript, ``xmllint`` for
3027 XML, ``hlint`` for Haskell, ``shellcheck`` for shell code, ...), but all
3028 these are standalone tools you need to obtain before using.
3030 Make
3031 ````
3033 This runs "make" in the same directory as the
3034 current file.
3036 Make custom target
3037 ``````````````````
3039 This is similar to running 'Make' but you will be prompted for
3040 the make target name to be passed to the Make tool. For example,
3041 typing 'clean' in the dialog prompt will run "make clean".
3044 Make object
3045 ```````````
3047 Make object will run "make current_file.o" in the same directory as
3048 the current file, using the filename for 'current_file'. It is useful
3049 for building just the current file without building the whole project.
3051 Next error
3052 ``````````
3054 The next error item will move to the next detected error in the file.
3056 Previous error
3057 ``````````````
3058 The previous error item will move to the previous detected error in the file.
3060 Execute
3061 ```````
3063 Execute will run the corresponding executable file, shell script or
3064 interpreted script in a terminal window. The command set in the
3065 `Set Build Commands dialog`_ is run in a script to ensure the terminal
3066 stays open after execution completes.  Note: see `Terminal emulators`_
3067 below for the command format.  Alternatively the built-in VTE can be used
3068 if it is available - see `Virtual terminal emulator widget (VTE)`_.
3070 After your program or script has finished executing, the run script will
3071 prompt you to press the return key. This allows you to review any text
3072 output from the program before the terminal window is closed.
3074 .. note::
3075     The execute command output is not parsed for errors.
3078 Stopping running processes
3079 ``````````````````````````
3081 When there is a running program, the Execute menu item in the menu and
3082 the Run button in the toolbar
3083 each become a stop button so you can stop the current running program (and
3084 any child processes). This works by sending the SIGQUIT signal to the process.
3086 Depending on the process you started it is possible that the process
3087 cannot be stopped. For example this can happen when the process creates
3088 more than one child process.
3091 Terminal emulators
3092 ******************
3094 The Terminal field of the tools preferences tab requires a command to
3095 execute the terminal program and to pass it the name of the Geany run
3096 script that it should execute in a Bourne compatible shell (eg /bin/sh).
3097 The marker "%c" is substituted with the name of the Geany run script,
3098 which is created in the temporary directory and which changes the working
3099 directory to the directory set in the `Set Build Commands dialog`_.
3101 As an example the default (Linux) command is::
3103     xterm -e "/bin/sh %c"
3106 Set build commands
3107 ``````````````````
3109 By default Compile, Build and Execute are fairly basic commands. You
3110 may wish to customise them using *Set Build Commands*.
3112 E.g. for C you can add any include paths and compile flags for the
3113 compiler, any library names and paths for the linker, and any
3114 arguments you want to use when running Execute.
3116 Build menu configuration
3117 ^^^^^^^^^^^^^^^^^^^^^^^^
3119 The build menu has considerable flexibility and configurability, allowing
3120 menu labels, the commands they execute and the directory they execute
3121 in to be configured. For example, if you change one of the default make 
3122 commands to run say 'waf' you can also change the label to match.
3123 These settings are saved automatically when Geany is shut down.
3125 The build menu is divided into four groups of items each with different
3126 behaviors:
3128 * Filetype build commands - are configurable and depend on the filetype of the
3129   current document; they capture output in the compiler tab and parse it for
3130   errors.
3131 * Independent build commands - are configurable and mostly don't depend on the
3132   filetype of the current document; they also capture output in the
3133   compiler tab and parse it for errors.
3134 * Execute commands - are configurable and intended for executing your
3135   program or other long running programs.  The output is not parsed for 
3136   errors and is directed to the terminal command selected in `Tools 
3137   preferences`_.
3138 * Fixed commands - these perform built-in actions:
3140   * Go to the next error.
3141   * Go to the previous error.
3142   * Show the build menu commands dialog.
3144 The maximum numbers of items in each of the configurable groups can be
3145 configured in `Various preferences`_. Even though the maximum number of
3146 items may have been increased, only those menu items that have commands
3147 configured are shown in the menu.
3149 The groups of menu items obtain their configuration from four potential
3150 sources.  The highest priority source that has the menu item defined will
3151 be used. The sources in decreasing priority are:
3153 * A project file if open
3154 * The user preferences
3155 * The system filetype definitions
3156 * The defaults
3158 The detailed relationships between sources and the configurable menu item groups
3159 is shown in the following table:
3161 +--------------+---------------------+--------------------------+-------------------+-------------------------------+
3162 | Group        | Project File        | Preferences              | System Filetype   |  Defaults                     |
3163 +==============+=====================+==========================+===================+===============================+
3164 | Filetype     | Loads From: project | Loads From:              | Loads From:       | None                          |
3165 | Build        | file                | filetypes.xxx file in    | filetypes.xxx in  |                               |
3166 |              |                     | ~/.config/geany/filedefs | Geany install     |                               |
3167 |              | Saves To: project   |                          |                   |                               |
3168 |              | file                | Saves to: as above,      | Saves to: as user |                               |
3169 |              |                     | creating if needed.      | preferences left. |                               |
3170 +--------------+---------------------+--------------------------+-------------------+-------------------------------+
3171 | Independent  | Loads From: project | Loads From:              | Loads From:       | 1:                            |
3172 | Build        | file                | geany.conf file in       | filetypes.xxx in  |   Label: _Make                |
3173 |              |                     | ~/.config/geany          | Geany install     |   Command: make               |
3174 |              | Saves To: project   |                          |                   |                               |
3175 |              | file                | Saves to: as above,      | Saves to: as user | 2:                            |
3176 |              |                     | creating if needed.      | preferences left. |    Label: Make Custom _Target |
3177 |              |                     |                          |                   |    Command: make              |
3178 |              |                     |                          |                   |                               |
3179 |              |                     |                          |                   | 3:                            |
3180 |              |                     |                          |                   |    Label: Make _Object        |
3181 |              |                     |                          |                   |    Command: make %e.o         |
3182 +--------------+---------------------+--------------------------+-------------------+-------------------------------+
3183 | Execute      | Loads From: project | Loads From:              | Loads From:       | Label: _Execute               |
3184 |              | file or else        | geany.conf file in       | filetypes.xxx in  | Command: ./%e                 |
3185 |              | filetype defined in | ~/.config/geany or else  | Geany install     |                               |
3186 |              | project file        | filetypes.xxx file in    |                   |                               |
3187 |              |                     | ~/.config/geany/filedefs | Saves To: as user |                               |
3188 |              | Saves To:           |                          | preferences left. |                               |
3189 |              | project file        | Saves To:                |                   |                               |
3190 |              |                     | filetypes.xxx file in    |                   |                               |
3191 |              |                     | ~/.config/geany/filedefs |                   |                               |
3192 +--------------+---------------------+--------------------------+-------------------+-------------------------------+
3194 The following notes on the table may reference cells by coordinate as *(group, source)*:
3196 * Filetype filenames - for filetypes.xxx substitute the appropriate extension for
3197   the filetype of the current document for xxx - see `filenames`_.
3199 * System Filetypes - Labels loaded from these sources are locale sensitive
3200   and can contain translations.
3202 * *(Filetype build, Project and Preferences)* - preferences use a full
3203   filetype file so that users can configure all other filetype preferences
3204   as well.  Projects can only configure menu items per filetype.  Saving
3205   in the project file means that there is only one file per project not
3206   a whole directory.
3208 * *(Filetype-Independent build, System Filetype)* - although conceptually strange, defining
3209   filetype-independent commands in a filetype file, this provides the ability to
3210   define filetype dependent default menu items.
3212 * *(Execute, Project and Preferences)* - the project independent
3213   execute and preferences independent execute commands can only be set by hand
3214   editing the appropriate file, see `Preferences file format`_ and `Project file
3215   format`_.
3217 Set Build Commands dialog
3218 ^^^^^^^^^^^^^^^^^^^^^^^^^
3220 Most of the configuration of the build menu is done through the `Set 
3221 Build Commands dialog`_. When no project is open, you can edit the 
3222 configuration sourced from user preferences using the *Build->Set Build 
3223 Commands* menu item. You can edit the configuration sourced from a 
3224 project in the *Build* tab of the `Project Properties`_ dialog. The 
3225 former menu item also shows the project dialog when a project is open. 
3226 Both use the same form shown below.
3228 .. image:: ./images/build_menu_commands_dialog.png
3230 The dialog is divided into three sections:
3232 * Filetype build commands (selected based on the current document's filetype).
3233 * Independent build commands (available regardless of filetype).
3234 * Filetype execute commands.
3236 The filetype and independent build sections also each contain a field for the regular
3237 expression used for parsing command output for error and warning messages.
3239 The columns in the first three sections allow setting of the label, command,
3240 and working directory to run the command in. An item with an empty 
3241 label will not be shown in the menu. An empty working directory will 
3242 default to the directory of the current document.
3244 If there is no current document then the command will not run.
3246 The dialog will always show the command selected by priority, not just the
3247 commands configured in this configuration source. This ensures that you always
3248 see what the menu item is going to do if activated.
3250 If the current source of the menu item is higher priority than the
3251 configuration source you are editing then the command will be shown
3252 in the dialog but will be insensitive (greyed out).  This can't happen
3253 with the project source but can with the preferences source dialog.
3255 The clear buttons remove the definition from the configuration source you are editing.
3256 When you do this the command from the next lower priority source will be shown.
3257 To hide lower priority menu items without having anything show in the menu,
3258 configure with nothing in the label but at least one character in the command.
3260 Substitutions in commands and working directories
3261 `````````````````````````````````````````````````
3263 Before the command is run, the first occurrence of each of the following 
3264 two character sequences in each of the command and working directory 
3265 fields is substituted by the items specified below:
3267 * %d - the absolute path to the directory of the current file.
3268 * %e - the name of the current file without the extension or path.
3269 * %f - the name of the current file without the path.
3270 * %p - if a project is open, the base path from the project.
3271 * %l - the line number at the current cursor position.
3273 .. note::
3274    If the base path set in `Project Properties`_ is not an absolute path, then it is
3275    taken as relative to the directory of the project file.  This allows a project file
3276    stored in the source tree to specify all commands and working directories relative
3277    to the tree itself, so that the whole tree including the project file, can be moved
3278    and even checked into and out of version control without having to re-configure the
3279    build menu.
3281 Build menu keyboard shortcuts
3282 `````````````````````````````
3284 Keyboard shortcuts can be defined for:
3286 * the first two filetype build menu items
3287 * the first three independent build menu items
3288 * the first execute menu item 
3289 * the fixed menu items (Next/Previous Error, Set Commands)
3291 In the keybindings configuration dialog (see `Keybinding preferences`_)
3292 these items are identified by the default labels shown in the `Build Menu`_ section above.
3294 It is currently not possible to bind keyboard shortcuts to more than these menu items.
3295 You can also use underlines in the labels to set mnemonic characters.
3297 Old settings
3298 ````````````
3299 The configurable Build Menu capability was introduced in Geany 0.19 and
3300 required a new section to be added to the configuration files (See
3301 `Preferences file format`_).  Geany will still load older format project,
3302 preferences and filetype file settings and will attempt to map them into the new
3303 configuration format.  There is not a simple clean mapping between the formats.
3304 The mapping used produces the most sensible results for the majority of cases.
3305 However, if they do not map the way you want, you may have to manually
3306 configure some settings using the `Set Build Commands dialog`_.
3308 Any setting configured in either of these dialogs will override settings mapped from
3309 older format configuration files.
3311 Printing support
3312 ----------------
3314 Since Geany 0.13 there has been printing support using GTK's printing API.
3315 The printed page(s) will look nearly the same as on your screen in Geany.
3316 Additionally, there are some options to modify the printed page(s).
3318 .. note::
3319     The background text color is set to white, except for text with
3320     a white foreground. This allows dark color schemes to save ink
3321     when printing.
3323 You can define whether to print line numbers, page numbers at the bottom of
3324 each page and whether to print a page header on each page. This header
3325 contains the filename of the printed document, the current page number and
3326 the date and time of printing. By default, the file name of the document
3327 with full path information is added to the header. If you prefer to add
3328 only the basename of the file(without any path information) you can set it
3329 in the preferences dialog. You can also adjust the format of the date and
3330 time added to the page header. For a list of available conversion
3331 specifiers see https://docs.gtk.org/glib/method.DateTime.format.html.
3333 All of these settings can also be changed in the print dialog just before
3334 actual printing is done.
3335 On Unix-like systems the provided print dialog offers a print preview. The
3336 preview file is opened with a PDF viewer and by default GTK uses ``evince``
3337 for print preview. If you have not installed evince or just want to use
3338 another PDF viewer, you can change the program to use in the file
3339 ``settings.ini`` (usually found in ``~/.config/gtk-3.0``, see the
3340 `GTK documentation`_). For example, use::
3342     [Settings]
3343     gtk-print-preview-command = epdfview %f
3345 Of course, you can also use xpdf, kpdf or whatever as the print preview
3346 command.  That command should ideally delete the temporary file referenced by
3347 ``%f``.  See the `GTK documentation for the setting`_ for more details.
3349 .. _GTK documentation: https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings.description
3350 .. _GTK documentation for the setting: https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-print-preview-command
3353 Geany also provides an alternative basic printing support using a custom
3354 print command. However, the printed document contains no syntax highlighting.
3355 You can adjust the command to which the filename is passed in the preferences
3356 dialog. The default command is::
3358     % lpr %f
3360 ``%f`` will be substituted by the filename of the current file. Geany
3361 will not show errors from the command itself, so you should make
3362 sure that it works before(e.g. by trying to execute it from the
3363 command line).
3365 A nicer example, which many prefer is::
3367     % a2ps -1 --medium=A4 -o - %f | xfprint4
3369 But this depends on a2ps and xfprint4. As a replacement for xfprint4,
3370 gtklp or similar programs can be used.
3374 Plugins
3375 -------
3377 Plugins are loaded at startup, if the *Enable plugin support*
3378 general preference is set. There is also a command-line option,
3379 ``-p``, which prevents plugins being loaded. Plugins are scanned in
3380 the following directories:
3382 * ``$prefix/lib/geany`` on Unix-like systems (see `Installation prefix`_)
3383 * The ``lib`` subfolder of the installation path on Windows.
3384 * The ``plugins`` subfolder of the user configuration directory - see
3385   `Configuration file paths`_.
3386 * The `Extra plugin path` preference (usually blank) - see `Paths`_.
3388 Most plugins add menu items to the *Tools* menu when they are loaded.
3390 See also `Plugin documentation`_ for information about single plugins
3391 which are included in Geany.
3393 Plugin manager
3394 ^^^^^^^^^^^^^^
3395 The Plugin Manager dialog lets you choose which plugins
3396 should be loaded at startup. You can also load and unload plugins on the
3397 fly using this dialog. Once you click the checkbox for a specific plugin
3398 in the dialog, it is loaded or unloaded according to its previous state.
3399 By default, no plugins are loaded at startup until you select some.
3400 You can also configure some plugin specific options if the plugin
3401 provides any.
3404 Keybindings
3405 -----------
3407 Geany supports the default keyboard shortcuts for the Scintilla
3408 editing widget. For a list of these commands, see `Scintilla
3409 keyboard commands`_. The Scintilla keyboard shortcuts will be overridden
3410 by any custom keybindings with the same keyboard shortcut.
3413 Switching documents
3414 ^^^^^^^^^^^^^^^^^^^
3416 There are some non-configurable bindings to switch between documents,
3417 listed below. These can also be overridden by custom keybindings.
3419 =============== ==================================
3420 Key             Action
3421 =============== ==================================
3422 Alt-[1-9]       Select left-most tab, from 1 to 9.
3423 Alt-0           Select right-most tab.
3424 =============== ==================================
3426 See also `Notebook tab keybindings`_.
3429 Configurable keybindings
3430 ^^^^^^^^^^^^^^^^^^^^^^^^
3432 For all actions listed below you can define your own keybindings. Open
3433 the Preferences dialog, select the desired action and click on
3434 change. In the resulting dialog you can press the key combination you
3435 want to assign to the action and it will be saved when you press OK.
3436 You can define only one key combination for each action and each key
3437 combination can only be defined for one action.
3439 The following tables list all customizable keyboard shortcuts, those
3440 which are common to many applications are marked with (C) after the
3441 shortcut.
3443 File keybindings
3444 ````````````````
3445 =============================== ========================= ==================================================
3446 Action                          Default shortcut          Description
3447 =============================== ========================= ==================================================
3448 New                             Ctrl-N  (C)               Creates a new file.
3450 Open                            Ctrl-O  (C)               Opens a file.
3452 Open selected file              Ctrl-Shift-O              Opens the selected filename.
3454 Re-open last closed tab                                   Re-opens the last closed document tab.
3456 Save                            Ctrl-S  (C)               Saves the current file.
3458 Save As                                                   Saves the current file under a new name.
3460 Save all                        Ctrl-Shift-S              Saves all open files.
3462 Close all                       Ctrl-Shift-W              Closes all open files.
3464 Close                           Ctrl-W  (C)               Closes the current file.
3466 Reload file                     Ctrl-R  (C)               Reloads the current file.
3468 Reload all                                                Reloads all open files. If the reload will not be 'undo'-able and changes that will be lost are detected (unsaved or saved) the reload will be confirmed, otherwise the reload will proceed without confirmation.
3470 Print                           Ctrl-P  (C)               Prints the current file.
3472 Quit                            Ctrl-Q  (C)               Quits Geany.
3473 =============================== ========================= ==================================================
3476 Editor keybindings
3477 ``````````````````
3478 =============================== ========================= ==================================================
3479 Action                          Default shortcut          Description
3480 =============================== ========================= ==================================================
3481 Undo                            Ctrl-Z  (C)               Un-does the last action.
3483 Redo                            Ctrl-Y                    Re-does the last action.
3485 Delete current line(s)          Ctrl-K                    Deletes the current line (and any lines with a
3486                                                           selection).
3488 Delete to line end              Ctrl-Shift-Delete         Deletes from the current caret position to the
3489                                                           end of the current line.
3491 Delete to line start            Ctrl-Shift-BackSpace      Deletes from the beginning of the line to the
3492                                                           current caret position.
3494 Duplicate line or selection     Ctrl-D                    Duplicates the current line or selection.
3496 Transpose current line                                    Transposes the current line with the previous one.
3498 Scroll to current line          Ctrl-Shift-L              Scrolls the current line into the centre of the
3499                                                           view. The cursor position and or an existing
3500                                                           selection will not be changed.
3502 Scroll up by one line           Alt-Up                    Scrolls the view.
3504 Scroll down by one line         Alt-Down                  Scrolls the view.
3506 Complete word                   Ctrl-Space                Shows the autocompletion list. If already showing
3507                                                           symbol completion, it shows document word completion
3508                                                           instead, even if it is not enabled for automatic
3509                                                           completion. Likewise if no symbol suggestions are
3510                                                           available, it shows document word completion.
3512 Show calltip                    Ctrl-Shift-Space          Shows a calltip for the current function or
3513                                                           method.
3515 Complete snippet                Tab                       If you type a keyword like ``if`` or ``for`` and press
3516                                                           this key, it will be completed with a matching
3517                                                           template - see `User-definable snippets`_.
3519 Suppress snippet completion                               If you type a construct like ``if`` or ``for`` and press
3520                                                           this key, it will not be completed, and a space or
3521                                                           tab will be inserted, depending on what the
3522                                                           construct completion keybinding is set to. For
3523                                                           example, if you have set the construct completion
3524                                                           keybinding to a space, then setting this to
3525                                                           Shift+space will prevent construct completion and
3526                                                           insert a space.
3528 Context Action                                            Executes a command and passes the current word
3529                                                           (near the cursor position) or selection as an
3530                                                           argument. See the section called `Context
3531                                                           actions`_.
3533 Move cursor in snippet                                    Jumps to the next defined cursor positions in a
3534                                                           completed snippets if multiple cursor positions
3535                                                           where defined.
3537 Word part completion            Tab                       When the autocompletion list is visible, complete
3538                                                           the currently selected item up to the next word
3539                                                           part.
3541 Move line(s) up                 Alt-PageUp                Move the current line or selected lines up by
3542                                                           one line.
3544 Move line(s) down               Alt-PageDown              Move the current line or selected lines down by
3545                                                           one line.
3546 =============================== ========================= ==================================================
3549 Clipboard keybindings
3550 `````````````````````
3551 =============================== ========================= ==================================================
3552 Action                          Default shortcut          Description
3553 =============================== ========================= ==================================================
3554 Cut                             Ctrl-X  (C)               Cut the current selection to the clipboard.
3556 Copy                            Ctrl-C  (C)               Copy the current selection to the clipboard.
3558 Paste                           Ctrl-V  (C)               Paste the clipboard text into the current document.
3560 Cut current line(s)             Ctrl-Shift-X              Cuts the current line (and any lines with a
3561                                                           selection) to the clipboard.
3563 Copy current line(s)            Ctrl-Shift-C              Copies the current line (and any lines with a
3564                                                           selection) to the clipboard.
3565 =============================== ========================= ==================================================
3568 Select keybindings
3569 ``````````````````
3570 =============================== ========================= ==================================================
3571 Action                          Default shortcut          Description
3572 =============================== ========================= ==================================================
3573 Select all                      Ctrl-A  (C)               Makes a selection of all text in the current
3574                                                           document.
3576 Select current word             Alt-Shift-W               Selects the current word under the cursor.
3578 Select current paragraph        Alt-Shift-P               Selects the current paragraph under the cursor
3579                                                           which is defined by two empty lines around it.
3581 Select current line(s)          Alt-Shift-L               Selects the current line under the cursor (and any
3582                                                           partially selected lines).
3584 Select to previous word part                              (Extend) selection to previous word part boundary.
3586 Select to next word part                                  (Extend) selection to next word part boundary.
3587 =============================== ========================= ==================================================
3590 Insert keybindings
3591 ``````````````````
3592 =============================== ========================= ==================================================
3593 Action                          Default shortcut          Description
3594 =============================== ========================= ==================================================
3595 Insert date                     Shift-Alt-D               Inserts a customisable date.
3597 Insert alternative whitespace                             Inserts a tab character when spaces should
3598                                                           be used for indentation and inserts space
3599                                                           characters of the amount of a tab width when
3600                                                           tabs should be used for indentation.
3602 Insert New Line Before Current                            Inserts a new line with indentation.
3604 Insert New Line After Current                             Inserts a new line with indentation.
3605 =============================== ========================= ==================================================
3608 Format keybindings
3609 ``````````````````
3610 =============================== ========================= ==================================================
3611 Action                          Default shortcut          Description
3612 =============================== ========================= ==================================================
3613 Toggle case of selection        Ctrl-Alt-U                Changes the case of the selection. A lowercase
3614                                                           selection will be changed into uppercase and vice
3615                                                           versa. If the selection contains lower- and
3616                                                           uppercase characters, all will be converted to
3617                                                           lowercase.
3619 Comment line                                              Comments current line or selection.
3621 Uncomment line                                            Uncomments current line or selection.
3623 Toggle line commentation        Ctrl-E                    Comments a line if it is not commented or removes
3624                                                           a comment if the line is commented.
3626 Increase indent                 Ctrl-I                    Indents the current line or selection by one tab
3627                                                           or with spaces in the amount of the tab width
3628                                                           setting.
3630 Decrease indent                 Ctrl-U                    Removes one tab or the amount of spaces of
3631                                                           the tab width setting from the indentation of the
3632                                                           current line or selection.
3634 Increase indent by one space                              Indents the current line or selection by one
3635                                                           space.
3637 Decrease indent by one space                              Deindents the current line or selection by one
3638                                                           space.
3640 Smart line indent                                         Indents the current line or all selected lines
3641                                                           with the same indentation as the previous line.
3643 Send to Custom Command 1 (2,3)  Ctrl-1 (2,3)              Passes the current selection to a configured
3644                                                           external command (available for the first
3645                                                           9 configured commands, see
3646                                                           `Sending text through custom commands`_ for
3647                                                           details).
3649 Send Selection to Terminal                                Sends the current selection or the current
3650                                                           line (if there is no selection) to the
3651                                                           embedded Terminal (VTE).
3653 Reflow lines/block                                        Reformat selected lines or current
3654                                                           (indented) text block,
3655                                                           breaking lines at the long line marker or the
3656                                                           line breaking column if line breaking is
3657                                                           enabled for the current document.
3659 Join Lines                                                Replace line endings and following indentation
3660                                                           with a single space throughout the selection
3661                                                           or current (indented) text block.
3662 =============================== ========================= ==================================================
3665 Settings keybindings
3666 ````````````````````
3667 =============================== ========================= ==================================================
3668 Action                          Default shortcut          Description
3669 =============================== ========================= ==================================================
3670 Preferences                     Ctrl-Alt-P                Opens preferences dialog.
3672 Plugin Preferences                                        Opens plugin preferences dialog.
3673 =============================== ========================= ==================================================
3676 Search keybindings
3677 ``````````````````
3678 =============================== ========================= ==================================================
3679 Action                          Default shortcut          Description
3680 =============================== ========================= ==================================================
3681 Find                            Ctrl-F  (C)               Opens the Find dialog.
3683 Find Next                       Ctrl-G                    Finds next result.
3685 Find Previous                   Ctrl-Shift-G              Finds previous result.
3687 Find Next Selection                                       Finds next occurrence of selected text.
3689 Find Previous Selection                                   Finds previous occurrence of selected text.
3691 Replace                         Ctrl-H  (C)               Opens the Replace dialog.
3693 Find in files                   Ctrl-Shift-F              Opens the Find in files dialog.
3695 Next message                                              Jumps to the line with the next message in
3696                                                           the Messages window.
3698 Previous message                                          Jumps to the line with the previous message
3699                                                           in the Messages window.
3701 Find Usage                      Ctrl-Shift-E              Finds all occurrences of the current word
3702                                                           or selection (see note below) in all open
3703                                                           documents and displays them in the messages
3704                                                           window.
3706 Find Document Usage             Ctrl-Shift-D              Finds all occurrences of the current word
3707                                                           or selection (see note below) in the current
3708                                                           document and displays them in the messages
3709                                                           window.
3711 Mark All                        Ctrl-Shift-M              Highlight all matches of the current
3712                                                           word/selection (see note below) in the current
3713                                                           document with a colored box. If there's nothing
3714                                                           to find, or the cursor is next to an existing
3715                                                           match, the highlighted matches will be cleared.
3716 =============================== ========================= ==================================================
3718 .. note::
3719     The keybindings marked "see note below" work like this: if no text is
3720     selected, the word under cursor is used, and *it has to match fully*
3721     (like when `Match only a whole word` is enabled in the Search dialog).
3722     However if some text is selected, then it is matched regardless of
3723     word boundaries.
3726 Go to keybindings
3727 `````````````````
3728 =============================== ========================= ==================================================
3729 Action                          Default shortcut          Description
3730 =============================== ========================= ==================================================
3731 Navigate forward a location     Alt-Right  (C)            Switches to the next location in the navigation
3732                                                           history. See the section called `Code Navigation
3733                                                           History`_.
3735 Navigate back a location        Alt-Left  (C)             Switches to the previous location in the
3736                                                           navigation history. See the section called
3737                                                           `Code navigation history`_.
3739 Go to line                      Ctrl-L                    Focuses the Go to Line entry (if visible) or
3740                                                           shows the Go to line dialog.
3742 Go to matching brace             Ctrl-B                   If the cursor is ahead or behind a brace, then it
3743                                                           is moved to the brace which belongs to the current
3744                                                           one. If this keyboard shortcut is pressed again,
3745                                                           the cursor is moved back to the first brace.
3747 Toggle marker                   Ctrl-M                    Set a marker on the current line, or clear the
3748                                                           marker if there already is one.
3750 Go to next marker                Ctrl-.                    Go to the next marker in the current document.
3752 Go to previous marker            Ctrl-,                    Go to the previous marker in the current document.
3754 Go to symbol definition         Ctrl-T                    Jump to the definition of the current word or
3755                                                           selection. See `Go to symbol definition`_.
3757 Go to symbol declaration        Ctrl-Shift-T              Jump to the declaration of the current word or
3758                                                           selection. See `Go to symbol declaration`_.
3760 Go to Start of Line             Home                      Move the caret to the start of the line.
3761                                                           Behaves differently if smart_home_key_ is set.
3763 Go to End of Line               End                       Move the caret to the end of the line.
3765 Go to Start of Display Line     Alt-Home                  Move the caret to the start of the display line.
3766                                                           This is useful when you use line wrapping and
3767                                                           want to jump to the start of the wrapped, virtual
3768                                                           line, not the real start of the whole line.
3769                                                           If the line is not wrapped, it behaves like
3770                                                           `Go to Start of Line`.
3772 Go to End of Display Line       Alt-End                   Move the caret to the end of the display line.
3773                                                           If the line is not wrapped, it behaves like
3774                                                           `Go to End of Line`.
3776 Go to Previous Word Part        Ctrl-/                    Go to the previous part of the current word.
3778 Go to Next Word Part            Ctrl-\\                   Go to the next part of the current word.
3779 =============================== ========================= ==================================================
3781 View keybindings
3782 ````````````````
3783 =============================== ========================= ==================================================
3784 Action                          Default shortcut          Description
3785 =============================== ========================= ==================================================
3786 Fullscreen                      F11  (C)                  Switches to fullscreen mode.
3788 Toggle Messages Window                                    Toggles the message window (status and compiler
3789                                                           messages) on and off.
3791 Toggle Sidebar                                            Shows or hides the sidebar.
3793 Toggle all additional widgets                             Hide and show all additional widgets like the
3794                                                           notebook tabs, the toolbar, the messages window
3795                                                           and the status bar.
3797 Zoom In                         Ctrl-+  (C)               Zooms in the text.
3799 Zoom Out                        Ctrl--  (C)               Zooms out the text.
3801 Zoom Reset                      Ctrl-0                    Reset any previous zoom on the text.
3802 =============================== ========================= ==================================================
3804 Focus keybindings
3805 `````````````````
3806 ================================ ========================= ==================================================
3807 Action                           Default shortcut          Description
3808 ================================ ========================= ==================================================
3809 Switch to Editor                 F2                        Switches to editor widget.
3810                                                            Also reshows the document statistics line
3811                                                            (after a short timeout).
3813 Switch to Search Bar             F7                        Switches to the search bar in the toolbar (if
3814                                                            visible).
3816 Switch to Message Window                                   Focus the Message Window's current tab.
3818 Switch to Compiler                                         Focus the Compiler message window tab.
3820 Switch to Messages                                         Focus the Messages message window tab.
3822 Switch to Scribble               F6                        Switches to scribble widget.
3824 Switch to VTE                    F4                        Switches to VTE widget.
3826 Switch to Sidebar                                          Focus the Sidebar.
3828 Switch to Sidebar Symbol List                              Focus the Symbol list tab in the Sidebar
3829                                                            (if visible).
3831 Switch to Sidebar Document List                            Focus the Document list tab in the Sidebar
3832                                                            (if visible).
3833 ================================ ========================= ==================================================
3836 Notebook tab keybindings
3837 ````````````````````````
3838 =============================== ========================= ==================================================
3839 Action                          Default shortcut          Description
3840 =============================== ========================= ==================================================
3841 Switch to left document         Ctrl-PageUp   (C)         Switches to the previous open document.
3843 Switch to right document        Ctrl-PageDown (C)         Switches to the next open document.
3845 Switch to last used document    Ctrl-Tab                  Switches to the previously shown document (if it's
3846                                                           still open).
3847                                                           Holding Ctrl (or another modifier if the keybinding
3848                                                           has been changed) will show a dialog, then repeated
3849                                                           presses of the keybinding will switch to the 2nd-last
3850                                                           used document, 3rd-last, etc. Also known as
3851                                                           Most-Recently-Used documents switching.
3853 Move document left              Ctrl-Shift-PageUp         Changes the current document with the left hand
3854                                                           one.
3856 Move document right             Ctrl-Shift-PageDown       Changes the current document with the right hand
3857                                                           one.
3859 Move document first                                       Moves the current document to the first position.
3861 Move document last                                        Moves the current document to the last position.
3862 =============================== ========================= ==================================================
3865 Document keybindings
3866 ````````````````````
3867 ==================================== ==================== ==================================================
3868 Action                               Default shortcut     Description
3869 ==================================== ==================== ==================================================
3870 Clone                                                     See `Cloning documents`_.
3872 Replace tabs with space                                   Replaces all tabs with the right amount of spaces
3873                                                           in the whole document, or the current selection.
3875 Replace spaces with tabs                                  Replaces leading spaces with tab characters in the
3876                                                           whole document, or the current selection.
3878 Toggle current fold                                       Toggles the folding state of the current code block.
3880 Fold all                                                  Folds all contractible code blocks.
3882 Unfold all                                                Unfolds all contracted code blocks.
3884 Reload symbol list                   Ctrl-Shift-R         Reloads the symbol list.
3886 Toggle Line wrapping                                      Enables or disables wrapping of long lines.
3888 Toggle Line breaking                                      Enables or disables automatic breaking of long
3889                                                           lines at a configurable column.
3891 Remove Markers                                            Remove any markers on lines or words which
3892                                                           were set by using 'Mark All' in the
3893                                                           search dialog or by manually marking lines.
3895 Remove Error Indicators                                   Remove any error indicators in the
3896                                                           current document.
3898 Remove Markers and Error Indicators                       Combines ``Remove Markers`` and
3899                                                           ``Remove Error Indicators``.
3900 ==================================== ==================== ==================================================
3903 Project keybindings
3904 ```````````````````
3905 =============================== ========================= ==================================================
3906 Action                          Default shortcut          Description
3907 =============================== ========================= ==================================================
3908 New                                                       Create a new project.
3909 Open                                                      Opens a project file.
3910 Properties                                                Shows project properties.
3911 Close                                                     Close the current project.
3912 =============================== ========================= ==================================================
3915 Build keybindings
3916 `````````````````
3917 =============================== ========================= ==================================================
3918 Action                          Default shortcut          Description
3919 =============================== ========================= ==================================================
3920 Compile                         F8                        Compiles the current file.
3922 Build                           F9                        Builds (compiles if necessary and links) the
3923                                                           current file.
3925 Make all                        Shift-F9                  Builds the current file with the Make tool.
3927 Make custom target              Ctrl-Shift-F9             Builds the current file with the Make tool and a
3928                                                           given target.
3930 Make object                     Shift-F8                  Compiles the current file with the Make tool.
3932 Next error                                                Jumps to the line with the next error from the
3933                                                           last build process.
3935 Previous error                                            Jumps to the line with the previous error from
3936                                                           the last build process.
3938 Run                             F5                        Executes the current file in a terminal emulation.
3940 Set Build Commands                                        Opens the build commands dialog.
3941 =============================== ========================= ==================================================
3944 Tools keybindings
3945 `````````````````
3946 =============================== ========================= ==================================================
3947 Action                          Default shortcut          Description
3948 =============================== ========================= ==================================================
3949 Show Color Chooser                                        Opens the Color Chooser dialog.
3950 =============================== ========================= ==================================================
3953 Help keybindings
3954 ````````````````
3955 =============================== ========================= ==================================================
3956 Action                          Default shortcut          Description
3957 =============================== ========================= ==================================================
3958 Help                            F1 (C)                       Opens the manual.
3959 =============================== ========================= ==================================================
3964 Configuration files
3965 ===================
3966 .. warning::
3967     You must use UTF-8 encoding *without BOM* for configuration files.
3970 Configuration file paths
3971 ------------------------
3972 Geany has default configuration files installed for the system and
3973 also per-user configuration files.
3975 The system files should not normally be edited because they will be
3976 overwritten when upgrading Geany.
3978 The user configuration directory can be overridden with the ``-c``
3979 switch, but this is not normally done. See `Command line options`_.
3981 .. note::
3982     Any missing subdirectories in the user configuration directory
3983     will be created when Geany starts.
3985 You can check the paths Geany is using with *Help->Debug Messages*.
3986 Near the top there should be 2 lines with something like::
3988     Geany-INFO: System data dir: /usr/share/geany
3989     Geany-INFO: User config dir: /home/username/.config/geany
3992 Paths on Unix-like systems
3993 ^^^^^^^^^^^^^^^^^^^^^^^^^^
3994 The system path is ``$prefix/share/geany``, where ``$prefix`` is the
3995 path where Geany is installed (see `Installation prefix`_).
3997 The user configuration directory is normally:
3998 ``/home/username/.config/geany``
4000 Paths on Windows
4001 ^^^^^^^^^^^^^^^^
4002 The system path is the ``data`` subfolder of the installation path
4003 on Windows.
4005 The user configuration directory might vary, but on Windows XP it's:
4006 ``C:\Documents and Settings\UserName\Application Data\geany``
4007 On Windows 7 and above you most likely will find it at:
4008 ``C:\users\UserName\Roaming\geany``
4011 Tools menu items
4012 ----------------
4013 There's a *Configuration files* submenu in the *Tools* menu that
4014 contains items for some of the available user configuration files.
4015 Clicking on one opens it in the editor for you to update. Geany will
4016 reload the file after you have saved it.
4018 .. note::
4019     Other configuration files not shown here will need to be opened
4020     manually, and will not be automatically reloaded when saved.
4021     (see *Reload Configuration* below).
4023 There's also a *Reload Configuration* item which can be used if you
4024 updated one of the other configuration files, or modified or added
4025 template files.
4027 *Reload Configuration* is also necessary to update syntax highlighting colors.
4029 .. note::
4030     Syntax highlighting colors aren't updated in open documents after
4031     saving filetypes.common as this may take a significant
4032     amount of time.
4035 Global configuration file
4036 -------------------------
4038 System administrators can add a global configuration file for Geany
4039 which will be used when starting Geany and a user configuration file
4040 does not exist.
4042 The global configuration file is read from ``geany.conf`` in the
4043 system configuration path - see `Configuration file paths`_. It can
4044 contain any settings which are found in the usual configuration file
4045 created by Geany, but does not have to contain all settings.
4047 .. note::
4048     This feature is mainly intended for package maintainers or system
4049     admins who want to set up Geany in a multi user environment and
4050     set some sane default values for this environment. Usually users won't
4051     need to do that.
4055 Filetype definition files
4056 -------------------------
4058 All color definitions and other filetype specific settings are
4059 stored in the filetype definition files. Those settings are colors
4060 for syntax highlighting, general settings like comment characters or
4061 word delimiter characters as well as compiler and linker settings.
4063 See also `Configuration file paths`_.
4065 Filenames
4066 ^^^^^^^^^
4067 Each filetype has a corresponding filetype definition file. The format
4068 for built-in filetype `Foo` is::
4070     filetypes.foo
4072 The extension is normally just the filetype name in lower case.
4074 However there are some exceptions:
4076 =============== =========
4077 Filetype        Extension
4078 =============== =========
4079 C++             cpp
4080 C#              cs
4081 Make            makefile
4082 Matlab/Octave   matlab
4083 =============== =========
4085 There is also the `special file filetypes.common`_.
4087 For `custom filetypes`_, the filename for `Foo` is different::
4089     filetypes.Foo.conf
4091 See the link for details.
4093 System files
4094 ^^^^^^^^^^^^
4095 The system-wide filetype configuration files can be found in the
4096 system configuration path and are called ``filetypes.$ext``,
4097 where $ext is the name of the filetype. For every
4098 filetype there is a corresponding definition file. There is one
4099 exception: ``filetypes.common`` -- this file is for general settings,
4100 which are not specific to a certain filetype.
4102 .. warning::
4103     It is not recommended that users edit the system-wide files,
4104     because they will be overridden when Geany is updated.
4106 User files
4107 ^^^^^^^^^^
4108 To change the settings, copy a file from the system configuration
4109 path to the subdirectory ``filedefs`` in your user configuration
4110 directory. Then you can edit the file and the changes will still be
4111 available after an update of Geany.
4113 Alternatively, you can create the file yourself and add only the
4114 settings you want to change. All missing settings will be read from
4115 the corresponding system configuration file.
4117 Custom filetypes
4118 ^^^^^^^^^^^^^^^^
4119 At startup Geany looks for ``filetypes.*.conf`` files in the system and
4120 user filetype paths, adding any filetypes found with the name matching
4121 the '``*``' wildcard - e.g. ``filetypes.Bar.conf``.
4123 Custom filetypes are not as powerful as built-in filetypes, but
4124 support for the following has been implemented:
4126 * Recognizing and setting the filetype (after the user has manually updated
4127   the `filetype extensions`_ file).
4128 * `Filetype group membership`_.
4129 * Reading filetype settings in the ``[settings]`` section, including:
4130     * Using an existing syntax highlighting lexer (`lexer_filetype`_ key).
4131     * Using an existing tags parser (`tag_parser`_ key).
4132 * Build commands (``[build-menu]`` section).
4133 * Loading global tags files (sharing the ``tag_parser`` filetype's namespace).
4135 See `Filetype configuration`_ for details on each setting.
4137 Creating a custom filetype from an existing filetype
4138 ````````````````````````````````````````````````````
4139 Because most filetype settings will relate to the syntax
4140 highlighting (e.g. styling, keywords, ``lexer_properties``
4141 sections), it is best to copy an existing filetype file that uses
4142 the lexer you wish to use as the basis of a custom filetype, using
4143 the correct filename extension format shown above, e.g.::
4145     cp filetypes.foo filetypes.Bar.conf
4147 Then add the ``lexer_filetype=Foo`` setting (if not already present)
4148 and add/adjust other settings.
4150 .. warning::
4151     The ``[styling]`` and ``[keywords]`` sections have key names
4152     specific to each filetype/lexer. You must follow the same
4153     names - in particular, some lexers only support one keyword
4154     list, or none.
4157 Filetype configuration
4158 ^^^^^^^^^^^^^^^^^^^^^^
4160 As well as the sections listed below, each filetype file can contain
4161 a [build-menu] section as described in `[build-menu] section`_.
4163 [styling] section
4164 `````````````````
4166 In this section the colors for syntax highlighting are defined. The
4167 manual format is:
4169 * ``key=foreground_color;background_color;bold_flag;italic_flag``
4171 Colors have to be specified as RGB hex values prefixed by
4172 0x or # similar to HTML/CSS hex triplets. For example, all of the following
4173 are valid values for pure red; 0xff0000, 0xf00, #ff0000, or #f00.  The
4174 values are case-insensitive but it is a good idea to use lower-case.
4175 Note that you can also use *named colors* as well by substituting the
4176 color value with the name of a color as defined in the ``[named_colors]``
4177 section, see the `[named_colors] Section`_ for more information.
4179 Bold and italic are flags and should only be "true" or "false". If their
4180 value is something other than "true" or "false", "false" is assumed.
4182 You can omit fields to use the values from the style named ``"default"``.
4184 E.g. ``key=0xff0000;;true``
4186 This makes the key style have red foreground text, default background
4187 color text and bold emphasis.
4189 Using a named style
4190 *******************
4191 The second format uses a *named style* name to reference a style
4192 defined in filetypes.common.
4194 * ``key=named_style``
4195 * ``key2=named_style2,bold,italic``
4197 The bold and italic parts are optional, and if present are used to
4198 toggle the bold or italic flags to the opposite of the named style's
4199 flags. In contrast to style definition booleans, they are a literal
4200 ",bold,italic" and commas are used instead of semi-colons.
4202 E.g. ``key=comment,italic``
4204 This makes the key style match the ``"comment"`` named style, but with
4205 italic emphasis.
4207 To define named styles, see the filetypes.common `[named_styles]
4208 Section`_.
4210 Reading styles from another filetype
4211 ************************************
4212 You can automatically copy all of the styles from another filetype
4213 definition file by using the following syntax for the ``[styling]``
4214 group::
4216         [styling=Foo]
4218 Where Foo is a filetype name. The corresponding ``[styling]``
4219 section from ``filetypes.foo`` will be read.
4221 This is useful when the same lexer is being used for multiple
4222 filetypes (e.g. C/C++/C#/Java/etc).  For example, to make the C++
4223 styling the same as the C styling, you would put the following in
4224 ``filetypes.cpp``::
4226         [styling=C]
4229 [keywords] section
4230 ``````````````````
4232 This section contains keys for different keyword lists specific to
4233 the filetype. Some filetypes do not support keywords, so adding a
4234 new key will not work. You can only add or remove keywords to/from
4235 an existing list.
4237 .. important::
4238     The keywords list must be in one line without line ending characters.
4241 [lexer_properties] section
4242 ``````````````````````````
4243 Here any special properties for the Scintilla lexer can be set in the
4244 format ``key.name.field=some.value``.
4246 Properties Geany uses are listed in the system filetype files. To find
4247 other properties you need Geany's source code::
4249     egrep -o 'GetProperty\w*\("([^"]+)"[^)]+\)' scintilla/Lex*.cxx
4252 [settings] section
4253 ``````````````````
4255 extension
4256     This is the default file extension used when saving files, not
4257     including the period character (``.``). The extension used should
4258     match one of the patterns associated with that filetype (see
4259     `Filetype extensions`_).
4261     *Example:* ``extension=cxx``
4263 wordchars
4264     These characters define word boundaries when making selections
4265     and searching using word matching options.
4267     *Example:* (look at system filetypes.\* files)
4269     .. note::
4270         This overrides the *wordchars* filetypes.common setting, and
4271         has precedence over the *whitespace_chars* setting.
4273 comment_single
4274     A character or string which is used to comment code. If you want to use
4275     multiline comments only, don't set this but rather comment_open and
4276     comment_close.
4278     Single-line comments are used in priority over multiline comments to
4279     comment a line, e.g. with the `Comment/Uncomment line` command.
4281     *Example:* ``comment_single=//``
4283 comment_open
4284     A character or string which is used to comment code. You need to also
4285     set comment_close to really use multiline comments. If you want to use
4286     single-line comments, prefer setting comment_single.
4288     Multiline comments are used in priority over single-line comments to
4289     comment a block, e.g. template comments.
4291     *Example:* ``comment_open=/*``
4293 comment_close
4294     If multiline comments are used, this is the character or string to
4295     close the comment.
4297     *Example:* ``comment_close=*/``
4299 comment_use_indent
4300     Set this to false if a comment character or string should start at
4301     column 0 of a line. If set to true it uses any indentation of the
4302     line.
4304     Note: Comment indentation
4306     ``comment_use_indent=true`` would generate this if a line is
4307     commented (e.g. with Ctrl-D)::
4309         #command_example();
4311     ``comment_use_indent=false`` would generate this if a line is
4312     commented (e.g. with Ctrl-D)::
4314         #   command_example();
4317     Note: This setting only works for single line comments (like '//',
4318     '#' or ';').
4320     *Example:* ``comment_use_indent=true``
4322 context_action_cmd
4323     A command which can be executed on the current word or the current
4324     selection.
4326     Example usage: Open the API documentation for the
4327     current function call at the cursor position.
4329     The command can
4330     be set for every filetype or if not set, a global command will
4331     be used. The command itself can be specified without the full
4332     path, then it is searched in $PATH. But for security reasons,
4333     it is recommended to specify the full path to the command. The
4334     wildcard %s will be replaced by the current word at the cursor
4335     position or by the current selection.
4337     Hint: for PHP files the following could be quite useful:
4338     context_action_cmd=firefox "http://www.php.net/%s"
4340     *Example:* ``context_action_cmd=devhelp -s "%s"``
4342 .. _tag_parser:
4344 tag_parser
4345     The TagManager language name, e.g. "C". Usually the same as the
4346     filetype name.
4348 .. _lexer_filetype:
4350 lexer_filetype
4351     A filetype name to setup syntax highlighting from another filetype.
4352     This must not be recursive, i.e. it should be a filetype name that
4353     doesn't use the *lexer_filetype* key itself, e.g.::
4355         lexer_filetype=C
4356         #lexer_filetype=C++
4358     The second line is wrong, because ``filetypes.cpp`` itself uses
4359     ``lexer_filetype=C``, which would be recursive.
4361 symbol_list_sort_mode
4362     What the default symbol list sort order should be.
4364     =====   ========================================
4365     Value   Meaning
4366     =====   ========================================
4367     0       Sort symbols by name
4368     1       Sort symbols by appearance (line number)
4369     =====   ========================================
4371 .. _xml_indent_tags:
4373 xml_indent_tags
4374     If this setting is set to *true*, a new line after a line ending with an
4375     unclosed XML/HTML tag will be automatically indented. This only applies
4376     to filetypes for which the HTML or XML lexer is used. Such filetypes have
4377     this setting in their system configuration files.
4379 mime_type
4380     The MIME type for this file type, e.g. "text/x-csrc".  This is used
4381     for example to chose the icon to display for this file type.
4384 [indentation] section
4385 `````````````````````
4387 This section allows definition of default indentation settings specific to
4388 the file type, overriding the ones configured in the preferences.  This can
4389 be useful for file types requiring specific indentation settings (e.g. tabs
4390 only for Makefile).  These settings don't override auto-detection if activated.
4392 width
4393     The forced indentation width.
4395 type
4396     The forced indentation type.
4398     =====   =======================
4399     Value   Indentation type
4400     =====   =======================
4401     0       Spaces only
4402     1       Tabs only
4403     2       Mixed (tabs and spaces)
4404     =====   =======================
4407 [build-menu] filetype section
4408 `````````````````````````````
4409 This supports the same keys as the ``geany.conf`` `[build-menu] section`_.
4411 Example::
4413     FT_00_LB=_Compile
4414     FT_00_CM=gcc -c "%f"
4415     FT_00_WD=
4416     FT_01_LB=_Build
4417     FT_01_CM=gcc -o "%e" "%f"
4418     FT_01_WD=
4419     EX_00_LB=_Execute
4420     EX_00_CM="./%e"
4421     EX_00_WD=
4422     error_regex=^([^:]+):([0-9]+):
4424 [build_settings] section
4425 ````````````````````````
4426 As of Geany 0.19 this section is for legacy support.
4427 Values that are set in the [build-menu] section will override those in this section.
4429 If any build menu item settings have been configured in the
4430 `Set Build Commands dialog`_ (or the *Build* tab of the 
4431 `Project Properties`_ dialog), then these settings are stored in the 
4432 [build-menu] section and will override the settings in this section for 
4433 that item.
4435 error_regex
4436     See the [build-menu] section for details.
4438 **Build commands**
4440 compiler
4441     This item specifies the command to compile source code files. But
4442     it is also possible to use it with interpreted languages like Perl
4443     or Python. With these filetypes you can use this option as a kind of
4444     syntax parser, which sends output to the compiler message window.
4446     You should quote the filename to also support filenames with
4447     spaces. The following wildcards for filenames are available:
4449     * %f -- complete filename without path
4450     * %e -- filename without path and without extension
4452     *Example:* ``compiler=gcc -Wall -c "%f"``
4454 linker
4455     This item specifies the command to link the file. If the file is not
4456     already compiled, it will be compiled while linking. The -o option
4457     is automatically added by Geany. This item works well with GNU gcc,
4458     but may be problematic with other compilers (esp. with the linker).
4460     *Example:* ``linker=gcc -Wall "%f"``
4462 run_cmd
4463     Use this item to execute your file. It has to have been built
4464     already. Use the %e wildcard to have only the name of the executable
4465     (i.e. without extension) or use the %f wildcard if you need the
4466     complete filename, e.g. for shell scripts.
4468     *Example:* ``run_cmd="./%e"``
4471 Special file filetypes.common
4472 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4474 There is a special filetype definition file called
4475 filetypes.common. This file defines some general non-filetype-specific
4476 settings.
4478 You can open the user filetypes.common with the
4479 *Tools->Configuration Files->filetypes.common* menu item. This adds
4480 the default settings to the user file if the file doesn't exist.
4481 Alternatively the file can be created manually, adding only the
4482 settings you want to change. All missing settings will be read from
4483 the system file.
4485 .. note::
4486     See the `Filetype configuration`_ section for how to define styles.
4489 [named_styles] section
4490 ``````````````````````
4491 Named styles declared here can be used in the [styling] section of any
4492 filetypes.* file.
4494 For example:
4496 *In filetypes.common*::
4498     [named_styles]
4499     foo=0xc00000;0xffffff;false;true
4500     bar=foo
4502 *In filetypes.c*::
4504     [styling]
4505     comment=foo
4507 This saves copying and pasting the whole style definition into several
4508 different files.
4510 .. note::
4511     You can define aliases for named styles, as shown with the ``bar``
4512     entry in the above example, but they must be declared after the
4513     original style.
4516 [named_colors] section
4517 ``````````````````````
4518 Named colors declared here can be used in the ``[styling]`` or
4519 ``[named_styles]`` section of any filetypes.* file or color scheme.
4521 For example::
4523     [named_colors]
4524     my_red_color=#FF0000
4525     my_blue_color=#0000FF
4527     [named_styles]
4528     foo=my_red_color;my_blue_color;false;true
4530 This allows to define a color palette by name so that to change a color
4531 scheme-wide only involves changing the hex value in a single location.
4533 [styling] section
4534 `````````````````
4535 default
4536     This is the default style. It is used for styling files without a
4537     filetype set.
4539     *Example:* ``default=0x000000;0xffffff;false;false``
4541 selection
4542     The style for coloring selected text. The format is:
4544     * Foreground color
4545     * Background color
4546     * Use foreground color
4547     * Use background color
4549     The colors are only set if the 3rd or 4th argument is true. When
4550     the colors are not overridden, the default is a dark grey
4551     background with syntax highlighted foreground text.
4553     *Example:* ``selection=0xc0c0c0;0x00007F;true;true``
4555 brace_good
4556     The style for brace highlighting when a matching brace was found.
4558     *Example:* ``brace_good=0xff0000;0xFFFFFF;true;false``
4560 brace_bad
4561     The style for brace highlighting when no matching brace was found.
4563     *Example:* ``brace_bad=0x0000ff;0xFFFFFF;true;false``
4565 caret
4566     The style for coloring the caret(the blinking cursor). Only first
4567     and third argument is interpreted.
4568     Set the third argument to true to change the caret into a block caret.
4570     *Example:* ``caret=0x000000;0x0;false;false``
4572 caret_width
4573     The width for the caret(the blinking cursor). Only the first
4574     argument is interpreted. The width is specified in pixels with
4575     a maximum of three pixel. Use the width 0 to make the caret
4576     invisible.
4578     *Example:* ``caret_width=3``
4580 current_line
4581     The style for coloring the background of the current line. Only
4582     the second and third arguments are interpreted. The second argument
4583     is the background color. Use the third argument to enable or
4584     disable background highlighting for the current line (has to be
4585     true/false).
4587     *Example:* ``current_line=0x0;0xe5e5e5;true;false``
4589 indent_guide
4590     The style for coloring the indentation guides. Only the first and
4591     second arguments are interpreted.
4593     *Example:* ``indent_guide=0xc0c0c0;0xffffff;false;false``
4595 white_space
4596     The style for coloring the white space if it is shown. The first
4597     both arguments define the foreground and background colors, the
4598     third argument sets whether to use the defined foreground color
4599     or to use the color defined by each filetype for the white space.
4600     The fourth argument defines whether to use the background color.
4602     *Example:* ``white_space=0xc0c0c0;0xffffff;true;true``
4604 margin_linenumber
4605     Line number margin foreground and background colors.
4607 .. _Folding Settings:
4609 margin_folding
4610     Fold margin foreground and background colors.
4612 fold_symbol_highlight
4613     Highlight color of folding symbols.
4615 folding_style
4616     The style of folding icons. Only first and second arguments are
4617     used.
4619     Valid values for the first argument are:
4621     * 1 -- for boxes
4622     * 2 -- for circles
4623     * 3 -- for arrows
4624     * 4 -- for +/-
4626     Valid values for the second argument are:
4628     * 0 -- for no lines
4629     * 1 -- for straight lines
4630     * 2 -- for curved lines
4632     *Default:* ``folding_style=1;1;``
4634     *Arrows:* ``folding_style=3;0;``
4636 folding_horiz_line
4637     Draw a thin horizontal line at the line where text is folded. Only
4638     first argument is used.
4640     Valid values for the first argument are:
4642     * 0 -- disable, do not draw a line
4643     * 1 -- draw the line above folded text
4644     * 2 -- draw the line below folded text
4646     *Example:* ``folding_horiz_line=0;0;false;false``
4648 line_wrap_visuals
4649     First argument: drawing of visual flags to indicate a line is wrapped.
4650     This is a bitmask of the values:
4652     * 0 -- No visual flags
4653     * 1 -- Visual flag at end of subline of a wrapped line
4654     * 2 -- Visual flag at begin of subline of a wrapped line. Subline is
4655       indented by at least 1 to make room for the flag.
4657     Second argument: wether the visual flags to indicate a line is wrapped
4658     are drawn near the border or near the text. This is a bitmask of the values:
4660     * 0 -- Visual flags drawn near border
4661     * 1 -- Visual flag at end of subline drawn near text
4662     * 2 -- Visual flag at begin of subline drawn near text
4664     Only first and second arguments are interpreted.
4666     *Example:* ``line_wrap_visuals=3;0;false;false``
4668 line_wrap_indent
4669     First argument: sets the size of indentation of sublines for wrapped lines
4670     in terms of the width of a space, only used when the second argument is ``0``.
4672     Second argument: wrapped sublines can be indented to the position of their
4673     first subline or one more indent level. Possible values:
4675     * 0 - Wrapped sublines aligned to left of window plus amount set by the first argument
4676     * 1 - Wrapped sublines are aligned to first subline indent (use the same indentation)
4677     * 2 - Wrapped sublines are aligned to first subline indent plus one more level of indentation
4679     Only first and second arguments are interpreted.
4681     *Example:* ``line_wrap_indent=0;1;false;false``
4683 translucency
4684     Translucency for the current line (first argument) and the selection
4685     (second argument). Values between 0 and 256 are accepted.
4687     Note for Windows 95, 98 and ME users:
4688     keep this value at 256 to disable translucency otherwise Geany might crash.
4690     Only the first and second arguments are interpreted.
4692     *Example:* ``translucency=256;256;false;false``
4694 marker_line
4695     The style for a highlighted line (e.g when using Goto line or goto symbol).
4696     The foreground color (first argument) is only used when the Markers margin
4697     is enabled (see View menu).
4699     Only the first and second arguments are interpreted.
4701     *Example:* ``marker_line=0x000000;0xffff00;false;false``
4703 marker_search
4704     The style for a marked search results (when using "Mark" in Search dialogs).
4705     The second argument sets the background color for the drawn rectangle.
4707     Only the second argument is interpreted.
4709     *Example:* ``marker_search=0x000000;0xb8f4b8;false;false``
4711 marker_mark
4712     The style for a marked line (e.g when using the "Toggle Marker" keybinding
4713     (Ctrl-M)). The foreground color (first argument) is only used
4714     when the Markers margin is enabled (see View menu).
4716     Only the first and second arguments are interpreted.
4718     *Example:* ``marker_mark=0x000000;0xb8f4b8;false;false``
4720 marker_translucency
4721     Translucency for the line marker (first argument) and the search marker
4722     (second argument). Values between 0 and 256 are accepted.
4724     Note for Windows 95, 98 and ME users:
4725     keep this value at 256 to disable translucency otherwise Geany might crash.
4727     Only the first and second arguments are interpreted.
4729     *Example:* ``marker_translucency=256;256;false;false``
4731 line_height
4732     Amount of space to be drawn above and below the line's baseline.
4733     The first argument defines the amount of space to be drawn above the line, the second
4734     argument defines the amount of space to be drawn below.
4736     Only the first and second arguments are interpreted.
4738     *Example:* ``line_height=0;0;false;false``
4740 calltips
4741     The style for coloring the calltips. The first two arguments
4742     define the foreground and background colors, the third and fourth
4743     arguments set whether to use the defined colors.
4745     *Example:* ``calltips=0xc0c0c0;0xffffff;false;false``
4747 indicator_error
4748     The color of the error indicator.
4750     Only the first argument (foreground color) is used.
4752     *Example:* ``indicator_error=0xff0000``
4755 [settings] section
4756 ``````````````````
4757 whitespace_chars
4758     Characters to treat as whitespace. These characters are ignored
4759     when moving, selecting and deleting across word boundaries
4760     (see `Scintilla keyboard commands`_).
4762     This should include space (\\s) and tab (\\t).
4764     *Example:* ``whitespace_chars=\s\t!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~``
4766 wordchars
4767     These characters define word boundaries when making selections
4768     and searching using word matching options.
4770     *Example:* ``wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789``
4772     .. note::
4773         This has precedence over the *whitespace_chars* setting.
4777 Filetype extensions
4778 -------------------
4780 .. note::
4781     To change the default filetype extension used when saving a new file,
4782     see `Filetype definition files`_.
4784 You can override the list of file extensions that Geany uses to detect
4785 filetypes using the user ``filetype_extensions.conf`` file. Use the
4786 *Tools->Configuration Files->filetype_extensions.conf* menu item. See
4787 also `Configuration file paths`_.
4789 You should only list lines for filetype extensions that you want to
4790 override in the user configuration file and remove or comment out
4791 others. The patterns are listed after the ``=`` sign, using a
4792 semi-colon separated list of patterns which should be matched for
4793 that filetype.
4795 For example, to override the filetype extensions for Make, the file
4796 should look like::
4798     [Extensions]
4799     Make=Makefile*;*.mk;Buildfile;
4801 Filetype group membership
4802 ^^^^^^^^^^^^^^^^^^^^^^^^^
4803 Filetype groups are used in the `Document->Set Filetype` menu.
4805 Group membership is also stored in ``filetype_extensions.conf``. This
4806 file is used to store information Geany needs at startup, whereas the
4807 separate filetype definition files hold information only needed when
4808 a document with their filetype is used.
4810 The format looks like::
4812     [Groups]
4813     Programming=C;C++;
4814     Script=Perl;Python;
4815     Markup=HTML;XML;
4816     Misc=Diff;Conf;
4817     None=None;
4819 The key names cannot be configured.
4821 .. note::
4822     Group membership is only read at startup.
4824 .. tip::
4825     You can make commonly used filetypes appear in the top-level of the
4826     filetype menu by adding them to the `None` group, e.g.
4827     `None=C;Python`.
4829 Preferences file format
4830 -----------------------
4832 The user preferences file ``geany.conf`` holds settings for all the items configured
4833 in the preferences dialog. This file should not be edited while Geany is running
4834 as the file will be overwritten when the preferences in Geany are changed or Geany
4835 is quit.
4838 [build-menu] section
4839 ^^^^^^^^^^^^^^^^^^^^
4841 The [build-menu] section contains the configuration of the build menu.
4842 This section can occur in filetype, preferences and project files and
4843 always has the format described here.  Different menu items are loaded
4844 from different files, see the table in the `Build Menu Configuration`_
4845 section for details.  All the settings can be configured from the dialogs
4846 except the execute command in filetype files and filetype definitions in
4847 the project file, so these are the only ones which need hand editing.
4849 Menu commands
4850 `````````````
4851 The build-menu section stores one entry for each setting for each menu item that
4852 is configured.  The keys for these settings have the format:
4854   ``GG_NN_FF``
4856 where:
4858 * GG - is the menu item group,
4860   - FT for filetype build
4861   - NF for independent (non-filetype) build
4862   - EX for execute
4864 * NN - is a two decimal digit number of the item within the group,
4865   starting at 00
4866 * FF - is the field,
4868   - LB for label
4869   - CM for command
4870   - WD for working directory
4872 See `[build-menu] filetype section`_ for an example.
4874 Error regular expression
4875 ````````````````````````
4876 error_regex
4877     This is a Perl-compatible regular expression (PCRE) to parse a filename
4878     (absolute or relative) and line number from the build output.
4879     If undefined, Geany will fall back to its default error message parsing.
4881     Only the first two match groups will be read by Geany. These groups can
4882     occur in any order: the match group consisting of only digits will be used
4883     as the line number, and the other group as the filename.  In no group
4884     consists of only digits, the match will fail.
4886     *Example:* ``error_regex=^(.+):([0-9]+):[0-9]+``
4888     This will parse a message such as:
4889     ``test.py:7:24: E202 whitespace before ']'``
4892 Project file format
4893 -------------------
4895 The project file contains project related settings and possibly a
4896 record of the current session files.
4899 [build-menu] additions
4900 ^^^^^^^^^^^^^^^^^^^^^^
4902 The project file also can have extra fields in the [build-menu] section
4903 in addition to those listed in `[build-menu] section`_ above.
4905 When filetype menu items are configured for the project they are stored
4906 in the project file.
4908 The ``filetypes`` entry is a list of the filetypes which exist in the
4909 project file.
4911 For each filetype the entries for that filetype have the format defined in
4912 `[build-menu] section`_ but the key is prefixed by the name of the filetype
4913 as it appears in the ``filetypes`` entry, eg the entry for the label of
4914 filetype menu item 0 for the C filetype would be
4916   ``CFT_00_LB=Label``
4919 Templates
4920 ---------
4922 Geany supports the following templates:
4924 * ChangeLog entry
4925 * File header
4926 * Function description
4927 * Short GPL notice
4928 * Short BSD notice
4929 * File templates
4931 To use these templates, just open the Edit menu or open the popup menu
4932 by right-clicking in the editor widget, and choose "Insert Comments"
4933 and insert templates as you want.
4935 Some templates (like File header or ChangeLog entry) will always be
4936 inserted at the top of the file.
4938 To insert a function description, the cursor must be inside
4939 of the function, so that the function name can be determined
4940 automatically. The description will be positioned correctly one line
4941 above the function, just check it out. If the cursor is not inside
4942 of a function or the function name cannot be determined, the inserted
4943 function description won't contain the correct function name but "unknown"
4944 instead.
4946 .. note::
4947     Geany automatically reloads template information when it notices you
4948     save a file in the user's template configuration directory. You can
4949     also force this by selecting *Tools->Reload Configuration*.
4952 Template meta data
4953 ^^^^^^^^^^^^^^^^^^
4955 Meta data can be used with all templates, but by default user set
4956 meta data is only used for the ChangeLog and File header templates.
4958 In the configuration dialog you can find a tab "Templates" (see
4959 `Template preferences`_). You can define the default values
4960 which will be inserted in the templates.
4963 File templates
4964 ^^^^^^^^^^^^^^
4966 File templates are templates used as the basis of a new file. To
4967 use them, choose the *New (with Template)* menu item from the *File*
4968 menu. If there is more than one template for a filetype then they
4969 will be grouped in a submenu.
4971 By default, file templates are installed for some filetypes. Custom
4972 file templates can be added by creating the appropriate template file. You can
4973 also edit the default file templates.
4975 The file's contents are just the text to place in the document, with
4976 optional template wildcards like ``{fileheader}``. The fileheader
4977 wildcard can be placed anywhere, but it's usually put on the first
4978 line of the file, followed by a blank line.
4980 Adding file templates
4981 `````````````````````
4983 File templates are read from ``templates/files`` under the
4984 `Configuration file paths`_.
4986 The filetype to use is detected from the template file's extension, if
4987 any. For example, creating a file ``module.c`` would add a menu item
4988 which created a new document with the filetype set to 'C'.
4990 The template file is read from disk when the corresponding menu item is
4991 clicked.
4994 Customizing templates
4995 ^^^^^^^^^^^^^^^^^^^^^
4997 Each template can be customized to your needs. The templates are
4998 stored in the ``~/.config/geany/templates/`` directory (see the section called
4999 `Command line options`_ for further information about the configuration
5000 directory). Just open the desired template with an editor (ideally,
5001 Geany ;-) ) and edit the template to your needs. There are some
5002 wildcards which will be automatically replaced by Geany at startup.
5005 Template wildcards
5006 ``````````````````
5008 All wildcards must be enclosed by "{" and "}", e.g. {date}.
5010 **Wildcards for character escaping**
5012 ============== ============================================= =======================================
5013 Wildcard       Description                                   Available in
5014 ============== ============================================= =======================================
5015 ob             { Opening Brace (used to prevent other        file templates, file header, snippets.
5016                wildcards being expanded).
5017 cb             } Closing Brace.                              file templates, file header, snippets.
5018 pc             \% Percent (used to escape e.g. ``%block%``
5019                in snippets).                                 snippets.
5020 ============== ============================================= =======================================
5022 Global wildcards
5023 ****************
5025 These are configurable, see `Template preferences`_.
5027 ============== ============================================= =======================================
5028 Wildcard       Description                                   Available in
5029 ============== ============================================= =======================================
5030 developer      The name of the developer.                    file templates, file header,
5031                                                              function description, ChangeLog entry,
5032                                                              bsd, gpl, snippets.
5034 initial        The developer's initials, e.g. "ET" for       file templates, file header,
5035                Enrico Tröger or "JFD" for John Foobar Doe.   function description, ChangeLog entry,
5036                                                              bsd, gpl, snippets.
5038 mail           The email address of the developer.           file templates, file header,
5039                                                              function description, ChangeLog entry,
5040                                                              bsd, gpl, snippets.
5042 company        The company the developer is working for.     file templates, file header,
5043                                                              function description, ChangeLog entry,
5044                                                              bsd, gpl, snippets.
5046 version        The initial version of a new file.            file templates, file header,
5047                                                              function description, ChangeLog entry,
5048                                                              bsd, gpl, snippets.
5049 ============== ============================================= =======================================
5051 Date & time wildcards
5052 *********************
5054 The format for these wildcards can be changed in the preferences
5055 dialog, see `Template preferences`_. For a list of available conversion
5056 specifiers see https://docs.gtk.org/glib/method.DateTime.format.html.
5058 ============== ============================================= =======================================
5059 Wildcard       Description                                   Available in
5060 ============== ============================================= =======================================
5061 year           The current year. Default format is: YYYY.    file templates, file header,
5062                                                              function description, ChangeLog entry,
5063                                                              bsd, gpl, snippets.
5065 date           The current date. Default format:             file templates, file header,
5066                YYYY-MM-DD.                                   function description, ChangeLog entry,
5067                                                              bsd, gpl, snippets.
5069 datetime       The current date and time. Default format:    file templates, file header,
5070                DD.MM.YYYY HH:mm:ss ZZZZ.                     function description, ChangeLog entry,
5071                                                              bsd, gpl, snippets.
5072 ============== ============================================= =======================================
5074 Dynamic wildcards
5075 *****************
5077 ============== ============================================= =======================================
5078 Wildcard       Description                                   Available in
5079 ============== ============================================= =======================================
5080 untitled       The string "untitled" (this will be           file templates, file header,
5081                translated to your locale), used in           function description, ChangeLog entry,
5082                file templates.                               bsd, gpl, snippets.
5084 geanyversion   The actual Geany version, e.g.                file templates, file header,
5085                "Geany |(version)|".                          function description, ChangeLog entry,
5086                                                              bsd, gpl, snippets.
5088 filename       The filename of the current file.             file header, snippets, file
5089                For new files, it's only replaced when        templates.
5090                first saving if found on the first 4 lines
5091                of the file.
5093 project        The current project's name, if any.           file header, snippets, file templates.
5095 description    The current project's description, if any.    file header, snippets, file templates.
5097 functionname   The function name of the function at the      function description.
5098                cursor position. This wildcard will only be
5099                replaced in the function description
5100                template.
5102 command:path   Executes the specified command and replace    file templates, file header,
5103                the wildcard with the command's standard      function description, ChangeLog entry,
5104                output. See `Special {command:} wildcard`_    bsd, gpl, snippets.
5105                for details.
5106 ============== ============================================= =======================================
5108 Template insertion wildcards
5109 ****************************
5111 ============== ============================================= =======================================
5112 Wildcard       Description                                   Available in
5113 ============== ============================================= =======================================
5114 gpl            This wildcard inserts a short GPL notice.     file header.
5116 bsd            This wildcard inserts a BSD licence notice.   file header.
5118 fileheader     The file header template. This wildcard       snippets, file templates.
5119                will only be replaced in file templates.
5120 ============== ============================================= =======================================
5123 Special {command:} wildcard
5124 ***************************
5126 The ``{command:}`` wildcard is a special one because it can execute
5127 a specified command and put the command's output (stdout) into
5128 the template.
5130 Example::
5132     {command:uname -a}
5134 will result in::
5136     Linux localhost 2.6.9-023stab046.2-smp #1 SMP Mon Dec 10 15:04:55 MSK 2007 x86_64 GNU/Linux
5138 Using this wildcard you can insert nearly any arbitrary text into the
5139 template.
5141 In the environment of the executed command the variables
5142 ``GEANY_FILENAME``, ``GEANY_FILETYPE`` and ``GEANY_FUNCNAME`` are set.
5143 The value of these variables is filled in only if Geany knows about it.
5144 For example, ``GEANY_FUNCNAME`` is only filled within the function
5145 description template. However, these variables are *always* set,
5146 just maybe with an empty value.
5147 You can easily access them e.g. within an executed shell script using::
5149     $GEANY_FILENAME
5152 .. note::
5153     If the specified command could not be found or not executed, the wildcard is substituted
5154     by an empty string. In such cases, you can find the occurred error message on Geany's
5155     standard error and in the *Help->Debug Messages* dialog.
5158 Customizing the toolbar
5159 -----------------------
5161 You can add, remove and reorder the elements in the toolbar by using
5162 the toolbar editor, or by manually editing the configuration file
5163 ``ui_toolbar.xml``.
5165 The toolbar editor can be opened from the preferences editor on the Toolbar tab or
5166 by right-clicking on the toolbar itself and choosing it from the menu.
5168 Manually editing the toolbar layout
5169 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5171 To override the system-wide configuration file, copy it to your user
5172 configuration directory (see `Configuration file paths`_).
5174 For example::
5176     % cp /usr/local/share/geany/ui_toolbar.xml /home/username/.config/geany/
5178 Then edit it and add any of the available elements listed in the file or remove
5179 any of the existing elements. Of course, you can also reorder the elements as
5180 you wish and add or remove additional separators.
5181 This file must be valid XML, otherwise the global toolbar UI definition
5182 will be used instead.
5184 Your changes are applied once you save the file.
5186 .. note::
5187     (1) You cannot add new actions which are not listed below.
5188     (2) Everything you add or change must be inside the /ui/toolbar/ path.
5191 Available toolbar elements
5192 ^^^^^^^^^^^^^^^^^^^^^^^^^^
5194 ================== ==============================================================================
5195 Element name       Description
5196 ================== ==============================================================================
5197 New                Create a new file
5198 Open               Open an existing file
5199 Save               Save the current file
5200 SaveAll            Save all open files
5201 Reload             Reload the current file from disk
5202 Close              Close the current file
5203 CloseAll           Close all open files
5204 Print              Print the current file
5205 Cut                Cut the current selection
5206 Copy               Copy the current selection
5207 Paste              Paste the contents of the clipboard
5208 Delete             Delete the current selection
5209 Undo               Undo the last modification
5210 Redo               Redo the last modification
5211 NavBack            Navigate back a location
5212 NavFor             Navigate forward a location
5213 Compile            Compile the current file
5214 Build              Build the current file, includes a submenu for Make commands. Geany
5215                    remembers the last chosen action from the submenu and uses this as default
5216                    action when the button itself is clicked.
5217 Run                Run or view the current file
5218 Color              Open a color chooser dialog, to interactively pick colors from a palette
5219 ZoomIn             Zoom in the text
5220 ZoomOut            Zoom out the text
5221 UnIndent           Decrease indentation
5222 Indent             Increase indentation
5223 Replace            Replace text in the current document
5224 SearchEntry        The search field belonging to the 'Search' element (can be used alone)
5225 Search             Find the entered text in the current file (only useful if you also
5226                    use 'SearchEntry')
5227 GotoEntry          The goto field belonging to the 'Goto' element (can be used alone)
5228 Goto               Jump to the entered line number (only useful if you also use 'GotoEntry')
5229 Preferences        Show the preferences dialog
5230 Quit               Quit Geany
5231 ================== ==============================================================================
5235 Plugin documentation
5236 ====================
5238 HTML Characters
5239 ---------------
5241 The HTML Characters plugin helps when working with special
5242 characters in XML/HTML, e.g. German Umlauts ü and ä.
5245 Insert entity dialog
5246 ^^^^^^^^^^^^^^^^^^^^
5248 When the plugin is enabled, you can insert special character
5249 entities using *Tools->Insert Special HTML Characters*.
5251 This opens up a dialog where you can find a huge amount of special
5252 characters sorted by category that you might like to use inside your
5253 document. You can expand and collapse the categories by clicking on
5254 the little arrow on the left hand side. Once you have found the
5255 desired character click on it and choose "Insert". This will insert
5256 the entity for the character at the current cursor position. You
5257 might also like to double click the chosen entity instead.
5260 Replace special chars by its entity
5261 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5263 To help make a XML/HTML document valid the plugin supports
5264 replacement of special chars known by the plugin. Both bulk
5265 replacement and immediate replacement during typing are supported.
5267 A few characters will not be replaced. These are
5268         * "
5269         * &
5270         * <
5271         * >
5272         *   (`&nbsp;`)
5275 At typing time
5276 ``````````````
5278 You can activate/deactivate this feature using the *Tools->HTML
5279 Replacement->Auto-replace Special Characters* menu item. If it's
5280 activated, all special characters (beside the given exceptions from
5281 above) known by the plugin will be replaced by their entities.
5283 You could also set a keybinding for the plugin to toggle the status
5284 of this feature.
5287 Bulk replacement
5288 ````````````````
5290 After inserting a huge amount of text, e.g. by using copy & paste, the
5291 plugin allows bulk replacement of all known characters (beside the
5292 mentioned exceptions). You can find the function under the same
5293 menu at *Tools->HTML Replacement->Replace Characters in Selection*, or
5294 configure a keybinding for the plugin.
5297 Save Actions
5298 ------------
5300 Auto Save
5301 ^^^^^^^^^
5303 This plugin provides an option to automatically save documents.
5304 You can choose to save the current document, or all of your documents, at
5305 a given delay.
5308 Save on focus out
5309 ^^^^^^^^^^^^^^^^^
5311 You can save the current document when the editor's focus goes out.
5312 Every pop-up, menu dialogs, or anything else that can make the editor lose the focus,
5313 will make the current document to be saved.
5316 Instant Save
5317 ^^^^^^^^^^^^
5318 This plugin sets on every new file (*File->New* or *File->New (with template)*)
5319 a randomly chosen filename and set its filetype appropriate to the used template
5320 or when no template was used, to a configurable default filetype.
5321 This enables you to quickly compile, build and/or run the new file without the
5322 need to give it an explicit filename using the Save As dialog. This might be
5323 useful when you often create new files just for testing some code or something
5324 similar.
5327 Backup Copy
5328 ^^^^^^^^^^^
5330 This plugin creates a backup copy of the current file in Geany when it is
5331 saved. You can specify the directory where the backup copy is saved and
5332 you can configure the automatically added extension in the configure dialog
5333 in Geany's plugin manager.
5335 After the plugin was loaded in Geany's plugin manager, every file is
5336 copied into the configured backup directory *after* the file has been saved
5337 in Geany.
5339 The created backup copy file permissions are set to read-write only for
5340 the user. This should help to not create world-readable files on possibly
5341 unsecure destination directories like /tmp (especially useful
5342 on multi-user systems).
5343 This applies only to non-Windows systems. On Windows, no explicit file
5344 permissions are set.
5347 Additionally, you can define how many levels of the original file's
5348 directory structure should be replicated in the backup copy path.
5349 For example, setting the option
5350 *Directory levels to include in the backup destination* to *2*
5351 cause the plugin to create the last two components of the original
5352 file's path in the backup copy path and place the new file there.
5355 Contributing to this document
5356 =============================
5358 This document (``geany.txt``) is written in `reStructuredText`__
5359 (or "reST"). The source file for it is located in Geany's ``doc``
5360 subdirectory.  If you intend on making changes, you should grab the
5361 source right from Git to make sure you've got the newest version.
5362 First, you need to configure the build system to generate the HTML
5363 documentation passing the *--enable-html-docs* option to the *configure*
5364 script. Then after editing the file, run ``make`` (from the root build
5365 directory or from the *doc* subdirectory) to build the HTML documentation
5366 and see how your changes look. This regenerates the ``geany.html`` file
5367 inside the *doc* subdirectory. To generate a PDF file, configure with
5368 *--enable-pdf-docs* and run ``make`` as for the HTML version. The generated
5369 PDF file is named geany-|(version)|.pdf and is located inside the *doc*
5370 subdirectory.
5372 __ http://docutils.sourceforge.net/rst.html
5374 After you are happy with your changes, create a patch e.g. by using::
5376     % git diff geany.txt > foo.patch
5378 or even better, by creating a Git-formatted patch which will keep authoring
5379 and description data, by first committing your changes (doing so in a fresh
5380 new branch is recommended for `master` not to diverge from upstream) and then
5381 using git format-patch::
5383     % git checkout -b my-documentation-changes # create a fresh branch
5384     % git commit geany.txt
5385     Write a good commit message...
5386     % git format-patch HEAD^
5387     % git checkout master # go back to master
5389 and then submit that file to the mailing list for review.
5391 Also you can clone the Geany repository at GitHub and send a pull request.
5393 Note, you will need the Python docutils software package installed
5394 to build the docs. The package is named ``python-docutils`` on Debian
5395 and Fedora systems.
5400 Scintilla keyboard commands
5401 ===========================
5403 Copyright © 1998, 2006 Neil Hodgson <neilh(at)scintilla(dot)org>
5405 This appendix is distributed under the terms of the License for
5406 Scintilla and SciTE. A copy of this license can be found in the file
5407 ``scintilla/License.txt`` included with the source code of this
5408 program and in the appendix of this document. See `License for
5409 Scintilla and SciTE`_.
5411 20 June 2006
5415 Keyboard commands
5416 -----------------
5418 Keyboard commands for Scintilla mostly follow common Windows and GTK+
5419 conventions. All move keys (arrows, page up/down, home and end)
5420 allows to extend or reduce the stream selection when holding the
5421 Shift key, and the rectangular selection when holding the
5422 appropriate keys (see `Column mode editing (rectangular selections)`_).
5424 Some keys may not be available with some national keyboards
5425 or because they are taken by the system such as by a window manager
5426 or GTK. Keyboard equivalents of menu commands are listed in the
5427 menus. Some less common commands with no menu equivalent are:
5429 =============================================   ======================
5430 Action                                          Shortcut key
5431 =============================================   ======================
5432 Magnify text size.                              Ctrl-Keypad+
5433 Reduce text size.                               Ctrl-Keypad-
5434 Restore text size to normal.                    Ctrl-Keypad/
5435 Indent block.                                   Tab
5436 Dedent block.                                   Shift-Tab
5437 Delete to start of word.                        Ctrl-BackSpace
5438 Delete to end of word.                          Ctrl-Delete
5439 Delete to start of line.                        Ctrl-Shift-BackSpace
5440 Go to start of document.                        Ctrl-Home
5441 Extend selection to start of document.          Ctrl-Shift-Home
5442 Go to start of display line.                    Alt-Home
5443 Extend selection to start of display line.      Alt-Shift-Home
5444 Go to end of document.                          Ctrl-End
5445 Extend selection to end of document.            Ctrl-Shift-End
5446 Extend selection to end of display line.        Alt-Shift-End
5447 Previous paragraph. Shift extends selection.    Ctrl-Up
5448 Next paragraph. Shift extends selection.        Ctrl-Down
5449 Previous word. Shift extends selection.         Ctrl-Left
5450 Next word. Shift extends selection.             Ctrl-Right
5451 =============================================   ======================
5456 Tips and tricks
5457 ===============
5459 Document notebook
5460 -----------------
5462 * Double-click on empty space in the notebook tab bar to open a
5463   new document.
5464 * Middle-click on a document's notebook tab to close the document.
5465 * Hold `Ctrl` and click on any notebook tab to switch to the last used
5466   document.
5467 * Double-click on a document's notebook tab to toggle all additional
5468   widgets (to show them again use the View menu or the keyboard
5469   shortcut). The interface pref must be enabled for this to work.
5471 Editor
5472 ------
5474 * Alt-scroll wheel moves up/down a page.
5475 * Ctrl-scroll wheel zooms in/out.
5476 * Shift-scroll wheel scrolls 8 characters right/left.
5477 * Ctrl-click on a word in a document to perform *Go to Symbol Definition*.
5478 * Ctrl-click on a bracket/brace to perform *Go to Matching Brace*.
5480 Interface
5481 ---------
5483 * Double-click on a symbol-list group to expand or compact it.
5485 GTK-related
5486 -----------
5488 * Scrolling the mouse wheel over a notebook tab bar will switch
5489   notebook pages.
5491 The following are derived from X-Windows features (but GTK still supports
5492 them on Windows):
5494 * Middle-click pastes the last selected text.
5495 * Middle-click on a scrollbar moves the scrollbar to that
5496   position without having to drag it.
5500 Compile-time options
5501 ====================
5503 There are some options which can only be changed at compile time,
5504 and some options which are used as the default for configurable
5505 options. To change these options, edit the appropriate source file
5506 in the ``src`` subdirectory. Look for a block of lines starting with
5507 ``#define GEANY_*``. Any definitions which are not listed here should
5508 not be changed.
5510 .. note::
5511     Most users should not need to change these options.
5513 src/geany.h
5514 -----------
5516 ==============================  ============================================  ==================
5517 Option                          Description                                   Default
5518 ==============================  ============================================  ==================
5519 GEANY_STRING_UNTITLED           A string used as the default name for new     untitled
5520                                 files. Be aware that the string can be
5521                                 translated, so change it only if you know
5522                                 what you are doing.
5523 GEANY_WINDOW_MINIMAL_WIDTH      The minimal width of the main window.         620
5524 GEANY_WINDOW_MINIMAL_HEIGHT     The minimal height of the main window.        440
5525 GEANY_WINDOW_DEFAULT_WIDTH      The default width of the main window at the   900
5526                                 first start.
5527 GEANY_WINDOW_DEFAULT_HEIGHT     The default height of the main window at the  600
5528                                 first start.
5529  **Windows specific**
5530 GEANY_USE_WIN32_DIALOG          Set this to 1 if you want to use the default  0
5531                                 Windows file open and save dialogs instead
5532                                 GTK's file open and save dialogs. The
5533                                 default Windows file dialogs are missing
5534                                 some nice features like choosing a filetype
5535                                 or an encoding. *Do not touch this setting
5536                                 when building on a non-Win32 system.*
5537 ==============================  ============================================  ==================
5539 project.h
5540 ---------
5542 ==============================  ============================================  ==================
5543 Option                          Description                                   Default
5544 ==============================  ============================================  ==================
5545 GEANY_PROJECT_EXT               The default filename extension for Geany      geany
5546                                 project files. It is used when creating new
5547                                 projects and as filter mask for the project
5548                                 open dialog.
5549 ==============================  ============================================  ==================
5551 filetypes.c
5552 -----------
5554 ==============================  ============================================  ==================
5555 Option                          Description                                   Default
5556 ==============================  ============================================  ==================
5557 GEANY_FILETYPE_SEARCH_LINES     The number of lines to search for the         2
5558                                 filetype with the extract filetype regex.
5559 ==============================  ============================================  ==================
5561 editor.h
5562 --------
5564 ==============================  ============================================  ==================
5565 Option                          Description                                   Default
5566 ==============================  ============================================  ==================
5567 GEANY_WORDCHARS                 These characters define word boundaries when  a string with:
5568                                 making selections and searching using word    a-z, A-Z, 0-9 and
5569                                 matching options.                             underscore.
5570 ==============================  ============================================  ==================
5572 keyfile.c
5573 ---------
5575 These are default settings that can be overridden in the `Preferences`_ dialog.
5577 ==============================  ============================================  ==================
5578 Option                          Description                                   Default
5579 ==============================  ============================================  ==================
5580 GEANY_MIN_SYMBOLLIST_CHARS      How many characters you need to type to       4
5581                                 trigger the autocompletion list.
5582 GEANY_DISK_CHECK_TIMEOUT        Time in seconds between checking a file for   30
5583                                 external changes.
5584 GEANY_DEFAULT_TOOLS_MAKE        The make tool. This can also include a path.  "make"
5585 GEANY_DEFAULT_TOOLS_TERMINAL    A terminal emulator command, see              See below.
5586                                 `Terminal emulators`_.
5587 GEANY_DEFAULT_TOOLS_BROWSER     A web browser. This can also include a path.  "firefox"
5588 GEANY_DEFAULT_TOOLS_PRINTCMD    A printing tool. It should be able to accept  "lpr"
5589                                 and process plain text files. This can also
5590                                 include a path.
5591 GEANY_DEFAULT_TOOLS_GREP        A grep tool. It should be compatible with     "grep"
5592                                 GNU grep. This can also include a path.
5593 GEANY_DEFAULT_MRU_LENGTH        The length of the "Recent files" list.        10
5594 GEANY_DEFAULT_FONT_SYMBOL_LIST  The font used in sidebar to show symbols and  "Sans 9"
5595                                 open files.
5596 GEANY_DEFAULT_FONT_MSG_WINDOW   The font used in the messages window.         "Sans 9"
5597 GEANY_DEFAULT_FONT_EDITOR       The font used in the editor window.           "Monospace 10"
5598 GEANY_TOGGLE_MARK               A string which is used to mark a toggled      "~ "
5599                                 comment.
5600 GEANY_MAX_AUTOCOMPLETE_WORDS    How many autocompletion suggestions should    30
5601                                 Geany provide.
5602 GEANY_DEFAULT_FILETYPE_REGEX    The default regex to extract filetypes from   See below.
5603                                 files.
5604 ==============================  ============================================  ==================
5606 .. _ft_regex:
5608 The GEANY_DEFAULT_FILETYPE_REGEX default value is  -\\*-\\s*([^\\s]+)\\s*-\\*- which finds Emacs filetypes.
5610 The GEANY_DEFAULT_TOOLS_TERMINAL default value on Windows is::
5612     cmd.exe /Q /C %c
5614 and on any non-Windows system is::
5616     xterm -e "/bin/sh %c"
5619 build.c
5620 -------
5622 ==============================  ============================================  ==================
5623 Option                          Description                                   Default
5624 ==============================  ============================================  ==================
5625 GEANY_BUILD_ERR_HIGHLIGHT_MAX   Amount of build error indicators to           50
5626                                 be shown in the editor window.
5627                                 This affects the special coloring
5628                                 when Geany detects a compiler output line as
5629                                 an error message and then highlights the
5630                                 corresponding line in the source code.
5631                                 Usually only the first few messages are
5632                                 interesting because following errors are
5633                                 just after-effects.
5634                                 All errors in the Compiler window are parsed
5635                                 and unaffected by this value.
5636 PRINTBUILDCMDS                  Every time a build menu item priority         FALSE
5637                                 calculation is run, print the state of the
5638                                 menu item table in the form of the table
5639                                 in `Build Menu Configuration`_.  May be
5640                                 useful to debug configuration file
5641                                 overloading.  Warning produces a lot of
5642                                 output.  Can also be enabled/disabled by the
5643                                 debugger by setting printbuildcmds to 1/0
5644                                 overriding the compile setting.
5645 ==============================  ============================================  ==================
5649 GNU General Public License
5650 ==========================
5654                 GNU GENERAL PUBLIC LICENSE
5655                    Version 2, June 1991
5657      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5658         51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
5659      Everyone is permitted to copy and distribute verbatim copies
5660      of this license document, but changing it is not allowed.
5662                     Preamble
5664       The licenses for most software are designed to take away your
5665     freedom to share and change it.  By contrast, the GNU General Public
5666     License is intended to guarantee your freedom to share and change free
5667     software--to make sure the software is free for all its users.  This
5668     General Public License applies to most of the Free Software
5669     Foundation's software and to any other program whose authors commit to
5670     using it.  (Some other Free Software Foundation software is covered by
5671     the GNU Library General Public License instead.)  You can apply it to
5672     your programs, too.
5674       When we speak of free software, we are referring to freedom, not
5675     price.  Our General Public Licenses are designed to make sure that you
5676     have the freedom to distribute copies of free software (and charge for
5677     this service if you wish), that you receive source code or can get it
5678     if you want it, that you can change the software or use pieces of it
5679     in new free programs; and that you know you can do these things.
5681       To protect your rights, we need to make restrictions that forbid
5682     anyone to deny you these rights or to ask you to surrender the rights.
5683     These restrictions translate to certain responsibilities for you if you
5684     distribute copies of the software, or if you modify it.
5686       For example, if you distribute copies of such a program, whether
5687     gratis or for a fee, you must give the recipients all the rights that
5688     you have.  You must make sure that they, too, receive or can get the
5689     source code.  And you must show them these terms so they know their
5690     rights.
5692       We protect your rights with two steps: (1) copyright the software, and
5693     (2) offer you this license which gives you legal permission to copy,
5694     distribute and/or modify the software.
5696       Also, for each author's protection and ours, we want to make certain
5697     that everyone understands that there is no warranty for this free
5698     software.  If the software is modified by someone else and passed on, we
5699     want its recipients to know that what they have is not the original, so
5700     that any problems introduced by others will not reflect on the original
5701     authors' reputations.
5703       Finally, any free program is threatened constantly by software
5704     patents.  We wish to avoid the danger that redistributors of a free
5705     program will individually obtain patent licenses, in effect making the
5706     program proprietary.  To prevent this, we have made it clear that any
5707     patent must be licensed for everyone's free use or not licensed at all.
5709       The precise terms and conditions for copying, distribution and
5710     modification follow.
5712                 GNU GENERAL PUBLIC LICENSE
5713        TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
5715       0. This License applies to any program or other work which contains
5716     a notice placed by the copyright holder saying it may be distributed
5717     under the terms of this General Public License.  The "Program", below,
5718     refers to any such program or work, and a "work based on the Program"
5719     means either the Program or any derivative work under copyright law:
5720     that is to say, a work containing the Program or a portion of it,
5721     either verbatim or with modifications and/or translated into another
5722     language.  (Hereinafter, translation is included without limitation in
5723     the term "modification".)  Each licensee is addressed as "you".
5725     Activities other than copying, distribution and modification are not
5726     covered by this License; they are outside its scope.  The act of
5727     running the Program is not restricted, and the output from the Program
5728     is covered only if its contents constitute a work based on the
5729     Program (independent of having been made by running the Program).
5730     Whether that is true depends on what the Program does.
5732       1. You may copy and distribute verbatim copies of the Program's
5733     source code as you receive it, in any medium, provided that you
5734     conspicuously and appropriately publish on each copy an appropriate
5735     copyright notice and disclaimer of warranty; keep intact all the
5736     notices that refer to this License and to the absence of any warranty;
5737     and give any other recipients of the Program a copy of this License
5738     along with the Program.
5740     You may charge a fee for the physical act of transferring a copy, and
5741     you may at your option offer warranty protection in exchange for a fee.
5743       2. You may modify your copy or copies of the Program or any portion
5744     of it, thus forming a work based on the Program, and copy and
5745     distribute such modifications or work under the terms of Section 1
5746     above, provided that you also meet all of these conditions:
5748         a) You must cause the modified files to carry prominent notices
5749         stating that you changed the files and the date of any change.
5751         b) You must cause any work that you distribute or publish, that in
5752         whole or in part contains or is derived from the Program or any
5753         part thereof, to be licensed as a whole at no charge to all third
5754         parties under the terms of this License.
5756         c) If the modified program normally reads commands interactively
5757         when run, you must cause it, when started running for such
5758         interactive use in the most ordinary way, to print or display an
5759         announcement including an appropriate copyright notice and a
5760         notice that there is no warranty (or else, saying that you provide
5761         a warranty) and that users may redistribute the program under
5762         these conditions, and telling the user how to view a copy of this
5763         License.  (Exception: if the Program itself is interactive but
5764         does not normally print such an announcement, your work based on
5765         the Program is not required to print an announcement.)
5767     These requirements apply to the modified work as a whole.  If
5768     identifiable sections of that work are not derived from the Program,
5769     and can be reasonably considered independent and separate works in
5770     themselves, then this License, and its terms, do not apply to those
5771     sections when you distribute them as separate works.  But when you
5772     distribute the same sections as part of a whole which is a work based
5773     on the Program, the distribution of the whole must be on the terms of
5774     this License, whose permissions for other licensees extend to the
5775     entire whole, and thus to each and every part regardless of who wrote it.
5777     Thus, it is not the intent of this section to claim rights or contest
5778     your rights to work written entirely by you; rather, the intent is to
5779     exercise the right to control the distribution of derivative or
5780     collective works based on the Program.
5782     In addition, mere aggregation of another work not based on the Program
5783     with the Program (or with a work based on the Program) on a volume of
5784     a storage or distribution medium does not bring the other work under
5785     the scope of this License.
5787       3. You may copy and distribute the Program (or a work based on it,
5788     under Section 2) in object code or executable form under the terms of
5789     Sections 1 and 2 above provided that you also do one of the following:
5791         a) Accompany it with the complete corresponding machine-readable
5792         source code, which must be distributed under the terms of Sections
5793         1 and 2 above on a medium customarily used for software interchange; or,
5795         b) Accompany it with a written offer, valid for at least three
5796         years, to give any third party, for a charge no more than your
5797         cost of physically performing source distribution, a complete
5798         machine-readable copy of the corresponding source code, to be
5799         distributed under the terms of Sections 1 and 2 above on a medium
5800         customarily used for software interchange; or,
5802         c) Accompany it with the information you received as to the offer
5803         to distribute corresponding source code.  (This alternative is
5804         allowed only for noncommercial distribution and only if you
5805         received the program in object code or executable form with such
5806         an offer, in accord with Subsection b above.)
5808     The source code for a work means the preferred form of the work for
5809     making modifications to it.  For an executable work, complete source
5810     code means all the source code for all modules it contains, plus any
5811     associated interface definition files, plus the scripts used to
5812     control compilation and installation of the executable.  However, as a
5813     special exception, the source code distributed need not include
5814     anything that is normally distributed (in either source or binary
5815     form) with the major components (compiler, kernel, and so on) of the
5816     operating system on which the executable runs, unless that component
5817     itself accompanies the executable.
5819     If distribution of executable or object code is made by offering
5820     access to copy from a designated place, then offering equivalent
5821     access to copy the source code from the same place counts as
5822     distribution of the source code, even though third parties are not
5823     compelled to copy the source along with the object code.
5825       4. You may not copy, modify, sublicense, or distribute the Program
5826     except as expressly provided under this License.  Any attempt
5827     otherwise to copy, modify, sublicense or distribute the Program is
5828     void, and will automatically terminate your rights under this License.
5829     However, parties who have received copies, or rights, from you under
5830     this License will not have their licenses terminated so long as such
5831     parties remain in full compliance.
5833       5. You are not required to accept this License, since you have not
5834     signed it.  However, nothing else grants you permission to modify or
5835     distribute the Program or its derivative works.  These actions are
5836     prohibited by law if you do not accept this License.  Therefore, by
5837     modifying or distributing the Program (or any work based on the
5838     Program), you indicate your acceptance of this License to do so, and
5839     all its terms and conditions for copying, distributing or modifying
5840     the Program or works based on it.
5842       6. Each time you redistribute the Program (or any work based on the
5843     Program), the recipient automatically receives a license from the
5844     original licensor to copy, distribute or modify the Program subject to
5845     these terms and conditions.  You may not impose any further
5846     restrictions on the recipients' exercise of the rights granted herein.
5847     You are not responsible for enforcing compliance by third parties to
5848     this License.
5850       7. If, as a consequence of a court judgment or allegation of patent
5851     infringement or for any other reason (not limited to patent issues),
5852     conditions are imposed on you (whether by court order, agreement or
5853     otherwise) that contradict the conditions of this License, they do not
5854     excuse you from the conditions of this License.  If you cannot
5855     distribute so as to satisfy simultaneously your obligations under this
5856     License and any other pertinent obligations, then as a consequence you
5857     may not distribute the Program at all.  For example, if a patent
5858     license would not permit royalty-free redistribution of the Program by
5859     all those who receive copies directly or indirectly through you, then
5860     the only way you could satisfy both it and this License would be to
5861     refrain entirely from distribution of the Program.
5863     If any portion of this section is held invalid or unenforceable under
5864     any particular circumstance, the balance of the section is intended to
5865     apply and the section as a whole is intended to apply in other
5866     circumstances.
5868     It is not the purpose of this section to induce you to infringe any
5869     patents or other property right claims or to contest validity of any
5870     such claims; this section has the sole purpose of protecting the
5871     integrity of the free software distribution system, which is
5872     implemented by public license practices.  Many people have made
5873     generous contributions to the wide range of software distributed
5874     through that system in reliance on consistent application of that
5875     system; it is up to the author/donor to decide if he or she is willing
5876     to distribute software through any other system and a licensee cannot
5877     impose that choice.
5879     This section is intended to make thoroughly clear what is believed to
5880     be a consequence of the rest of this License.
5882       8. If the distribution and/or use of the Program is restricted in
5883     certain countries either by patents or by copyrighted interfaces, the
5884     original copyright holder who places the Program under this License
5885     may add an explicit geographical distribution limitation excluding
5886     those countries, so that distribution is permitted only in or among
5887     countries not thus excluded.  In such case, this License incorporates
5888     the limitation as if written in the body of this License.
5890       9. The Free Software Foundation may publish revised and/or new versions
5891     of the General Public License from time to time.  Such new versions will
5892     be similar in spirit to the present version, but may differ in detail to
5893     address new problems or concerns.
5895     Each version is given a distinguishing version number.  If the Program
5896     specifies a version number of this License which applies to it and "any
5897     later version", you have the option of following the terms and conditions
5898     either of that version or of any later version published by the Free
5899     Software Foundation.  If the Program does not specify a version number of
5900     this License, you may choose any version ever published by the Free Software
5901     Foundation.
5903       10. If you wish to incorporate parts of the Program into other free
5904     programs whose distribution conditions are different, write to the author
5905     to ask for permission.  For software which is copyrighted by the Free
5906     Software Foundation, write to the Free Software Foundation; we sometimes
5907     make exceptions for this.  Our decision will be guided by the two goals
5908     of preserving the free status of all derivatives of our free software and
5909     of promoting the sharing and reuse of software generally.
5911                     NO WARRANTY
5913       11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
5914     FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
5915     OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
5916     PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
5917     OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
5918     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
5919     TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
5920     PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
5921     REPAIR OR CORRECTION.
5923       12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
5924     WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
5925     REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
5926     INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
5927     OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
5928     TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
5929     YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
5930     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
5931     POSSIBILITY OF SUCH DAMAGES.
5933                  END OF TERMS AND CONDITIONS
5935             How to Apply These Terms to Your New Programs
5937       If you develop a new program, and you want it to be of the greatest
5938     possible use to the public, the best way to achieve this is to make it
5939     free software which everyone can redistribute and change under these terms.
5941       To do so, attach the following notices to the program.  It is safest
5942     to attach them to the start of each source file to most effectively
5943     convey the exclusion of warranty; and each file should have at least
5944     the "copyright" line and a pointer to where the full notice is found.
5946         <one line to give the program's name and a brief idea of what it does.>
5947         Copyright (C) <year>  <name of author>
5949         This program is free software; you can redistribute it and/or modify
5950         it under the terms of the GNU General Public License as published by
5951         the Free Software Foundation; either version 2 of the License, or
5952         (at your option) any later version.
5954         This program is distributed in the hope that it will be useful,
5955         but WITHOUT ANY WARRANTY; without even the implied warranty of
5956         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5957         GNU General Public License for more details.
5959         You should have received a copy of the GNU General Public License along
5960         with this program; if not, write to the Free Software Foundation, Inc.,
5961         51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
5964     Also add information on how to contact you by electronic and paper mail.
5966     If the program is interactive, make it output a short notice like this
5967     when it starts in an interactive mode:
5969         Gnomovision version 69, Copyright (C) year  name of author
5970         Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
5971         This is free software, and you are welcome to redistribute it
5972         under certain conditions; type `show c' for details.
5974     The hypothetical commands `show w' and `show c' should show the appropriate
5975     parts of the General Public License.  Of course, the commands you use may
5976     be called something other than `show w' and `show c'; they could even be
5977     mouse-clicks or menu items--whatever suits your program.
5979     You should also get your employer (if you work as a programmer) or your
5980     school, if any, to sign a "copyright disclaimer" for the program, if
5981     necessary.  Here is a sample; alter the names:
5983       Yoyodyne, Inc., hereby disclaims all copyright interest in the program
5984       `Gnomovision' (which makes passes at compilers) written by James Hacker.
5986       <signature of Ty Coon>, 1 April 1989
5987       Ty Coon, President of Vice
5989     This General Public License does not permit incorporating your program into
5990     proprietary programs.  If your program is a subroutine library, you may
5991     consider it more useful to permit linking proprietary applications with the
5992     library.  If this is what you want to do, use the GNU Library General
5993     Public License instead of this License.
5998 License for Scintilla and SciTE
5999 ===============================
6001 Copyright 1998-2003 by Neil Hodgson <neilh(at)scintilla(dot)org>
6003 All Rights Reserved
6005 Permission to use, copy, modify, and distribute this software and
6006 its documentation for any purpose and without fee is hereby granted,
6007 provided that the above copyright notice appear in all copies and
6008 that both that copyright notice and this permission notice appear in
6009 supporting documentation.
6011 NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
6012 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
6013 NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
6014 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
6015 OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
6016 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
6017 USE OR PERFORMANCE OF THIS SOFTWARE.