1 .. |(version)| replace:: 2.1
2 .. -*- reStructuredText -*-
8 -------------------------
9 A fast, light, GTK+ IDE
10 -------------------------
12 :Authors: Enrico Tröger,
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`_.
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:
50 * Autocompletion of symbols/words
51 * Construct completion/snippets
52 * Auto-closing of XML and HTML tags
54 * Many supported filetypes including C, Java, PHP, HTML, Python, Perl,
58 * Build system to compile and execute your code
59 * Simple project management
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.
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`_.
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`_.
106 You will need the GTK (>= 3.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.
115 There are many binary packages available. For an up-to-date but maybe
116 incomplete list see https://www.geany.org/Download/ThirdPartyPackages.
122 Compiling Geany is quite easy.
123 To do so, you need the GTK (>= 3.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 https://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::
152 The configure script supports several common options, for a detailed
158 You may also want to read the INSTALL file for advanced installation
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.
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.
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.
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`_.
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
222 The Geany window is shown in the following figure:
224 .. image:: ./images/main_window.png
227 Screenshots in this document are taken with the default GTK Adwaita
228 theme, but Geany will adapt to the desktop GTK theme that is set.
230 The workspace has the following parts:
233 * An optional toolbar.
234 * An optional sidebar that can show the following tabs:
236 * Documents - A `document list <#document-list-views>`_.
237 * Symbols - A list of symbols in your code.
239 * The main editor window.
240 * An optional message window which can show the following tabs:
242 * Status - A list of status messages.
243 * Compiler - The output of compiling or building programs.
244 * Messages - Results of `Find Usage`_, `Find in Files`_ and other actions
245 * Scribble - A text scratchpad for any use.
246 * Terminal - An optional `terminal window <#virtual-terminal-emulator-widget-vte>`_.
250 Most of these can be configured in the `Interface preferences`_, the
251 `View menu`_, or the popup menu for the relevant area.
253 Additional tabs may be added to the sidebar and message window by plugins.
255 The position of the tabs can be selected in the interface preferences.
257 The sizes of the sidebar and message window can be adjusted by
258 dragging the dividers.
263 The sidebar has a right click menu that can control what is visible and
264 has actions specific to the tab (other tabs added by plugins are
265 described by that plugin documentation):
269 * expand/collapse the tree
270 * control sorting order
271 * control whether to group symbols by their type
272 * locate the symbol in documents
274 The symbols tab can also be filtered by typing a string into
275 the entry at the top of the tab. All symbols that contain the entered
276 string as a substring will be shown in the tree. Multiple filters can
277 be separated by a space.
281 * expand/collapse the tree
282 * save to or reload from files
283 * search tree based at selected file
284 * show or hide the document paths
289 ============ ======================= =================================================
290 Short option Long option Function
291 ============ ======================= =================================================
292 *none* +number Set initial line number for the first opened file
293 (same as --line, do not put a space between the + sign
294 and the number). E.g. "geany +7 foo.bar" will open the
295 file foo.bar and place the cursor in line 7.
297 *none* --column Set initial column number for the first opened file.
299 -c dir_name --config=directory_name Use an alternate configuration directory. The default
300 configuration directory is ``~/.config/geany/`` and that
301 is where ``geany.conf`` and other configuration files
304 *none* --ft-names Print a list of Geany's internal filetype names (useful
305 for snippets configuration).
307 -g --generate-tags Generate a global tags file (see
308 `Generating a global tags file`_).
310 -P --no-preprocessing Don't preprocess C/C++ files when generating tags file.
312 -i --new-instance Do not open files in a running instance, force opening
313 a new instance. Only available if Geany was compiled
314 with support for Sockets.
316 -l --line Set initial line number for the first opened file.
318 *none* --list-documents Return a list of open documents in a running Geany
320 This can be used to read the currently opened documents in
321 Geany from an external script or tool. The returned list
322 is separated by newlines (LF) and consists of the full,
323 UTF-8 encoded filenames of the documents.
324 Only available if Geany was compiled with support for
327 -m --no-msgwin Do not show the message window. Use this option if you
328 do not need compiler messages or VTE support.
330 -n --no-ctags Do not load symbol completion and call tip data. Use this
331 option if you do not want to use them.
333 -p --no-plugins Do not load plugins or plugin support.
335 *none* --print-prefix Print installation prefix, the data directory, the lib
336 directory and the locale directory (in that order) to
337 stdout, one line each. This is mainly intended for plugin
338 authors to detect installation paths.
340 -r --read-only Open all files given on the command line in read-only mode.
341 This only applies to files opened explicitly from the command
342 line, so files from previous sessions or project files are
345 -s --no-session Do not load the previous session's files.
347 -t --no-terminal Do not load terminal support. Use this option if you do
348 not want to load the virtual terminal emulator widget
349 at startup. If you do not have ``libvte.so.4`` installed,
350 then terminal-support is automatically disabled. Only
351 available if Geany was compiled with support for VTE.
353 *none* --socket-file Use this socket filename for communication with a
354 running Geany instance. This can be used with the following
355 command to execute Geany on the current workspace::
357 geany --socket-file=/tmp/geany-sock-$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}')
359 *none* --vte-lib Specify explicitly the path including filename or only
360 the filename to the VTE library, e.g.
361 ``/usr/lib/libvte.so`` or ``libvte.so``. This option is
362 only needed when the auto-detection does not work. Only
363 available if Geany was compiled with support for VTE.
365 -v --verbose Be verbose (print useful status messages).
367 -V --version Show version information and exit.
369 -? --help Show help information and exit.
371 *none* *files ...* Open all given filenames at startup.
372 If a running instance is detected, pass filenames
373 *file:line ...* to it instead.
375 *file:line:col ...* Geany also recognizes line and column information when
376 appended to the filename with colons, e.g.
377 ``geany foo.bar:10:5`` will open the file ``foo.bar`` and
378 place the cursor in line 10 at column 5.
380 If a filename does not exist, create a new document
381 with the desired filename if the
382 *Open new files from the command-line*
383 `file pref <#files-preferences>`_ is set.
385 A project can also be opened, but the project filename (\*.geany)
386 must be the first non-option argument. Any other
387 project filenames will be opened as text files.
388 ============ ======================= =================================================
390 Geany also supports all generic GTK options, a list is available on the
400 At startup, Geany loads all files from the last time Geany was
401 launched. You can disable this feature in the preferences dialog
402 (see `General Startup preferences`_).
404 You can start several instances of Geany, but only the first will
405 load files from the last session. In the subsequent instances, you
406 can find these files in the file menu under the *Recent files* item.
407 By default this contains the last 10 recently opened files. You can
408 change the number of recently opened files in the
409 `Files tab <#files-preferences>`_ of the preferences dialog.
411 To run a second instance of Geany, do not specify any filenames on
412 the command-line, or disable opening files in a running instance
413 using the ``-i`` `command line option <#command-line-options>`_.
421 The *File->Open* command will show a dialog to choose one or more text
422 files to open. There is a list of file filters on the right with the
425 * All files (default)
426 * All source - a combination of all the patterns for each filetype (see
427 `Filetype extensions`_)
428 * Individual filetypes
430 Clicking *More options* will reveal controls to open files with a
431 specific filetype and/or encoding (see `Character sets and Unicode
432 Byte-Order-Mark (BOM)`_).
435 Opening files from the command-line in a running instance
436 `````````````````````````````````````````````````````````
438 Geany detects if there is an instance of itself already running and opens files
439 from the command-line in that instance. So, Geany can
440 be used to view and edit files by opening them from other programs
441 such as a file manager.
443 You can also pass line number and column number information, e.g.::
445 geany some_file.foo:55:4
447 This would open the file ``some_file.foo`` with the cursor on line 55,
450 If you do not like this for some reason, you can disable using the first
451 instance by using the appropriate command line option -- see the section
452 called `Command line options`_.
455 Virtual terminal emulator widget (VTE)
456 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
458 If you have installed ``libvte.so`` on your system, it is loaded
459 automatically by Geany, and you will have a terminal widget in the
460 notebook at the bottom.
462 If Geany cannot find any ``libvte.so`` at startup, the terminal widget
463 will not be loaded. So there is no need to install the package containing
464 this file in order to run Geany. Additionally, you can disable the use
465 of the terminal widget by command line option, for more information
466 see the section called `Command line options`_.
468 You can use this terminal (from now on called VTE) much as you would
469 a terminal program like xterm. There is basic clipboard support. You
470 can paste the contents of the clipboard by pressing the right mouse
471 button to open the popup menu, and choosing Paste. To copy text from
472 the VTE, just select the desired text and then press the right mouse
473 button and choose Copy from the popup menu. On systems running the
474 X Window System you can paste the last selected text by pressing the
475 middle mouse button in the VTE (on 2-button mice, the middle button
476 can often be simulated by pressing both mouse buttons together).
478 In the preferences dialog you can specify a shell which should be
479 started in the VTE. To make the specified shell a login shell just
480 use the appropriate command line options for the shell. These options
481 should be found in the manual page of the shell. For zsh and bash
482 you can use the argument ``--login``.
485 Geany tries to load ``libvte.so``. If this fails, it tries to load
486 some other filenames. If this fails too, you should check whether you
487 installed libvte correctly. Again note, Geany will run without this
490 It could be, that the library is called something else than
491 ``libvte.so`` (e.g. on FreeBSD 6.0 it is called ``libvte.so.8``). If so
492 please set a link to the correct file (as root)::
494 # ln -s /usr/lib/libvte.so.X /usr/lib/libvte.so
496 Obviously, you have to adjust the paths and set X to the number of your
499 You can also specify the filename of the VTE library to use on the command
500 line (see the section called `Command line options`_) or at compile time
501 by specifying the command line option ``--with-vte-module-path`` to
508 Switching between documents
509 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
511 The documents list and the editor tabs are two different ways
512 to switch between documents using the mouse. When you hit the key
513 combination to move between tabs, the order is determined by the tab
514 order. It is not alphabetical as shown in the documents list
515 (regardless of whether or not editor tabs are visible).
517 See the `Notebook tab keybindings`_ section for useful
518 shortcuts including for Most-Recently-Used document switching.
523 There are three different ways to display documents on the sidebar if *Show
524 documents list* is active. To switch between views press the right mouse button
525 on the documents list and select one of these items:
528 Show only file names of open documents in sorted order.
530 .. image:: ./images/sidebar_documents_only.png
533 Show open documents as a two-level tree in which first level is the paths
534 of directories containing open files and the second level is the file names of
535 the documents open in that path. All documents with the same path are grouped
536 together under the same first level item. Paths are in sorted order and
537 documents are sorted within each group.
539 .. image:: ./images/sidebar_show_paths.png
542 Show paths as above, but as a multiple level partial tree. The tree is only
543 expanded at positions where two or more directory paths to open documents
544 share the same prefix. The common prefix is shown as a parent level, and
545 the remainder of those paths are shown as child levels. This applies
546 recursively down the paths making a tree to the file names of open documents,
547 which are grouped in sorted order as an additional level below the last path
550 For convenience two common file locations are handled specially, open
551 files below the users home directory and open files below an open project
552 base path. Each of these is moved to its own top level tree instead of
553 being in place in the normal tree. The top level of these trees are each
554 labelled differently. For the home directory tree the path of the home
555 directory is shown as ``~``, and for the project tree the path to the project
556 base path is shown simply as the project name.
558 .. image:: ./images/sidebar_show_tree.png
560 In all cases paths and file names that do not fit in the width available are ellipsised.
564 The `Document->Clone` menu item copies the current document's text,
565 cursor position and properties into a new untitled document. If
566 there is a selection, only the selected text is copied. This can be
567 useful when making temporary copies of text or for creating
568 documents with similar or identical contents.
570 Automatic filename insertion on `Save As...`
571 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
572 If a document is saved via `Document->Save As...` then the filename is
573 automatically inserted into the comment header replacing text like
574 `untitled.ext` in the first 3 lines of the file. E.g. if a new ``.c``
575 file is created using `File->New (with Template)` then the text `untitled.c`
576 in line 2 would be replaced with the choosen file name on `Save As...`
577 (this example assumes the default file templates being used).
580 Character sets and Unicode Byte-Order-Mark (BOM)
581 ------------------------------------------------
587 Geany provides support for detecting and converting character sets. So
588 you can open and save files in different character sets, and even
589 convert a file from one character set to another. To do this,
590 Geany uses the character conversion capabilities of the GLib library.
592 Only text files are supported, i.e. opening files which contain
593 NULL-bytes may fail. Geany will try to open the file anyway but it is
594 likely that the file will be truncated because it can only be read up
595 to the first occurrence of a NULL-byte. All characters after this
596 position are lost and are not written when you save the file.
598 Geany tries to detect the encoding of a file while opening it, but
599 auto-detecting the encoding of a file is not easy and sometimes an
600 encoding might not be detected correctly. In this case you have to
601 set the encoding of the file manually in order to display it
602 correctly. You can this in the file open dialog by selecting an
603 encoding in the drop down box or by reloading the file with the
604 file menu item "Reload as". The auto-detection works well for most
605 encodings but there are also some encodings where it is known that
606 auto-detection has problems.
608 There are different ways to set different encodings in Geany:
610 * Using the file open dialog
612 This opens the file with the encoding specified in the encoding drop
613 down box. If the encoding is set to "Detect from file" auto-detection
614 will be used. If the encoding is set to "Without encoding (None)" the
615 file will be opened without any character conversion and Geany will
616 not try to auto-detect the encoding (see below for more information).
618 * Using the "Reload as" menu item
620 This item reloads the current file with the specified encoding. It can
621 help if you opened a file and found out that the wrong encoding was used.
623 * Using the "Set encoding" menu item
625 Contrary to the above two options, this will not change or reload
626 the current file unless you save it. It is useful when you want to
627 change the encoding of the file.
629 * Specifying the encoding in the file itself
631 As mentioned above, auto-detecting the encoding of a file may fail on
632 some encodings. If you know that Geany doesn't open a certain file,
633 you can add the specification line, described in the next section,
634 to the beginning of the file to force Geany to use a specific
635 encoding when opening the file.
638 In-file encoding specification
639 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
641 Geany detects meta tags of HTML files which contain charset information
644 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15" />
646 and the specified charset is used when opening the file. This is useful if the
647 encoding of the file cannot be detected properly.
648 For non-HTML files you can also define a line like::
650 /* geany_encoding=ISO-8859-15 */
654 # geany_encoding=ISO-8859-15 #
656 to force an encoding to be used. The #, /\* and \*/ are examples
657 of filetype-specific comment characters. It doesn't matter which
658 characters are around the string " geany_encoding=ISO-8859-15 " as long
659 as there is at least one whitespace character before and after this
660 string. Whitespace characters are in this case a space or tab character.
661 An example to use this could be you have a file with ISO-8859-15
662 encoding but Geany constantly detects the file encoding as ISO-8859-1.
663 Then you simply add such a line to the file and Geany will open it
664 correctly the next time.
666 Since Geany 0.15 you can also use lines which match the
667 regular expression used to find the encoding string:
668 ``coding[\t ]*[:=][\t ]*([a-z0-9-]+)[\t ]*``
671 These specifications must be in the first 512 bytes of the file.
672 Anything after the first 512 bytes will not be recognized.
676 # encoding = ISO-8859-15
680 # coding: ISO-8859-15
682 Special encoding "None"
683 ^^^^^^^^^^^^^^^^^^^^^^^
685 There is a special encoding "None" which uses no
686 encoding. It is useful when you know that Geany cannot auto-detect
687 the encoding of a file and it is not displayed correctly. Especially
688 when the file contains NULL-bytes this can be useful to skip auto
689 detection and open the file properly at least until the occurrence
690 of the first NULL-byte. Using this encoding opens the file as it is
691 without any character conversion.
694 Unicode Byte-Order-Mark (BOM)
695 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
697 Furthermore, Geany detects a Unicode Byte Order Mark (see
698 https://en.wikipedia.org/wiki/Byte_Order_Mark for details). Of course,
699 this feature is only available if the opened file is in a Unicode
700 encoding. The Byte Order Mark helps to detect the encoding of a file,
701 e.g. whether it is UTF-16LE or UTF-16BE and so on. On Unix-like systems
702 using a Byte Order Mark could cause some problems for programs not
703 expecting it, e.g. the compiler gcc stops
704 with stray errors, PHP does not parse a script containing a BOM and
705 script files starting with a she-bang maybe cannot be started. In the
706 status bar you can easily see whether the file starts with a BOM or
709 If you want to set a BOM for a file or if you want to remove it
710 from a file, just use the document menu and toggle the checkbox.
713 If you are unsure what a BOM is or if you do not understand where
714 to use it, then it is probably not important for you and you can
726 Geany provides basic code folding support. Folding means the ability to
727 show and hide parts of the text in the current file. You can hide
728 unimportant code sections and concentrate on the parts you are working on
729 and later you can show hidden sections again. In the editor window there is
730 a small grey margin on the left side with [+] and [-] symbols which
731 show hidden parts and hide parts of the file respectively. By
732 clicking on these icons you can simply show and hide sections which are
733 marked by vertical lines within this margin. For many filetypes nested
734 folding is supported, so there may be several fold points within other
738 You can customize the folding icon and line styles - see the
739 filetypes.common `Folding Settings`_.
741 If you don't like it or don't need it at all, you can simply disable
742 folding support completely in the preferences dialog.
744 The folding behaviour can be changed with the "Fold/Unfold all children of
745 a fold point" option in the preference dialog. If activated, Geany will
746 unfold all nested fold points below the current one if they are already
747 folded (when clicking on a [+] symbol).
748 When clicking on a [-] symbol, Geany will fold all nested fold points
749 below the current one if they are unfolded.
751 This option can be inverted by pressing the Shift
752 key while clicking on a fold symbol. That means, if the "Fold/Unfold all
753 children of a fold point" option is enabled, pressing Shift will disable
754 it for this click and vice versa.
757 Column mode editing (rectangular selections)
758 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
760 There is basic support for column mode editing. To use it, create a
761 rectangular selection by holding down the Control and Shift keys
762 (or Alt and Shift on Windows) while selecting some text.
763 Once a rectangular selection exists you can start editing the text within
764 this selection and the modifications will be done for every line in the
767 It is also possible to create a zero-column selection - this is
768 useful to insert text on multiple lines.
770 Drag and drop of text
771 ^^^^^^^^^^^^^^^^^^^^^
773 If you drag selected text in the editor widget of Geany the text is
774 moved to the position where the mouse pointer is when releasing the
775 mouse button. Holding Control when releasing the mouse button will
776 copy the text instead. This behaviour was changed in Geany 0.11 -
777 before the selected text was copied to the new position.
783 Geany allows each document to indent either with a tab character,
784 multiple spaces or a combination of both.
786 The *Tabs* setting indents with one tab character per indent level, and
787 displays tabs as the indent width.
789 The *Spaces* setting indents with the number of spaces set in the indent
790 width for each level.
792 The *Tabs and Spaces* setting indents with spaces as above, then converts
793 as many spaces as it can to tab characters at the rate of one tab for
794 each multiple of the `Various preference` setting
795 *indent_hard_tab_width* (default 8) and displays tabs as the
796 *indent_hard_tab_width* value.
798 The default indent settings are set in `Editor Indentation
799 preferences`_ (see the link for more information).
801 The default settings can be overridden per-document using the
802 Document menu. They can also be overridden by projects - see
803 `Project management`_.
805 The indent mode for the current document is shown on the status bar
809 Indent with Tab characters.
813 Indent with tabs and spaces, depending on how much indentation is
816 Applying new indentation settings
817 `````````````````````````````````
818 After changing the default settings you may wish to apply the new
819 settings to every document in the current session. To do this use the
820 *Project->Apply Default Indentation* menu item.
822 Detecting indent type
823 `````````````````````
824 The *Detect from file* indentation preference can be used to
825 scan each file as it's opened and set the indent type based on
826 how many lines start with a tab vs. 2 or more spaces.
832 When enabled, auto-indentation happens when pressing *Enter* in the
833 Editor. It adds a certain amount of indentation to the new line so the
834 user doesn't always have to indent each line manually.
836 Geany has four types of auto-indentation:
839 Disables auto-indentation completely.
841 Adds the same amount of whitespace on a new line as on the previous line.
842 For the *Tabs* and the *Spaces* indent types the indentation will use the
843 same combination of characters as the previous line. The
844 *Tabs and Spaces* indentation type converts as explained above.
846 Does the same as *Basic* but also indents a new line after an opening
847 brace '{', and de-indents when typing a closing brace '}'. For Python,
848 a new line will be indented after typing ':' at the end of the
851 Similar to *Current chars* but the closing brace will be aligned to
852 match the indentation of the line with the opening brace. This
853 requires the filetype to be one where Geany knows that the Scintilla
854 lexer understands matching braces (C, C++, D, HTML, Pascal, Bash,
857 There is also XML-tag auto-indentation. This is enabled when the
858 mode is more than just Basic, and is also controlled by a filetype
859 setting - see `xml_indent_tags`_.
865 Geany provides a handy bookmarking feature that lets you mark one
866 or more lines in a document, and return the cursor to them using a
869 To place a mark on a line, either left-mouse-click in the left margin
870 of the editor window, or else use Ctrl-m. This will
871 produce a small green plus symbol in the margin. You can have as many
872 marks in a document as you like. Click again (or use Ctrl-m again)
873 to remove the bookmark. To remove all the marks in a given document,
874 use "Remove Markers" in the Document menu.
876 To navigate down your document, jumping from one mark to the next,
877 use Ctrl-. (control period). To go in the opposite direction on
878 the page, use Ctrl-, (control comma). Using the bookmarking feature
879 together with the commands to switch from one editor tab to another
880 (Ctrl-PgUp/PgDn and Ctrl-Tab) provides a particularly fast way to
881 navigate around multiple files.
884 Code navigation history
885 ^^^^^^^^^^^^^^^^^^^^^^^
887 To ease navigation in source files and especially between
888 different files, Geany lets you jump between different navigation
889 points. Currently, this works for the following:
891 * `Go to symbol declaration`_
892 * `Go to symbol definition`_
897 When using one of these actions, Geany remembers your current position
898 and jumps to the new one. If you decide to go back to your previous
899 position in the file, just use "Navigate back a location". To
900 get back to the new position again, just use "Navigate forward a
901 location". This makes it easier to navigate in e.g. foreign code
902 and between different files.
905 Sending text through custom commands
906 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
908 You can define several custom commands in Geany and send the current
909 selection to one of these commands using the *Edit->Format->Send
910 Selection to* menu or keybindings. The output of the command will be
911 used to replace the current selection. This makes it possible to use
912 text formatting tools with Geany in a general way.
914 The selected text will be sent to the standard input of the executed
915 command, so the command should be able to read from it and it should
916 print all results to its standard output which will be read by
917 Geany. To help finding errors in executing the command, the output
918 of the program's standard error will be printed on Geany's standard
921 If there is no selection, the whole current line is used instead.
923 To add a custom command, use the *Send Selection to->Set Custom
924 Commands* menu item. Click on *Add* to get a new item and type the
925 command. You can also specify some command line options. Empty
926 commands are not saved.
928 Normal shell quoting is supported, so you can do things like:
930 * ``sed 's/\./(dot)/g'``
932 The above example would normally be done with the `Replace all`_
933 function, but it can be handy to have common commands already set up.
935 Note that the command is not run in a shell, so if you want to use
936 shell features like pipes and command chains, you need to explicitly
937 launch the shell and pass it your command:
939 * ``sh -c 'sort | uniq'``
945 You can execute the context action command on the current word at the
946 cursor position or the available selection. This word or selection
947 can be used as an argument to the command.
948 The context action is invoked by a menu entry in the popup menu of the
949 editor and also a keyboard shortcut (see the section called
952 The command can be specified in the preferences dialog and also for
953 each filetype (see "context_action_cmd" in the section called
954 `Filetype configuration`_). When the context action is invoked, the filetype
955 specific command is used if available, otherwise the command
956 specified in the preferences dialog is executed.
958 The current word or selection can be referred with the wildcard "%s"
959 in the command, it will be replaced by the current word or
960 selection before the command is executed.
962 For example a context action can be used to open API documentation
963 in a browser window, the command to open the PHP API documentation
966 firefox "https://www.php.net/%s"
968 when executing the command, the %s is substituted by the word near
969 the cursor position or by the current selection. If the cursor is at
970 the word "echo", a browser window will open(assumed your browser is
971 called firefox) and it will open the address: https://www.php.net/echo.
977 Geany can offer a list of possible completions for symbols defined in the
978 tags files and for all words in open documents.
980 The autocompletion list for symbols is presented when the first few
981 characters of the symbol are typed (configurable, see `Editor Completions
982 preferences`_, default 4) or when the *Complete word*
983 keybinding is pressed (configurable, see `Editor keybindings`_,
986 For some languages the autocompletion list is ordered by heuristics to
987 attempt to show names that are more likely to be what the user wants
988 close to the top of the list.
990 When the defined keybinding is typed and the *Autocomplete all words in
991 document* preference (in `Editor Completions preferences`_)
992 is selected then the autocompletion list will show all matching words
993 in the document, if there are no matching symbols.
995 If you don't want to use autocompletion it can be dismissed until
996 the next symbol by pressing Escape. The autocompletion list is updated
997 as more characters are typed so that it only shows completions that start
998 with the characters typed so far. If no symbols begin with the sequence,
999 the autocompletion window is closed.
1001 The up and down arrows will move the selected item. The highlighted
1002 item on the autocompletion list can be chosen from the list by pressing
1003 Enter/Return. You can also double-click to select an item. The sequence
1004 will be completed to match the chosen item, and if the *Drop rest of
1005 word on completion* preference is set (in `Editor Completions
1006 preferences`_) then any characters after the cursor that match
1007 a symbol or word are deleted.
1009 Word part completion
1010 ````````````````````
1011 By default, pressing Tab will complete the selected item by word part;
1012 useful e.g. for adding the prefix ``gtk_combo_box_entry_`` without typing it
1017 * gtk_combo_box_<e><TAB>
1018 * gtk_combo_box_entry_<s><ENTER>
1019 * gtk_combo_box_entry_set_text_column
1021 The key combination can be changed from Tab - See `Editor keybindings`_.
1022 If you clear/change the key combination for word part completion, Tab
1023 will complete the whole word instead, like Enter.
1025 Scope autocompletion
1026 ````````````````````
1035 When you type ``foo.`` it will show an autocompletion list with 'i' and
1038 It only works for languages that set parent scope names for e.g. struct
1039 members. Most languages only parse global definitions and so scope
1040 autocompletion will not work for names declared in local scope
1041 (e.g. inside functions). A few languages parse both local and global
1042 symbols (e.g. C/C++ parsers) and for these parsers scope autocompletion
1043 works also for local variables.
1048 A handy tooltip is shown when typing ``(`` after a symbol name when the
1049 symbol has a parameter list. The tag parser for the filetype must support
1050 parsing parameter lists.
1051 Calltips can also be shown with a `keybinding <#editor-keybindings>`_.
1053 When there is more than one matching symbol, arrows are shown which can
1054 be clicked to cycle through the signatures.
1057 User-definable snippets
1058 ^^^^^^^^^^^^^^^^^^^^^^^
1060 Snippets are small strings or code constructs which can be replaced or
1061 completed to a more complex string. So you can save a lot of time when
1062 typing common strings and letting Geany do the work for you.
1063 To know what to complete or replace Geany reads a configuration file
1064 called ``snippets.conf`` at startup.
1066 Maybe you need to often type your name, so define a snippet like this::
1069 myname=Enrico Tröger
1071 Every time you write ``myname`` <TAB> in Geany, it will replace "myname"
1072 with "Enrico Tröger". The key to start autocompletion can be changed
1073 in the preferences dialog, by default it is TAB. The corresponding keybinding
1074 is called `Complete snippet`.
1078 You can override the default snippets using the user
1079 ``snippets.conf`` file. Use the *Tools->Configuration
1080 Files->snippets.conf* menu item. See also `Configuration file paths`_.
1082 This adds the default settings to the user file if the file doesn't
1083 exist. Alternatively the file can be created manually, adding only
1084 the settings you want to change. All missing settings will be read
1085 from the system snippets file.
1089 The file ``snippets.conf`` contains sections defining snippets that
1090 are available for particular filetypes and in general.
1092 The two sections "Default" and "Special" apply to all filetypes.
1093 "Default" contains all snippets which are available for every
1094 filetype and "Special" contains snippets which can only be used in
1095 other snippets. So you can define often used parts of snippets and
1096 just use the special snippet as a placeholder (see the
1097 ``snippets.conf`` for details).
1099 You can define sections with the name of a filetype eg "C++". The
1100 snippets in that section are only available for use in files with that
1101 filetype. Snippets in filetype sections will hide snippets with the
1102 same name in the "Default" section when used in a file of that
1105 **Substitution sequences for snippets**
1107 To define snippets you can use several special character sequences which
1108 will be replaced when using the snippet:
1110 ================ =========================================================
1111 \\n or %newline% Insert a new line (it will be replaced by the used EOL
1112 char(s): LF, CR/LF, or CR).
1114 \\t or %ws% Insert an indentation step, it will be replaced according
1115 to the current document's indent mode.
1117 \\s \\s to force whitespace at beginning or end of a value
1118 ('key= value' won't work, use 'key=\\svalue')
1120 %cursor% Place the cursor at this position after completion has
1121 been done. You can define multiple %cursor% wildcards
1122 and use the keybinding `Move cursor in snippet` to jump
1123 to the next defined cursor position in the completed
1126 %...% "..." means the name of a key in the "Special" section.
1127 If you have defined a key "brace_open" in the "Special"
1128 section you can use %brace_open% in any other snippet.
1129 ================ =========================================================
1131 Snippet names must not contain spaces otherwise they won't
1132 work correctly. But beside that you can define almost any
1133 string as a snippet and use it later in Geany. It is not limited
1134 to existing constructs of certain programming languages(like ``if``,
1135 ``for``, ``switch``). Define whatever you need.
1137 **Template wildcards**
1139 Since Geany 0.15 you can also use most of the available templates wildcards
1140 listed in `Template wildcards`_. All wildcards which are listed as
1141 `available in snippets` can be used. For instance to improve the above example::
1144 myname=My name is {developer}
1145 mysystem=My system: {command:uname -a}
1147 this will replace ``myname`` with "My name is " and the value of the template
1148 preference ``developer``.
1152 You can change the way Geany recognizes the word to complete,
1153 that is how the start and end of a word is recognised when the
1154 snippet completion is requested. The section "Special" may
1155 contain a key "wordchars" which lists all characters a string may contain
1156 to be recognized as a word for completion. Leave it commented to use
1157 default characters or define it to add or remove characters to fit your
1163 Normally you would type the snippet name and press Tab. However, you
1164 can define keybindings for snippets under the *Keybindings* group in
1169 block_cursor=<Ctrl>8
1172 Snippet keybindings may be overridden by Geany's configurable
1176 Inserting Unicode characters
1177 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1179 You can insert Unicode code points by hitting Ctrl-Shift-u, then still holding
1180 Ctrl-Shift, type some hex digits representing the code point for the character
1181 you want and hit Enter or Return (still holding Ctrl-Shift). If you release
1182 Ctrl-Shift before hitting Enter or Return (or any other character), the code
1183 insertion is completed, but the typed character is also entered. In the case
1184 of Enter/Return, it is a newline, as you might expect.
1187 In some earlier versions of Geany, you might need to first unbind Ctrl-Shift-u
1188 in the `keybinding preferences`_, then select *Tools->Reload Configuration*
1189 or restart Geany. Note that it works slightly differently from other GTK
1190 applications, in that you'll need to continue to hold down the Ctrl and Shift
1191 keys while typing the code point hex digits (and the Enter or Return to finish the code point).
1194 Inserting color values
1195 ^^^^^^^^^^^^^^^^^^^^^^
1197 You can insert a color value by selecting *Tools->Color Chooser* from the menu.
1198 A dialog appears to select the wanted color. If the cursor is placed inside a
1199 *#RRGGBB* format color value then the dialog will show that color after opening.
1200 On clicking on *Apply* or *Select* the code for the chosen color will be inserted
1201 in the format *#RRGGBB*. If text is selected, then it will be replaced with the
1202 color code on the first click on *Apply* or *Select*. If no text is selected or
1203 on subsequent clicks the color code is inserted at the current cursor position.
1206 Search, replace and go to
1207 -------------------------
1209 This section describes search-related commands from the Search menu
1210 and the editor window's popup menu:
1217 * Go to symbol definition
1218 * Go to symbol declaration
1221 See also `Search`_ preferences.
1225 There are also two toolbar entries:
1230 There are keybindings to focus each of these - see `Focus
1231 keybindings`_. Pressing Escape will then focus the editor.
1235 The quickest way to find some text is to use the search bar entry in
1236 the toolbar. This performs a case-insensitive search in the current
1237 document whilst you type. Pressing Enter will search again, and pressing
1238 Shift-Enter will search backwards.
1243 The Find dialog is used for finding text in one or more open documents.
1245 .. image:: ./images/find_dialog.png
1251 The syntax for the *Use regular expressions* option is shown in
1252 `Regular expressions`_.
1255 *Use escape sequences* is implied for regular expressions.
1257 The *Use multi-line matching* option enables multi-line regular
1258 expressions instead of single-line ones. See `Regular expressions`_ for
1259 more details on the differences between the two modes.
1261 The *Use escape sequences* option will transform any escaped characters
1262 into their UTF-8 equivalent. For example, \\t will be transformed into
1263 a tab character. Other recognized symbols are: \\\\, \\n, \\r, \\uXXXX
1264 (Unicode characters).
1270 To find all matches, click on the Find All expander. This will reveal
1277 Find All In Document will show a list of matching lines in the
1278 current document in the Messages tab of the Message Window. *Find All
1279 In Session* does the same for all open documents.
1281 Mark will highlight all matches in the current document with a
1282 colored box. These markers can be removed by selecting the
1283 Remove Markers command from the Document menu.
1286 Change font in search dialog text fields
1287 ````````````````````````````````````````
1289 All search related dialogs use a Monospace font for the text input fields to
1290 increase the readability of input text. This is useful when you are
1291 typing input such as regular expressions with spaces, periods and commas which
1292 might be hard to read with a proportional font.
1294 If you want to change the font, you can do this easily by using the following
1295 custom CSS snippet, see `Customizing Geany's appearance using GTK+ CSS`_::
1297 #GeanyDialogSearch GtkEntry /* GTK < 3.20 */,
1298 #GeanyDialogSearch entry /* GTK >= 3.20 */ {
1299 font: 8pt monospace;
1305 The *Find Next/Previous Selection* commands perform a search for the
1306 current selected text. If nothing is selected, by default the current
1307 word is used instead. This can be customized by the
1308 *find_selection_type* preference - see `Various preferences`_.
1310 ===== =============================================
1311 Value *find_selection_type* behaviour
1312 ===== =============================================
1313 0 Use the current word (default).
1314 1 Try the X selection first, then current word.
1315 2 Repeat last search.
1316 ===== =============================================
1322 *Find Usage* searches all open files. It is similar to the *Find All In
1323 Session* option in the Find dialog.
1325 If there is a selection, then it is used as the search text; otherwise
1326 the current word is used. The current word is either taken from the
1327 word nearest the edit cursor, or the word underneath the popup menu
1328 click position when the popup menu is used. The search results are
1329 shown in the Messages tab of the Message Window.
1332 You can also use Find Usage for symbol list items from the popup
1339 *Find in Files* is a more powerful version of *Find Usage* that searches
1340 all files in a certain directory using the Grep tool. The Grep tool
1341 must be correctly set in Preferences to the path of the system's Grep
1342 utility. GNU Grep is recommended (see note below).
1344 .. image:: ./images/find_in_files_dialog.png
1346 The *Search* field is initially set to the current word in the editor
1347 (depending on `Search`_ preferences).
1349 The *Files* setting allows to choose which files are included in the
1350 search, depending on the mode:
1353 Search in all files;
1355 Use the current project's patterns, see `Project properties`_;
1357 Use custom patterns.
1359 Both project and custom patterns use a glob-style syntax, each
1360 pattern separated by a space. To search all ``.c`` and ``.h`` files,
1362 Note that an empty pattern list searches in all files rather
1365 The *Directory* field is initially set to the current document's directory,
1366 unless this field has already been edited and the current document has
1367 not changed. Otherwise, the current document's directory is prepended to
1368 the drop-down history. This can be disabled - see `Search`_ preferences.
1370 The *Encoding* field can be used to define the encoding of the files
1371 to be searched. The entered search text is converted to the chosen encoding
1372 and the search results are converted back to UTF-8.
1374 The *Extra options* field is used to pass any additional arguments to
1378 The *Files* setting uses ``--include=`` when searching recursively,
1379 *Recurse in subfolders* uses ``-r``; both are GNU Grep options and may
1380 not work with other Grep implementations.
1383 Filtering out version control files
1384 ```````````````````````````````````
1386 When using the *Recurse in subfolders* option with a directory that's
1387 under version control, you can set the *Extra options* field to filter
1388 out version control files.
1390 If you have GNU Grep >= 2.5.2 you can use the ``--exclude-dir``
1391 argument to filter out CVS and hidden directories like ``.svn``.
1393 Example: ``--exclude-dir=.svn --exclude-dir=CVS``
1395 If you have an older Grep, you can try using the ``--exclude`` flag
1396 to filter out filenames.
1398 SVN Example: ``--exclude=*.svn-base``
1400 The --exclude argument only matches the file name part, not the path.
1406 The Replace dialog is used for replacing text in one or more open
1409 .. image:: ./images/replace_dialog.png
1411 The Replace dialog has the same options for matching text as the Find
1412 dialog. See the section `Matching options`_.
1414 The *Use regular expressions* option allows regular expressions to
1415 be used in the search string and back references in the replacement
1416 text -- see the entry for '\\n' in `Regular expressions`_.
1421 To replace several matches, click on the *Replace All* expander. This
1422 will reveal several options:
1428 *Replace All In Document* will replace all matching text in the
1429 current document. *Replace All In Session* does the same for all open
1430 documents. *Replace All In Selection* will replace all matching text
1431 in the current selection of the current document.
1434 Go to symbol definition
1435 ^^^^^^^^^^^^^^^^^^^^^^^
1437 If the current word or selection is the name of a symbol definition
1438 (e.g. a function name) and the file containing the symbol definition is
1439 open, this command will switch to that file and go to the
1440 corresponding line number. The current word is either the word
1441 nearest the edit cursor, or the word underneath the popup menu click
1442 position when the popup menu is used.
1444 If there are more symbols with the same name to which the goto can be performed,
1445 a pop up is shown with a list of all the occurrences. After selecting a symbol
1446 from the list Geany jumps to the corresponding symbol location. Geany tries to
1447 suggest the nearest symbol (symbol from the current file, other open documents
1448 or current directory) as the best candidate for the goto and places this symbol
1449 at the beginning of the list typed in boldface.
1452 If the corresponding symbol is on the current line, Geany will first
1453 look for a symbol declaration instead, as this is more useful.
1454 Likewise *Go to symbol declaration* will search for a symbol definition
1455 first in this case also.
1458 Go to symbol declaration
1459 ^^^^^^^^^^^^^^^^^^^^^^^^
1461 Like *Go to symbol definition*, but for a forward declaration such as a
1462 C function prototype or ``extern`` declaration instead of a function
1469 Go to a particular line number in the current file.
1471 If the given value starts with a plus or minus, the value will be
1472 interpreted as an offset from the current line.
1478 You can use regular expressions in the Find and Replace dialogs
1479 by selecting the *Use regular expressions* check box (see `Matching
1480 options`_). The syntax is Perl compatible. Basic syntax is described
1481 in the table below. For full details, see
1482 https://www.geany.org/manual/gtk/glib/glib-regex-syntax.html.
1484 By default regular expressions are matched on a line-by-line basis.
1485 If you are interested in multi-line regular expressions, matched against
1486 the whole buffer at once, see the section `Multi-line regular expressions`_
1490 1. The *Use escape sequences* dialog option always applies for regular
1492 2. Searching backwards with regular expressions is not supported.
1493 3. The *Use multi-line matching* dialog option to select single or
1494 multi-line matching.
1496 **In a regular expression, the following characters are interpreted:**
1498 ======= ============================================================
1499 . Matches any character.
1501 ( This marks the start of a region for tagging a match.
1503 ) This marks the end of a tagged region.
1505 \\n Where n is 1 through 9 refers to the first through ninth tagged
1506 region when searching or replacing.
1508 Searching for (Wiki)\\1 matches WikiWiki.
1510 If the search string was Fred([1-9])XXX and the
1511 replace string was Sam\\1YYY, when applied to Fred2XXX this
1512 would generate Sam2YYY.
1514 \\0 When replacing, the whole matching text.
1516 \\b This matches a word boundary.
1518 \\c A backslash followed by d, D, s, S, w or W, becomes a
1519 character class (both inside and outside sets []).
1522 * D: any char except decimal digits
1523 * s: whitespace (space, \\t \\n \\r \\f \\v)
1524 * S: any char except whitespace (see above)
1525 * w: alphanumeric & underscore
1526 * W: any char except alphanumeric & underscore
1528 \\x This allows you to use a character x that would otherwise have
1529 a special meaning. For example, \\[ would be interpreted as [
1530 and not as the start of a character set. Use \\\\ for a literal
1533 [...] Matches one of the characters in the set. If the first
1534 character in the set is ^, it matches the characters NOT in
1535 the set, i.e. complements the set. A shorthand S-E (start
1536 dash end) is used to specify a set of characters S up to E,
1539 The special characters ] and - have no special
1540 meaning if they appear first in the set. - can also be last
1541 in the set. To include both, put ] first: []A-Z-].
1545 []|-] matches these 3 chars
1546 []-|] matches from ] to | chars
1547 [a-z] any lowercase alpha
1548 [^]-] any char except - and ]
1549 [^A-Z] any char except uppercase alpha
1552 ^ This matches the start of a line (unless used inside a set, see
1555 $ This matches the end of a line.
1557 \* This matches 0 or more times. For example, Sa*m matches Sm, Sam,
1558 Saam, Saaam and so on.
1560 \+ This matches 1 or more times. For example, Sa+m matches Sam,
1561 Saam, Saaam and so on.
1563 \? This matches 0 or 1 time(s). For example, Joh?n matches John, Jon.
1564 ======= ============================================================
1567 This table is adapted from Scintilla and SciTE documentation,
1568 distributed under the `License for Scintilla and SciTE`_.
1571 Multi-line regular expressions
1572 ``````````````````````````````
1575 The *Use multi-line matching* dialog option enables multi-line
1576 regular expressions.
1578 Multi-line regular expressions work just like single-line ones but a
1579 match can span several lines.
1581 While the syntax is the same, a few practical differences applies:
1583 ======= ============================================================
1584 . Matches any character but newlines. This behavior can be changed
1585 to also match newlines using the (?s) option, see
1586 https://www.geany.org/manual/gtk/glib/glib-regex-syntax.html#idp5671632
1588 [^...] A negative range (see above) *will* match newlines if they are
1589 not explicitly listed in that negative range. For example, range
1590 [^a-z] will match newlines, while range [^a-z\\r\\n] won't.
1591 While this is the expected behavior, it can lead to tricky
1592 problems if one doesn't think about it when writing an expression.
1593 ======= ============================================================
1598 The View menu allows various elements of the main window to be shown
1599 or hidden, and also provides various display-related editor options.
1601 Color schemes dialog
1602 ^^^^^^^^^^^^^^^^^^^^
1603 The Color Schemes dialog is available under the *View->Change Color Scheme*
1604 menu item. It lists various color schemes for editor highlighting
1605 styles, including the default scheme first. Other items are available
1606 based on what color scheme files Geany found at startup.
1608 Color scheme files are read from the `Configuration file paths`_ under
1609 the ``colorschemes`` subdirectory. They should have the extension
1610 ``.conf``. The default color scheme
1611 is read from ``filetypes.common``.
1613 The `[named_styles] section`_ and `[named_colors] section`_ are the
1614 same as for ``filetypes.common``.
1616 The ``[theme_info]`` section can contain information about the
1617 theme. The ``name`` and ``description`` keys are read to set the
1618 menu item text and tooltip, respectively. These keys can have
1619 translations, e.g.::
1625 Symbols and tags files
1626 ----------------------
1628 Upon opening, files of supported filetypes are parsed to extract the symbol
1629 information (aka "workspace symbols"). You can also have Geany automatically
1630 load external files containing the symbol information (aka "global
1631 tags files") upon startup, or manually using *Tools --> Load Tags File*.
1633 Geany uses its own tags file format, similar to what ``ctags`` uses
1634 (but is incompatible with ctags). You use Geany to generate global
1635 tags files, as described below.
1641 Each document is parsed for symbols whenever a file is loaded, saved or
1642 modified (see *Symbol list update frequency* preference in the `Editor
1643 Completions preferences`_). These are shown in the Symbol list in the
1644 Sidebar. These symbols are also used for autocompletion and calltips
1645 for all documents open in the current session that have the same filetype.
1647 The *Go to Symbol* commands can be used with all workspace symbols. See
1648 `Go to symbol definition`_.
1654 Global tags files are used to provide symbols for autocompletion and calltips
1655 without having to open the source files containing these symbols. This is intended
1656 for library APIs, as the tags file only has to be updated when you upgrade
1659 You can load a custom global tags file in two ways:
1661 * Using the *Load Tags File* command in the Tools menu.
1662 * By moving or symlinking tags files to the ``tags`` subdirectory of
1663 one of the `configuration file paths`_ before starting Geany.
1665 You can either download these files or generate your own. They have
1670 *lang_ext* is one of the extensions set for the filetype associated
1671 with the tags parser. See the section called `Filetype extensions`_ for
1675 Default global tags files
1676 `````````````````````````
1678 Some global tags files are distributed with Geany and will be loaded
1679 automatically when the corresponding filetype is first used. Currently
1680 this includes global tags files for these languages:
1685 * HTML -- &symbol; completion, e.g. for ampersand, copyright, etc.
1690 Global tags file format
1691 ```````````````````````
1693 Global tags files can have three different formats:
1696 * Pipe-separated format
1699 Tag files using the CTags format should be left unmodified in the
1700 form generated by the ctags command-line tool.
1702 For the pipe-separated or tagmanager format, the first line of global tag files
1703 should be a comment, introduced by ``#`` followed by a space and
1704 ``format=pipe`` 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 format used but this
1712 This is the recommended tags file format, generated by the ctags command-line
1713 tool from the universal-ctags project (https://github.com/universal-ctags/ctags).
1714 This format is compatible with the format historically used by Vi.
1716 The format is described at https://ctags.sourceforge.net/FORMAT, but
1717 for the full list of existing extensions please refer to universal-ctags.
1718 However, note that Geany may actually only honor a subset of the
1719 existing extensions.
1722 Pipe-separated format
1723 *********************
1724 The Pipe-separated format is easier to read and write.
1725 There is one symbol per line and different symbol attributes are separated
1726 by the pipe character (``|``). A line looks like::
1728 basename|string|(string path [, string suffix])|
1730 | The first field is the symbol name (usually a function name).
1731 | The second field is the type of the return value.
1732 | The third field is the argument list for this symbol.
1733 | The fourth field is the description for this symbol but
1734 currently unused and should be left empty.
1736 Except for the first field (symbol name), all other field can be left
1737 empty but the pipe separator must appear for them.
1739 You can easily write your own global tags files using this format.
1740 Just save them in your tags directory, as described earlier in the
1741 section `Global tags files`_.
1746 The Tagmanager format is a bit more complex and is used for files
1747 created by the ``geany -g`` command. There is one symbol per line.
1748 Different symbol attributes like the return value or the argument list
1749 are separated with different characters indicating the type of the
1753 Generating a global tags file
1754 `````````````````````````````
1756 Generating tags files using ctags
1757 *********************************
1758 This is currently the recommended way of generating tags files. Unlike the
1759 methods below which use the Geany binary for their generation, this method
1760 should produce tags files which are compatible across Geany releases, starting
1763 Geany supports loading tag files generated using the ``ctags`` command-line
1764 tool from the universal-ctags project (https://github.com/universal-ctags/ctags).
1765 Even though Geany should work with any ctags file, it is recommended to use
1766 certain fields to give Geany some additional information. The recommended fields
1767 are ``EfiklsZSt``, so to generate symbols for all sources in the my_project
1768 directory one can use::
1770 ctags -n --fields=EfiklsZSt -R -o my_project.c.tags my_project
1772 Additional options may be given to the ``ctags`` tool, for instance, to restrict
1773 the generated tags file to some languages only, use certain tag kinds, etc.
1775 Note that when the ``l`` field (specifying the programming language) is enabled,
1776 the language of all symbols is set based on the value of this field instead of
1777 the language specified in the extension of the tags file. You however still
1778 have to name the file according to the same rules regardless of whether the
1779 ``l`` field is used or not.
1782 Generating tags files using Geany
1783 *********************************
1784 You can generate your own global tags files by parsing a list of
1785 source files. The command is::
1787 geany -g [-P] <Tags File> <File list>
1789 * Tags File filename should be in the format described earlier --
1790 see the section called `Global tags files`_.
1791 * File list is a list of filenames, each with a full path (unless
1792 you are generating C/C++ tags files and have set the CFLAGS environment
1793 variable appropriately).
1794 * ``-P`` or ``--no-preprocessing`` disables using the C pre-processor
1795 to process ``#include`` directives for C/C++ source files. Use this
1796 option if you want to specify each source file on the command-line
1797 instead of using a 'master' header file. Also can be useful if you
1798 don't want to specify the CFLAGS environment variable.
1800 Example for the wxD library for the D programming language::
1802 geany -g wxd.d.tags /home/username/wxd/wx/*.d
1805 Generating C/C++ tags files using Geany
1806 ***************************************
1807 You may need to first setup the `C ignore.tags`_ file.
1809 For C/C++ tags files gcc is required by default, so that header files
1810 can be preprocessed to include any other headers they depend upon. If
1811 you do not want this, use the ``-P`` option described above.
1813 For preprocessing, the environment variable CFLAGS should be set with
1814 appropriate ``-I/path`` include paths. The following example works with
1815 the bash shell, generating a tags file for the GnomeUI library::
1817 CFLAGS=`pkg-config --cflags libgnomeui-2.0` geany -g gnomeui.c.tags \
1818 /usr/include/libgnomeui-2.0/gnome.h
1820 You can adapt this command to use CFLAGS and header files appropriate
1821 for whichever libraries you want.
1824 Generating tags files on Windows using Geany
1825 ********************************************
1826 This works basically the same as on other platforms::
1828 "c:\program files\geany\bin\geany" -g c:\mytags.php.tags c:\code\somefile.php
1834 You can ignore certain symbols for C-based languages if they would lead
1835 to wrong parsing of the code. Use the *Tools->Configuration
1836 Files->ignore.tags* menu item to open the user ``ignore.tags`` file.
1837 See also `Configuration file paths`_.
1839 List all symbol names you want to ignore in this file, separated by spaces
1844 G_GNUC_NULL_TERMINATED
1846 G_GNUC_WARN_UNUSED_RESULT
1849 This will ignore the above macros and will correctly detect 'Foo' as a type
1850 instead of 'BAR' in the following code:
1852 ``struct Foo BAR { int i; };``
1854 In addition, it is possible to specify macro definition similarly to the
1857 <macro>=<definition>
1858 Defines a C preprocessor <macro>. This emulates the behavior of
1859 the corresponding gcc option. All types of macros are supported,
1860 including the ones with parameters and variable arguments.
1861 Stringification, token pasting and recursive macro expansion are
1864 For even more detailed information please read the manual page of
1871 You may adjust Geany's settings using the Edit --> Preferences
1872 dialog. Any changes you make there can be applied by hitting either
1873 the Apply or the OK button. These settings will persist between Geany
1874 sessions. Note that most settings here have descriptive popup bubble
1875 help -- just hover the mouse over the item in question to get help
1878 You may also adjust some View settings (under the View menu) that
1879 persist between Geany sessions. The settings under the Document menu,
1880 however, are only for the current document and revert to defaults
1881 when restarting Geany.
1884 In the paragraphs that follow, the text describing a dialog tab
1885 comes after the screenshot of that tab.
1888 General Startup preferences
1889 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1891 .. image:: ./images/pref_dialog_gen_startup.png
1896 Load files from the last session
1897 On startup, load the same files you had open the last time you
1900 Load virtual terminal support
1901 Load the library for running a terminal in the message window area.
1903 Enable plugin support
1904 Allow plugins to be used in Geany.
1908 Save window position and geometry
1909 Save the current position and size of the main window so next time
1910 you open Geany it's in the same location.
1913 Have a dialog pop up to confirm that you really want to quit Geany.
1919 Path to start in when opening or saving files.
1920 It must be an absolute path.
1923 Path to start in when opening project files.
1926 By default Geany looks in the system installation and the user
1927 configuration - see `Plugins`_. In addition the path entered here will be
1929 Usually you do not need to set an additional path to search for
1930 plugins. It might be useful when Geany is installed on a multi-user machine
1931 and additional plugins are available in a common location for all users.
1932 Leave blank to not set an additional lookup path.
1935 General Miscellaneous preferences
1936 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1938 .. image:: ./images/pref_dialog_gen_misc.png
1943 Beep on errors when compilation has finished
1944 Have the computer make a beeping sound when compilation of your program
1945 has completed or any errors occurred.
1947 Switch status message list at new message
1948 Switch to the status message tab (in the notebook window at the bottom)
1949 once a new status message arrives.
1951 Suppress status messages in the status bar
1952 Remove all messages from the status bar. The messages are still displayed
1953 in the status messages window.
1956 Another option is to use the *Switch to Editor* keybinding - it
1957 reshows the document statistics on the status bar. See `Focus
1960 Auto-focus widgets (focus follows mouse)
1961 Give the focus automatically to widgets below the mouse cursor.
1962 This works for the main editor widget, the scribble, the toolbar search field
1963 go to line fields and the VTE.
1969 Always wrap search around the document when finding a match.
1971 Hide the Find dialog
1972 Hide the `Find`_ dialog after clicking Find Next/Previous.
1974 Use the current word under the cursor for Find dialogs
1975 Use current word under the cursor when opening the Find, Find in Files or Replace dialog and
1976 there is no selection. When this option is disabled, the search term last used in the
1977 appropriate Find dialog is used.
1979 Use the current file's directory for Find in Files
1980 When opening the Find in Files dialog, set the directory to search to the directory of the current
1981 active file. When this option is disabled, the directory of the last use of the Find in Files
1982 dialog is used. See `Find in Files`_ for details.
1987 Use project-based session files
1988 Save your current session when closing projects. You will be able to
1989 resume different project sessions, automatically opening the files
1990 you had open previously.
1992 Store project file inside the project base directory
1993 When creating new projects, the default path for the project file contains
1994 the project base path. Without this option enabled, the default project file
1995 path is one level above the project base path.
1996 In either case, you can easily set the final project file path in the
1997 *New Project* dialog. This option provides the more common
1998 defaults automatically for convenience.
2001 Interface preferences
2002 ^^^^^^^^^^^^^^^^^^^^^
2004 .. image:: ./images/pref_dialog_interface_interface.png
2010 Whether to show the sidebar at all.
2013 Show the list of functions, variables, and other information in the
2014 current document you are editing.
2017 Show all the documents you have open currently. This can be used to
2018 change between documents (see `Switching between documents`_) and
2019 to perform some common operations such as saving, closing and reloading.
2022 Whether to place the sidebar on the left or right of the editor window.
2028 Whether to place the message window on the bottom or right of the editor window.
2034 Change the font used to display documents.
2037 Change the font used for the Symbols sidebar tab.
2040 Change the font used for the message window area.
2046 Show the status bar at the bottom of the main window. It gives information about
2047 the file you are editing like the line and column you are on, whether any
2048 modifications were done, the file encoding, the filetype and other information.
2050 Interface Notebook tab preferences
2051 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2053 .. image:: ./images/pref_dialog_interface_notebook.png
2059 Show a notebook tab for all documents so you can switch between them
2060 using the mouse (instead of using the Documents window).
2063 Make each tab show a close button so you can easily close open
2066 Placement of new file tabs
2067 Whether to create a document with its notebook tab to the left or
2068 right of all existing tabs.
2071 Whether to place file tabs next to the current tab
2072 rather than at the edges of the notebook.
2074 Double-clicking hides all additional widgets
2075 Whether to call the View->Toggle All Additional Widgets command
2076 when double-clicking on a notebook tab.
2079 If filenames are long, set the number of characters that should be
2080 visible on each tab's label.
2086 Set the positioning of the editor's notebook tabs to the right,
2087 left, top, or bottom of the editing window.
2090 Set the positioning of the sidebar's notebook tabs to the right,
2091 left, top, or bottom of the sidebar window.
2094 Set the positioning of the message window's notebook tabs to the
2095 right, left, top, or bottom of the message window.
2098 Interface Toolbar preferences
2099 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2101 Affects the main toolbar underneath the menu bar.
2103 .. image:: ./images/pref_dialog_interface_toolbar.png
2109 Whether to show the toolbar.
2111 Append Toolbar to the Menu
2112 Allows to append the toolbar to the main menu bar instead of placing it below.
2113 This is useful to save vertical space.
2116 See `Customizing the toolbar`_.
2122 Select the toolbar icon style to use - either icons and text, just
2124 The choice System default uses whatever icon style is set by GTK.
2127 Select the size of the icons you see (large, small or very small).
2128 The choice System default uses whatever icon size is set by GTK.
2131 Editor Features preferences
2132 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2134 .. image:: ./images/pref_dialog_edit_features.png
2140 Show long lines wrapped around to new display lines.
2145 Whether to move the cursor to the first non-whitespace character
2146 on the line when you hit the home key on your keyboard. Pressing it
2147 again will go to the very start of the line.
2149 Disable Drag and Drop
2150 Do not allow the dragging and dropping of selected text in documents.
2153 Allow groups of lines in a document to be collapsed for easier
2156 Fold/Unfold all children of a fold point
2157 Whether to fold/unfold all child fold points when a parent line
2160 Use indicators to show compile errors
2161 Underline lines with compile errors using red squiggles to indicate
2162 them in the editor area.
2164 Newline strips trailing spaces
2165 Remove any whitespace at the end of the line when you hit the
2166 Enter/Return key. See also `Strip trailing spaces`_. Note
2167 auto indentation is calculated before stripping, so although this
2168 setting will clear a blank line, it will not set the next line
2169 indentation back to zero.
2171 Line breaking column
2172 The editor column number to insert a newline at when Line Breaking
2173 is enabled for the current document.
2175 Comment toggle marker
2176 A string which is added when toggling a line comment in a source file.
2177 It is used to mark the comment as toggled.
2180 Editor Indentation preferences
2181 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2183 .. image:: ./images/pref_dialog_edit_indentation.png
2188 See `Indentation`_ for more information.
2191 The width of a single indent size in spaces. By default the indent
2192 size is equivalent to 4 spaces.
2194 Detect width from file
2195 Try to detect and set the indent width based on file content, when
2199 When Geany inserts indentation, whether to use:
2203 * Tabs and Spaces, depending on how much indentation is on a line
2205 The *Tabs and Spaces* indent type is also known as *Soft tab
2206 support* in some other editors.
2208 Detect type from file
2209 Try to detect and set the indent type based on file content, when
2213 The type of auto-indentation you wish to use after pressing Enter,
2217 Just add the indentation of the previous line.
2219 Add indentation based on the current filetype and any characters at
2220 the end of the line such as ``{``, ``}`` for C, ``:`` for Python.
2222 Like *Current chars* but for C-like languages, make a closing
2223 ``}`` brace line up with the matching opening brace.
2226 If set, pressing tab will indent the current line or selection, and
2227 unindent when pressing Shift-tab. Otherwise, the tab key will
2228 insert a tab character into the document (which can be different
2229 from indentation, depending on the indent type).
2232 There are also separate configurable keybindings for indent &
2233 unindent, but this preference allows the tab key to have different
2234 meanings in different contexts - e.g. for snippet completion.
2236 Backspace key unindents
2237 If set, pressing backspace while the cursor is in leading whitespace
2238 will reduce the indentation level, unless the indentation mode is tabs.
2239 Otherwise, the backspace key will delete the character before the cursor.
2241 Editor Completions preferences
2242 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2244 .. image:: ./images/pref_dialog_edit_completions.png
2250 Whether to replace special keywords after typing Tab into a
2251 pre-defined text snippet.
2252 See `User-definable snippets`_.
2254 XML/HTML tag auto-closing
2255 When you open an XML/HTML tag automatically generate its
2258 Automatic continuation multi-line comments
2259 Continue automatically multi-line comments in languages like C, C++
2260 and Java when a new line is entered inside such a comment.
2261 With this option enabled, Geany will insert a ``*`` on every new line
2262 inside a multi-line comment, for example when you press return in the
2266 * This is a C multi-line comment, press <Return>
2268 then Geany would insert::
2272 on the next line with the correct indentation based on the previous line,
2273 as long as the multi-line is not closed by ``*/``. If the previous line
2274 has no ``*`` prefix, no ``*`` will be added to the new line.
2276 Autocomplete symbols
2277 When you start to type a symbol name, look for the full string to
2278 allow it to be completed for you.
2280 Autocomplete all words in document
2281 When you start to type a word, Geany will search the whole document for
2282 words starting with the typed part to complete it, assuming there
2283 are no symbol names to show.
2285 Drop rest of word on completion
2286 Remove any word part to the right of the cursor when choosing a
2287 completion list item.
2289 Characters to type for autocompletion
2290 Number of characters of a word to type before autocompletion is
2293 Completion list height
2294 The number of rows to display for the autocompletion window.
2296 Max. symbol name suggestions
2297 The maximum number of items in the autocompletion list.
2299 Symbol list update frequency
2300 The minimum delay (in milliseconds) between two symbol list updates.
2302 This option determines how frequently the symbol list is updated for the
2303 current document. The smaller the delay, the more up-to-date the symbol
2304 list (and then the completions); but rebuilding the symbol list has a
2305 cost in performance, especially with large files.
2307 The default value is 250ms, which means the symbol list will be updated
2308 at most four times per second, even if the document changes continuously.
2310 A value of 0 disables automatic updates, so the symbol list will only be
2311 updated upon document saving.
2314 Auto-close quotes and brackets
2315 ``````````````````````````````
2317 Geany can automatically insert a closing bracket and quote characters when
2318 you open them. For instance, you type a ``(`` and Geany will automatically
2319 insert ``)``. With the following options, you can define for which
2320 characters this should work.
2323 Auto-close parenthesis when typing an opening one
2326 Auto-close curly brackets (braces) when typing an opening one
2329 Auto-close square brackets when typing an opening one
2332 Auto-close single quotes when typing an opening one
2335 Auto-close double quotes when typing an opening one
2338 Editor Display preferences
2339 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2341 This is for visual elements displayed in the editor window.
2343 .. image:: ./images/pref_dialog_edit_display.png
2348 Invert syntax highlighting colors
2349 Invert all colors, by default this makes white text on a black
2352 Show indendation guides
2353 Show vertical lines to help show how much leading indentation there
2357 Mark all tabs with an arrow "-->" symbol and spaces with dots to
2358 show which kinds of whitespace are used.
2361 Display a symbol everywhere that a carriage return or line feed
2364 Show only non-default line endings
2365 Shows line ending characters only when they differ from the
2366 file default line ending character.
2369 Show or hide the Line Number margin.
2372 Show or hide the small margin right of the line numbers, which is used
2375 Stop scrolling at last line
2376 When enabled Geany stops scrolling when at the last line of the document.
2377 Otherwise you can scroll one more page even if there are no real lines.
2379 Lines visible around the cursor
2380 The number of lines to maintain between the cursor and the top and bottom
2381 edges of the view. This allows some lines of context around the cursor to
2382 always be visible. If *Stop scrolling at last line* is disabled, the cursor
2383 will never reach the bottom edge when this value is greater than 0.
2389 The long line marker helps to indicate overly-long lines, or as a hint
2390 to the user for when to break the line.
2394 Show a thin vertical line in the editor window at the given column
2397 Change the background color of characters after the given column
2398 position to the color set below. (This is recommended over the
2399 *Line* setting if you use proportional fonts).
2401 Don't mark long lines at all.
2404 Set this value to a value greater than zero to specify the column
2405 where it should appear.
2407 Long line marker color
2408 Set the color of the long line marker.
2414 Virtual space is space beyond the end of each line.
2415 The cursor may be moved into virtual space but no real space will be
2416 added to the document until there is some text typed or some other
2417 text insertion command is used.
2420 Do not show virtual spaces
2422 Only for rectangular selections
2423 Only show virtual spaces beyond the end of lines when drawing a rectangular selection
2426 Always show virtual spaces beyond the end of lines
2432 The *change history* feature enables changed text in a document to be shown in the markers margin or by underlining the text.
2433 By default, the *change history* feature is disabled.
2435 Newly added, modified and removed lines or words are highlighted to easily track changes to the opened
2436 document. The changes can be shown as vertical bars in the markers margin and/or as underlines in
2440 This feature may use a moderate amount of memory, especially if there are many or big changes in the document.
2441 Also, modification information is not kept when re-opening a document - all change markers will be lost.
2444 .. image:: ./images/edit_change_history.png
2446 The image shows the default visuals:
2448 * inserted characters appear with coloured underlines
2449 * points where characters were deleted are shown with small triangles
2450 * the margin shows a block indicating the overall state of the line, prioritizing the more consequential modified states
2451 * the states are modified (orange), saved (green), saved then reverted to modified (green-yellow), and
2452 saved then reverted to original (cyan).
2454 Show in markers margin
2455 Changes are shown in the markers margin as vertical bars
2457 Show as underline indicators
2458 Changes are shown as underlines in the text directly
2464 .. image:: ./images/pref_dialog_files.png
2469 Open new documents from the command-line
2470 Whether to create new documents when passing filenames that don't
2471 exist from the command-line.
2473 Default encoding (new files)
2474 The type of file encoding you wish to use when creating files.
2476 Used fixed encoding when opening files
2477 Assume all files you are opening are using the type of encoding specified below.
2479 Default encoding (existing files)
2480 Opens all files with the specified encoding instead of auto-detecting it.
2481 Use this option when it's not possible for Geany to detect the exact encoding.
2483 Default end of line characters
2484 The end of line characters to which should be used for new files.
2485 On Windows systems, you generally want to use CR/LF which are the common
2486 characters to mark line breaks.
2487 On Unix-like systems, LF is default and CR is used on MAC systems.
2491 Perform formatting operations when a document is saved. These
2492 can each be undone with the Undo command.
2494 Ensure newline at file end
2495 Add a newline at the end of the document if one is missing.
2497 Ensure consistent line endings
2498 Ensures that newline characters always get converted before
2499 saving, avoiding mixed line endings in the same file.
2501 .. _Strip trailing spaces:
2503 Strip trailing spaces
2504 Remove any whitespace at the end of each document line.
2507 This does not apply to Diff documents, e.g. patch files.
2509 Replace tabs with spaces
2510 Replace all tabs in the document with the equivalent number of spaces.
2513 It is better to use spaces to indent than use this preference - see
2519 Recent files list length
2520 The number of files to remember in the recently used files list.
2523 The number of seconds to periodically check the current document's
2524 file on disk in case it has changed. Setting it to 0 will disable
2528 These checks are only performed on local files. Remote files are
2529 not checked for changes due to performance issues
2530 (remote files are files in ``~/.gvfs/``).
2536 .. image:: ./images/pref_dialog_tools.png
2542 The command to execute a script in a terminal. Occurrences of %c
2543 in the command are substituted with the run script name, see
2544 `Terminal emulators`_.
2547 The location of your web browser executable.
2550 The location of the grep executable.
2553 For Windows users: at the time of writing it is recommended to use
2554 the grep.exe from the UnxUtils project
2555 (https://sourceforge.net/projects/unxutils). The grep.exe from the
2556 Mingw project for instance might not work with Geany at the moment.
2562 Set this to a command to execute on the current word.
2563 You can use the "%s" wildcard to pass the current word below the cursor
2564 to the specified command.
2567 Template preferences
2568 ^^^^^^^^^^^^^^^^^^^^
2571 This data is used as meta data for various template text to insert into
2572 a document, such as the file header. You only need to set fields that
2573 you want to use in your template files.
2575 .. image:: ./images/pref_dialog_templ.png
2579 See `Template meta data`_.
2582 The name of the developer who will be creating files.
2585 The initials of the developer.
2588 The email address of the developer.
2591 You may wish to add anti-spam markup, e.g. ``name<at>site<dot>ext``.
2594 The company the developer is working for.
2597 The initial version of files you will be creating.
2600 Specify a format for the ``{year}`` wildcard.
2603 Specify a format for the ``{date}`` wildcard.
2606 Specify a format for the ``{datetime}`` wildcard.
2608 See `Date & time wildcards`_ for more information.
2611 Keybinding preferences
2612 ^^^^^^^^^^^^^^^^^^^^^^
2614 .. image:: ./images/pref_dialog_keys.png
2616 There are some commands listed in the keybinding dialog that are not, by default,
2617 bound to a key combination, and may not be available as a menu item.
2620 For more information see the section `Keybindings`_.
2623 Printing preferences
2624 ^^^^^^^^^^^^^^^^^^^^
2626 .. image:: ./images/pref_dialog_printing.png
2628 Use external command for printing
2629 Use a system command to print your file out.
2631 Use native GTK printing
2632 Let the GTK GUI toolkit handle your print request.
2635 Print the line numbers on the left of your paper.
2638 Print the page number on the bottom right of your paper.
2641 Print a header on every page that is sent to the printer.
2643 Use base name of the printed file
2644 Don't use the entire path for the header, only the filename.
2647 How the date should be printed. For a list of available conversion
2648 specifiers see https://docs.gtk.org/glib/method.DateTime.format.html.
2654 .. image:: ./images/pref_dialog_various.png
2656 Rarely used preferences, explained in the table below. A few of them require
2657 restart to take effect, and a few other will only affect newly opened or created
2658 documents before restart.
2660 ================================ =========================================== ========== ===========
2661 Key Description Default Applies
2662 ================================ =========================================== ========== ===========
2663 **``editor`` group**
2664 use_gtk_word_boundaries Whether to look for the end of a word true to new
2665 when using word-boundary related documents
2666 Scintilla commands (see `Scintilla
2667 keyboard commands`_).
2668 brace_match_ltgt Whether to highlight <, > angle brackets. false immediately
2669 complete_snippets_whilst_editing Whether to allow completion of snippets false immediately
2670 when editing an existing line (i.e. there
2671 is some text after the current cursor
2672 position on the line). Only used when the
2673 keybinding `Complete snippet` is set to
2675 show_editor_scrollbars Whether to display scrollbars. If set to true immediately
2676 false, the horizontal and vertical
2677 scrollbars are hidden completely.
2678 indent_hard_tab_width The size of a tab character. Don't change 8 immediately
2679 it unless you really need to; use the
2680 indentation settings instead.
2681 editor_ime_interaction Input method editor (IME)'s candidate 0 to new
2682 window behaviour. May be 0 (windowed) or documents
2684 **``interface`` group**
2685 show_symbol_list_expanders Whether to show or hide the small true to new
2686 expander icons on the symbol list documents
2688 compiler_tab_autoscroll Whether to automatically scroll to the true immediately
2689 last line of the output in the Compiler
2691 statusbar_template The status bar statistics line format. See below. immediately
2692 (See `Statusbar Templates`_ for details).
2693 new_document_after_close Whether to open a new document after all false immediately
2694 documents have been closed.
2695 msgwin_status_visible Whether to show the Status tab in the true immediately
2697 msgwin_compiler_visible Whether to show the Compiler tab in the true immediately
2699 msgwin_messages_visible Whether to show the Messages tab in the true immediately
2701 msgwin_scribble_visible Whether to show the Scribble tab in the true immediately
2703 warn_on_project_close Whether to show a warning when opening true immediately
2704 a project while one is already open.
2705 **``terminal`` group**
2706 send_selection_unsafe By default, Geany strips any trailing false immediately
2707 newline characters from the current
2708 selection before sending it to the terminal
2709 to not execute arbitrary code. This is
2710 mainly a security feature.
2711 If, for whatever reasons, you really want
2712 it to be executed directly, set this option
2714 send_cmd_prefix String with which prefix the commands sent Empty immediately
2715 to the shell. This may be used to tell
2716 some shells (BASH with ``HISTCONTROL`` set
2717 to ``ignorespace``, ZSH with
2718 ``HIST_IGNORE_SPACE`` enabled, etc.) from
2719 putting these commands in their history by
2720 setting this to a space. Note that leading
2721 spaces must be escaped using `\s` in the
2724 allow_always_save Whether files can be saved always, even false immediately
2725 if they don't have any changes.
2726 By default, the Save button and menu
2727 item are disabled when a file is
2728 unchanged. When setting this option to
2729 true, the Save button and menu item are
2730 always active and files can be saved.
2731 use_atomic_file_saving Defines the mode how Geany saves files to false immediately
2732 disk. If disabled, Geany directly writes
2733 the content of the document to disk. This
2734 might cause loss of data when there is
2735 no more free space on disk to save the
2736 file. When set to true, Geany first saves
2737 the contents into a temporary file and if
2738 this succeeded, the temporary file is
2739 moved to the real file to save.
2740 This gives better error checking in case of
2741 no more free disk space. But it also
2742 destroys hard links of the original file
2743 and its permissions (e.g. executable flags
2744 are reset). Use this with care as it can
2745 break things seriously.
2746 The better approach would be to ensure your
2747 disk won't run out of free space.
2748 use_gio_unsafe_file_saving Whether to use GIO as the unsafe file true immediately
2749 saving backend. It is better on most
2750 situations but is known not to work
2751 correctly on some complex setups.
2752 gio_unsafe_save_backup Make a backup when using GIO unsafe file false immediately
2753 saving. Backup is named `filename~`.
2754 keep_edit_history_on_reload Whether to maintain the edit history when true immediately
2755 reloading a file, and allow the operation
2757 reload_clean_doc_on_file_change Whether to automatically reload documents false immediately
2758 that have no changes but which have changed
2760 If unsaved changes exist then the user is
2761 prompted to reload manually.
2762 save_config_on_file_change Automatically save Geany's configuration true immediately
2763 to disk once the document list changes
2764 (i.e. new documents are opened, saved or
2765 closed). This helps to prevent accidentally
2766 losing the session file list or other
2767 changed settings when Geany is not shut
2768 down cleanly. Disable this option if your
2769 configuration directory is on a slow drive,
2770 network share or similar and you experience
2772 extract_filetype_regex Regex to extract filetype name from file See link immediately
2773 via capture group one.
2774 See `ft_regex`_ for default.
2775 **``search`` group**
2776 find_selection_type See `Find selection`_. 0 immediately
2777 replace_and_find_by_default Set ``Replace & Find`` button as default so true immediately
2778 it will be activated when the Enter key is
2779 pressed while one of the text fields has
2782 number_ft_menu_items The maximum number of menu items in the 2 on restart
2783 filetype build section of the Build menu.
2784 number_non_ft_menu_items The maximum number of menu items in the 3 on restart
2785 independent build section.
2786 number_exec_menu_items The maximum number of menu items in the 2 on restart
2787 execute section of the Build menu.
2788 **``socket`` group**
2789 socket_remote_cmd_port TCP port number to be used for inter 2 on restart
2790 process communication (i.e. with other
2791 Geany instances, e.g. "Open with Geany").
2792 Only available on Windows, valid port
2793 range: 1024 to 65535.
2794 ================================ =========================================== ========== ===========
2799 The default statusbar template is (note ``\t`` = tab):
2801 ``line: %l / %L\t col: %c\t sel: %s\t %w %t %mEOL: %M encoding: %e filetype: %f scope: %S``
2803 Settings the preference to an empty string will also cause Geany to use this
2806 The following format characters are available for the statusbar template:
2808 ============ ===========================================================
2809 Placeholder Description
2810 ============ ===========================================================
2811 ``%l`` The current line number starting at 1
2812 ``%L`` The total number of lines
2813 ``%c`` The current column number starting at 0, including virtual
2815 ``%C`` The current column number starting at 1, including virtual
2817 ``%s`` The number of selected characters or if only whole lines
2818 selected, the number of selected lines.
2819 ``%n`` The number of selected characters, even if only whole lines
2821 ``%w`` Shows ``RO`` when the document is in read-only mode,
2822 otherwise shows whether the editor is in overtype (OVR)
2823 or insert (INS) mode.
2824 ``%t`` Shows the indentation mode, either tabs (TAB),
2825 spaces (SP) or both (T/S).
2826 ``%m`` Shows whether the document is modified (MOD) or nothing.
2827 ``%M`` The name of the document's line-endings (ex. ``Unix (LF)``)
2828 ``%e`` The name of the document's encoding (ex. UTF-8).
2829 ``%f`` The filetype of the document (ex. None, Python, C, etc).
2830 ``%S`` The name of the scope where the caret is located.
2831 ``%p`` The caret position in the entire document starting at 0.
2832 ``%r`` Shows whether the document is read-only (RO) or nothing.
2833 ``%Y`` The Scintilla style number at the caret position. This is
2834 useful if you're debugging color schemes or related code.
2835 ============ ===========================================================
2837 Terminal (VTE) preferences
2838 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2840 See also: `Virtual terminal emulator widget (VTE)`_.
2842 .. image:: ./images/pref_dialog_vte.png
2848 Select the font that will be used in the terminal emulation control.
2851 Select the font color.
2854 Select the background color of the terminal.
2857 Select the background image to show behind the terminal's text.
2860 The number of lines buffered so that you can scroll though the history.
2863 The location of the shell on your system.
2866 Scroll the terminal to the prompt line when pressing a key.
2869 Scroll the output down.
2872 Let the terminal cursor blink.
2874 Override Geany keybindings
2875 Allow the VTE to receive keyboard shortcuts (apart from focus commands).
2877 Disable menu shortcut key (F10 by default)
2878 Disable the menu shortcut when you are in the virtual terminal.
2880 Follow path of the current file
2881 Make the path of the terminal change according to the path of the
2884 Execute programs in VTE
2885 Execute programs in the virtual terminal instead of using the external
2886 terminal tool. Note that if you run multiple execute commands at once
2887 the output may become mixed together in the VTE.
2889 Don't use run script
2890 Don't use the simple run script which is usually used to display
2891 the exit status of the executed program.
2892 This can be useful if you already have a program running in the VTE
2893 like a Python console (e.g. ipython). Use this with care.
2899 Project management is optional in Geany. Currently it can be used for:
2901 * Storing and opening session files on a project basis.
2902 * Overriding default settings with project equivalents.
2903 * Configuring the Build menu on a project basis.
2905 A list of session files can be stored and opened with the project
2906 when the *Use project-based session files* preference is enabled,
2907 in the `Projects`_ group of the `General Miscellaneous preferences`_ tab
2908 of the `Preferences`_ dialog.
2910 As long as a project is open, the Build menu will use
2911 the items defined in project's settings, instead of the defaults.
2912 See `Build Menu Configuration`_ for information on configuring the menu.
2914 The current project's settings are saved when it is closed, or when
2915 Geany is shutdown. When restarting Geany, the previously opened project
2916 file that was in use at the end of the last session will be reopened.
2918 The project menu items are detailed below.
2924 There are two ways of creating new projects, either by using
2925 *Project->New* menu item or by using *Project->New from Folder* menu
2929 This method is more suitable for creating new, empty projects from
2930 scratch at the default location without having any existing sources.
2932 To create a new project, fill in the *Name* field. By default this
2933 will setup a new project file ``~/projects/name/name.geany``.
2935 The *Base path* text field is setup to use ``~/projects/name``. This
2936 can safely be set to any existing path -- it will not touch the file
2937 structure contained in it.
2940 This method is more suitable when there is already some folder
2941 containing source files for which you want to create a new project.
2943 When using this method, Geany first opens a directory selection
2944 dialog to select the folder containing the sources, and the
2945 *Base path* field is set to that value.
2947 Afterwards, Geany shows the same dialog as the *Project->New*
2948 method but already pre-filled with the values based on the
2949 *Base path* selection. The *Name* field is filled with the folder
2950 name, the *Filename* field is filled with
2951 ``base_path/name.geany`` and the *Base path* field is filled with
2952 the path specified in the previous dialog.
2958 You can set an optional description for the project. Currently it's
2959 only used for the ``{description}}`` template wildcard - see `Dynamic wildcards`_.
2961 The *Base path* field is used as the directory to run the Build menu commands.
2962 The specified path can be an absolute path or it is considered to be
2963 relative to the project's file name.
2965 The *File patterns* field allows to specify a list of file patterns for the
2966 project, which can be used in the `Find in files`_ dialog.
2968 The *Indentation* tab allows you to override the default
2969 `Indentation`_ settings.
2975 The Open command displays a standard file chooser, starting in
2976 ``~/projects``. Choose a project file named with the ``.geany``
2979 When project session support is enabled, Geany will close the currently
2980 open files and open the session files associated with the project.
2986 Project file settings are saved when the project is closed.
2988 When project session support is enabled, Geany will close the project
2989 session files and open any previously closed default session files.
2994 After editing code with Geany, the next step is to compile, link, build,
2995 interpret, run etc. As Geany supports many languages each with a different
2996 approach to such operations, and as there are also many language independent
2997 software building systems, Geany does not have a built-in build system, nor
2998 does it limit which system you can use. Instead the build menu provides
2999 a configurable and flexible means of running any external commands to
3000 execute your preferred build system.
3002 This section provides a description of the default configuration of the
3003 build menu and then covers how to configure it, and where the defaults fit in.
3005 Running the commands from within Geany has two benefits:
3007 * The current file is automatically saved before the command is run.
3008 * The output is captured in the Compiler notebook tab and parsed for
3011 Warnings and errors that can be parsed for line numbers will be shown in
3012 red in the Compiler tab and you can click on them to switch to the relevant
3013 source file (or open it) and mark the line number. Also lines with
3014 warnings or errors are marked in the source, see `Indicators`_ below.
3017 If Geany's default error message parsing does not parse errors for
3018 the tool you're using, you can set a custom regex in the
3019 `Set Build Commands dialog`_, see `Build Menu Configuration`_.
3024 Indicators are red squiggly underlines which are used to highlight
3025 errors which occurred while compiling the current file. So you can
3026 easily see where your code failed to compile. You can remove them by
3027 selecting *Remove Error Indicators* in the Document menu.
3029 If you do not like this feature, you can disable it - see `Editor Features
3033 Default build menu items
3034 ^^^^^^^^^^^^^^^^^^^^^^^^
3035 Depending on the current file's filetype, the default Build menu will contain
3036 the following items:
3042 * Make Custom Target
3047 * Set Build Menu Commands
3053 The Compile command has different uses for different kinds of files.
3055 For compilable languages such as C and C++, the Compile command is
3056 set up to compile the current source file into a binary object file.
3058 Java source files will be compiled to class file bytecode.
3060 Interpreted languages such as Perl, Python, Ruby will compile to
3061 bytecode if the language supports it, or will run a syntax check,
3062 or if that is not available will run the file in its language interpreter.
3067 For compilable languages such as C and C++, the Build command will link
3068 the current source file's equivalent object file into an executable. If
3069 the object file does not exist, the source will be compiled and linked
3070 in one step, producing just the executable binary.
3072 Interpreted languages do not use the Build command.
3075 If you need complex settings for your build system, or several
3076 different settings, then writing a Makefile and using the Make
3077 commands is recommended; this will also make it easier for users to
3078 build your software.
3083 Source code linters are often used to find code that doesn't correspond to
3084 certain style guidelines: non-portable code, common or hard to find
3085 errors, code "smells", variables used before being set, unused functions,
3086 division by zero, constant conditions, etc. Linters inspect the code and
3087 issue warnings much like the compilers do. This is formally referred to as
3088 static code analysis.
3090 Some common linters are pre-configured for you in the Build menu (``pycodestyle``
3091 for Python, ``cppcheck`` for C/C++, JSHint for JavaScript, ``xmllint`` for
3092 XML, ``hlint`` for Haskell, ``shellcheck`` for shell code, ...), but all
3093 these are standalone tools you need to obtain before using.
3098 This runs "make" in the same directory as the
3104 This is similar to running 'Make' but you will be prompted for
3105 the make target name to be passed to the Make tool. For example,
3106 typing 'clean' in the dialog prompt will run "make clean".
3112 Make object will run "make current_file.o" in the same directory as
3113 the current file, using the filename for 'current_file'. It is useful
3114 for building just the current file without building the whole project.
3119 The next error item will move to the next detected error in the file.
3123 The previous error item will move to the previous detected error in the file.
3128 Execute will run the corresponding executable file, shell script or
3129 interpreted script in a terminal window. The command set in the
3130 `Set Build Commands dialog`_ is run in a script to ensure the terminal
3131 stays open after execution completes. Note: see `Terminal emulators`_
3132 below for the command format. Alternatively the built-in VTE can be used
3133 if it is available - see `Virtual terminal emulator widget (VTE)`_.
3135 After your program or script has finished executing, the run script will
3136 prompt you to press the return key. This allows you to review any text
3137 output from the program before the terminal window is closed.
3140 The execute command output is not parsed for errors.
3143 Stopping running processes
3144 ``````````````````````````
3146 When there is a running program, the Execute menu item in the menu and
3147 the Run button in the toolbar
3148 each become a stop button so you can stop the current running program (and
3149 any child processes). This works by sending the SIGQUIT signal to the process.
3151 Depending on the process you started it is possible that the process
3152 cannot be stopped. For example this can happen when the process creates
3153 more than one child process.
3159 The Terminal field of the tools preferences tab requires a command to
3160 execute the terminal program and to pass it the name of the Geany run
3161 script that it should execute in a Bourne compatible shell (eg /bin/sh).
3162 The marker "%c" is substituted with the name of the Geany run script,
3163 which is created in the temporary directory and which changes the working
3164 directory to the directory set in the `Set Build Commands dialog`_.
3166 As an example the default (Linux) command is::
3168 xterm -e "/bin/sh %c"
3174 By default Compile, Build and Execute are fairly basic commands. You
3175 may wish to customise them using *Set Build Commands*.
3177 E.g. for C you can add any include paths and compile flags for the
3178 compiler, any library names and paths for the linker, and any
3179 arguments you want to use when running Execute.
3181 Build menu configuration
3182 ^^^^^^^^^^^^^^^^^^^^^^^^
3184 The build menu has considerable flexibility and configurability, allowing
3185 menu labels, the commands they execute and the directory they execute
3186 in to be configured. For example, if you change one of the default make
3187 commands to run say 'waf' you can also change the label to match.
3188 These settings are saved automatically when Geany is shut down.
3190 The build menu is divided into four groups of items each with different
3193 * Filetype build commands - are configurable and depend on the filetype of the
3194 current document; they capture output in the compiler tab and parse it for
3196 * Independent build commands - are configurable and mostly don't depend on the
3197 filetype of the current document; they also capture output in the
3198 compiler tab and parse it for errors.
3199 * Execute commands - are configurable and intended for executing your
3200 program or other long running programs. The output is not parsed for
3201 errors and is directed to the terminal command selected in `Tools
3203 * Fixed commands - these perform built-in actions:
3205 * Go to the next error.
3206 * Go to the previous error.
3207 * Show the build menu commands dialog.
3209 The maximum numbers of items in each of the configurable groups can be
3210 configured in `Various preferences`_. Even though the maximum number of
3211 items may have been increased, only those menu items that have commands
3212 configured are shown in the menu.
3214 The groups of menu items obtain their configuration from four potential
3215 sources. The highest priority source that has the menu item defined will
3216 be used. The sources in decreasing priority are:
3218 * A project file if open
3219 * The user preferences
3220 * The system filetype definitions
3223 The detailed relationships between sources and the configurable menu item groups
3224 is shown in the following table:
3226 +--------------+---------------------+--------------------------+-------------------+-------------------------------+
3227 | Group | Project File | Preferences | System Filetype | Defaults |
3228 +==============+=====================+==========================+===================+===============================+
3229 | Filetype | Loads From: project | Loads From: | Loads From: | None |
3230 | Build | file | filetypes.xxx file in | filetypes.xxx in | |
3231 | | | ~/.config/geany/filedefs | Geany install | |
3232 | | Saves To: project | | | |
3233 | | file | Saves to: as above, | Saves to: as user | |
3234 | | | creating if needed. | preferences left. | |
3235 +--------------+---------------------+--------------------------+-------------------+-------------------------------+
3236 | Independent | Loads From: project | Loads From: | Loads From: | 1: |
3237 | Build | file | geany.conf file in | filetypes.xxx in | Label: _Make |
3238 | | | ~/.config/geany | Geany install | Command: make |
3239 | | Saves To: project | | | |
3240 | | file | Saves to: as above, | Saves to: as user | 2: |
3241 | | | creating if needed. | preferences left. | Label: Make Custom _Target |
3242 | | | | | Command: make |
3245 | | | | | Label: Make _Object |
3246 | | | | | Command: make %e.o |
3247 +--------------+---------------------+--------------------------+-------------------+-------------------------------+
3248 | Execute | Loads From: project | Loads From: | Loads From: | Label: _Execute |
3249 | | file or else | geany.conf file in | filetypes.xxx in | Command: ./%e |
3250 | | filetype defined in | ~/.config/geany or else | Geany install | |
3251 | | project file | filetypes.xxx file in | | |
3252 | | | ~/.config/geany/filedefs | Saves To: as user | |
3253 | | Saves To: | | preferences left. | |
3254 | | project file | Saves To: | | |
3255 | | | filetypes.xxx file in | | |
3256 | | | ~/.config/geany/filedefs | | |
3257 +--------------+---------------------+--------------------------+-------------------+-------------------------------+
3259 The following notes on the table may reference cells by coordinate as *(group, source)*:
3261 * Filetype filenames - for filetypes.xxx substitute the appropriate extension for
3262 the filetype of the current document for xxx - see `filenames`_.
3264 * System Filetypes - Labels loaded from these sources are locale sensitive
3265 and can contain translations.
3267 * *(Filetype build, Project and Preferences)* - preferences use a full
3268 filetype file so that users can configure all other filetype preferences
3269 as well. Projects can only configure menu items per filetype. Saving
3270 in the project file means that there is only one file per project not
3273 * *(Filetype-Independent build, System Filetype)* - although conceptually strange, defining
3274 filetype-independent commands in a filetype file, this provides the ability to
3275 define filetype dependent default menu items.
3277 * *(Execute, Project and Preferences)* - the project independent
3278 execute and preferences independent execute commands can only be set by hand
3279 editing the appropriate file, see `Preferences file format`_ and `Project file
3282 Set Build Commands dialog
3283 ^^^^^^^^^^^^^^^^^^^^^^^^^
3285 Most of the configuration of the build menu is done through the `Set
3286 Build Commands dialog`_. When no project is open, you can edit the
3287 configuration sourced from user preferences using the *Build->Set Build
3288 Commands* menu item. You can edit the configuration sourced from a
3289 project in the *Build* tab of the `Project Properties`_ dialog. The
3290 former menu item also shows the project dialog when a project is open.
3291 Both use the same form shown below.
3293 .. image:: ./images/build_menu_commands_dialog.png
3295 The dialog is divided into three sections:
3297 * Filetype build commands (selected based on the current document's filetype).
3298 * Independent build commands (available regardless of filetype).
3299 * Filetype execute commands.
3301 The filetype and independent build sections also each contain a field for the regular
3302 expression used for parsing command output for error and warning messages.
3304 The columns in the first three sections allow setting of the label, command,
3305 and working directory to run the command in. An item with an empty
3306 label will not be shown in the menu. An empty working directory will
3307 default to the directory of the current document.
3309 If there is no current document then the command will not run.
3311 The dialog will always show the command selected by priority, not just the
3312 commands configured in this configuration source. This ensures that you always
3313 see what the menu item is going to do if activated.
3315 If the current source of the menu item is higher priority than the
3316 configuration source you are editing then the command will be shown
3317 in the dialog but will be insensitive (greyed out). This can't happen
3318 with the project source but can with the preferences source dialog.
3320 The clear buttons remove the definition from the configuration source you are editing.
3321 When you do this the command from the next lower priority source will be shown.
3322 To hide lower priority menu items without having anything show in the menu,
3323 configure with nothing in the label but at least one character in the command.
3325 Substitutions in commands and working directories
3326 `````````````````````````````````````````````````
3328 Before the command is run, the first occurrence of each of the following
3329 two character sequences in each of the command and working directory
3330 fields is substituted by the items specified below:
3332 * %d - the absolute path to the directory of the current file.
3333 * %e - the name of the current file without the extension or path.
3334 * %f - the name of the current file without the path.
3335 * %p - if a project is open, the base path from the project.
3336 * %l - the line number at the current cursor position.
3339 If the base path set in `Project Properties`_ is not an absolute path, then it is
3340 taken as relative to the directory of the project file. This allows a project file
3341 stored in the source tree to specify all commands and working directories relative
3342 to the tree itself, so that the whole tree including the project file, can be moved
3343 and even checked into and out of version control without having to re-configure the
3346 Build menu keyboard shortcuts
3347 `````````````````````````````
3349 Keyboard shortcuts can be defined for:
3351 * the first two filetype build menu items
3352 * the first three independent build menu items
3353 * the first execute menu item
3354 * the fixed menu items (Next/Previous Error, Set Commands)
3356 In the keybindings configuration dialog (see `Keybinding preferences`_)
3357 these items are identified by the default labels shown in the `Build Menu`_ section above.
3359 It is currently not possible to bind keyboard shortcuts to more than these menu items.
3360 You can also use underlines in the labels to set mnemonic characters.
3364 The configurable Build Menu capability was introduced in Geany 0.19 and
3365 required a new section to be added to the configuration files (See
3366 `Preferences file format`_). Geany will still load older format project,
3367 preferences and filetype file settings and will attempt to map them into the new
3368 configuration format. There is not a simple clean mapping between the formats.
3369 The mapping used produces the most sensible results for the majority of cases.
3370 However, if they do not map the way you want, you may have to manually
3371 configure some settings using the `Set Build Commands dialog`_.
3373 Any setting configured in either of these dialogs will override settings mapped from
3374 older format configuration files.
3379 Since Geany 0.13 there has been printing support using GTK's printing API.
3380 The printed page(s) will look nearly the same as on your screen in Geany.
3381 Additionally, there are some options to modify the printed page(s).
3384 The background text color is set to white, except for text with
3385 a white foreground. This allows dark color schemes to save ink
3388 You can define whether to print line numbers, page numbers at the bottom of
3389 each page and whether to print a page header on each page. This header
3390 contains the filename of the printed document, the current page number and
3391 the date and time of printing. By default, the file name of the document
3392 with full path information is added to the header. If you prefer to add
3393 only the basename of the file(without any path information) you can set it
3394 in the preferences dialog. You can also adjust the format of the date and
3395 time added to the page header. For a list of available conversion
3396 specifiers see https://docs.gtk.org/glib/method.DateTime.format.html.
3398 All of these settings can also be changed in the print dialog just before
3399 actual printing is done.
3400 On Unix-like systems the provided print dialog offers a print preview. The
3401 preview file is opened with a PDF viewer and by default GTK uses ``evince``
3402 for print preview. If you have not installed evince or just want to use
3403 another PDF viewer, you can change the program to use in the file
3404 ``settings.ini`` (usually found in ``~/.config/gtk-3.0``, see the
3405 `GTK documentation`_). For example, use::
3408 gtk-print-preview-command = epdfview %f
3410 Of course, you can also use xpdf, kpdf or whatever as the print preview
3411 command. That command should ideally delete the temporary file referenced by
3412 ``%f``. See the `GTK documentation for the setting`_ for more details.
3414 .. _GTK documentation: https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings.description
3415 .. _GTK documentation for the setting: https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-print-preview-command
3418 Geany also provides an alternative basic printing support using a custom
3419 print command. However, the printed document contains no syntax highlighting.
3420 You can adjust the command to which the filename is passed in the preferences
3421 dialog. The default command is::
3425 ``%f`` will be substituted by the filename of the current file. Geany
3426 will not show errors from the command itself, so you should make
3427 sure that it works before(e.g. by trying to execute it from the
3430 A nicer example, which many prefer is::
3432 % a2ps -1 --medium=A4 -o - %f | xfprint4
3434 But this depends on a2ps and xfprint4. As a replacement for xfprint4,
3435 gtklp or similar programs can be used.
3442 Plugins are loaded at startup, if the *Enable plugin support*
3443 general preference is set. There is also a command-line option,
3444 ``-p``, which prevents plugins being loaded. Plugins are scanned in
3445 the following directories:
3447 * ``$prefix/lib/geany`` on Unix-like systems (see `Installation prefix`_)
3448 * The ``lib`` subfolder of the installation path on Windows.
3449 * The ``plugins`` subfolder of the user configuration directory - see
3450 `Configuration file paths`_.
3451 * The `Extra plugin path` preference (usually blank) - see `Paths`_.
3453 Most plugins add menu items to the *Tools* menu when they are loaded.
3455 See also `Plugin documentation`_ for information about single plugins
3456 which are included in Geany.
3460 The Plugin Manager dialog lets you choose which plugins
3461 should be loaded at startup. You can also load and unload plugins on the
3462 fly using this dialog. Once you click the checkbox for a specific plugin
3463 in the dialog, it is loaded or unloaded according to its previous state.
3464 By default, no plugins are loaded at startup until you select some.
3465 You can also configure some plugin specific options if the plugin
3472 Geany supports the default keyboard shortcuts for the Scintilla
3473 editing widget. For a list of these commands, see `Scintilla
3474 keyboard commands`_. The Scintilla keyboard shortcuts will be overridden
3475 by any custom keybindings with the same keyboard shortcut.
3481 There are some non-configurable bindings to switch between documents,
3482 listed below. These can also be overridden by custom keybindings.
3484 =============== ==================================
3486 =============== ==================================
3487 Alt-[1-9] Select left-most tab, from 1 to 9.
3488 Alt-0 Select right-most tab.
3489 =============== ==================================
3491 See also `Notebook tab keybindings`_.
3494 Configurable keybindings
3495 ^^^^^^^^^^^^^^^^^^^^^^^^
3497 For all actions listed below you can define your own keybindings. Open
3498 the Preferences dialog, select the desired action and click on
3499 change. In the resulting dialog you can press the key combination you
3500 want to assign to the action and it will be saved when you press OK.
3501 You can define only one key combination for each action and each key
3502 combination can only be defined for one action.
3504 The following tables list all customizable keyboard shortcuts, those
3505 which are common to many applications are marked with (C) after the
3510 =============================== ========================= ==================================================
3511 Action Default shortcut Description
3512 =============================== ========================= ==================================================
3513 New Ctrl-N (C) Creates a new file.
3515 Open Ctrl-O (C) Opens a file.
3517 Open selected file Ctrl-Shift-O Opens the selected filename.
3519 Re-open last closed tab Re-opens the last closed document tab.
3521 Save Ctrl-S (C) Saves the current file.
3523 Save As Saves the current file under a new name.
3525 Save all Ctrl-Shift-S Saves all open files.
3527 Close all Ctrl-Shift-W Closes all open files.
3529 Close Ctrl-W (C) Closes the current file.
3531 Reload file Ctrl-R (C) Reloads the current file.
3533 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.
3535 Print Ctrl-P (C) Prints the current file.
3537 Quit Ctrl-Q (C) Quits Geany.
3538 =============================== ========================= ==================================================
3543 =============================== ========================= ==================================================
3544 Action Default shortcut Description
3545 =============================== ========================= ==================================================
3546 Undo Ctrl-Z (C) Un-does the last action.
3548 Redo Ctrl-Y Re-does the last action.
3550 Delete current line(s) Ctrl-K Deletes the current line (and any lines with a
3553 Delete to line end Ctrl-Shift-Delete Deletes from the current caret position to the
3554 end of the current line.
3556 Delete to line start Ctrl-Shift-BackSpace Deletes from the beginning of the line to the
3557 current caret position.
3559 Duplicate line or selection Ctrl-D Duplicates the current line or selection.
3561 Transpose current line Transposes the current line with the previous one.
3563 Scroll to current line Ctrl-Shift-L Scrolls the current line into the centre of the
3564 view. The cursor position and or an existing
3565 selection will not be changed.
3567 Scroll up by one line Alt-Up Scrolls the view.
3569 Scroll down by one line Alt-Down Scrolls the view.
3571 Complete word Ctrl-Space Shows the autocompletion list. If already showing
3572 symbol completion, it shows document word completion
3573 instead, even if it is not enabled for automatic
3574 completion. Likewise if no symbol suggestions are
3575 available, it shows document word completion.
3577 Show calltip Ctrl-Shift-Space Shows a calltip for the current function or
3580 Complete snippet Tab If you type a keyword like ``if`` or ``for`` and press
3581 this key, it will be completed with a matching
3582 template - see `User-definable snippets`_.
3584 Suppress snippet completion If you type a construct like ``if`` or ``for`` and press
3585 this key, it will not be completed, and a space or
3586 tab will be inserted, depending on what the
3587 construct completion keybinding is set to. For
3588 example, if you have set the construct completion
3589 keybinding to a space, then setting this to
3590 Shift+space will prevent construct completion and
3593 Context Action Executes a command and passes the current word
3594 (near the cursor position) or selection as an
3595 argument. See the section called `Context
3598 Move cursor in snippet Jumps to the next defined cursor positions in a
3599 completed snippets if multiple cursor positions
3602 Word part completion Tab When the autocompletion list is visible, complete
3603 the currently selected item up to the next word
3606 Move line(s) up Alt-PageUp Move the current line or selected lines up by
3609 Move line(s) down Alt-PageDown Move the current line or selected lines down by
3611 =============================== ========================= ==================================================
3614 Clipboard keybindings
3615 `````````````````````
3616 =============================== ========================= ==================================================
3617 Action Default shortcut Description
3618 =============================== ========================= ==================================================
3619 Cut Ctrl-X (C) Cut the current selection to the clipboard.
3621 Copy Ctrl-C (C) Copy the current selection to the clipboard.
3623 Paste Ctrl-V (C) Paste the clipboard text into the current document.
3625 Cut current line(s) Ctrl-Shift-X Cuts the current line (and any lines with a
3626 selection) to the clipboard.
3628 Copy current line(s) Ctrl-Shift-C Copies the current line (and any lines with a
3629 selection) to the clipboard.
3630 =============================== ========================= ==================================================
3635 =============================== ========================= ==================================================
3636 Action Default shortcut Description
3637 =============================== ========================= ==================================================
3638 Select all Ctrl-A (C) Makes a selection of all text in the current
3641 Select current word Alt-Shift-W Selects the current word under the cursor.
3643 Select current paragraph Alt-Shift-P Selects the current paragraph under the cursor
3644 which is defined by two empty lines around it.
3646 Select current line(s) Alt-Shift-L Selects the current line under the cursor (and any
3647 partially selected lines).
3649 Select to previous word part (Extend) selection to previous word part boundary.
3651 Select to next word part (Extend) selection to next word part boundary.
3652 =============================== ========================= ==================================================
3657 =============================== ========================= ==================================================
3658 Action Default shortcut Description
3659 =============================== ========================= ==================================================
3660 Insert date Shift-Alt-D Inserts a customisable date.
3662 Insert alternative whitespace Inserts a tab character when spaces should
3663 be used for indentation and inserts space
3664 characters of the amount of a tab width when
3665 tabs should be used for indentation.
3667 Insert New Line Before Current Inserts a new line with indentation.
3669 Insert New Line After Current Inserts a new line with indentation.
3670 =============================== ========================= ==================================================
3675 =============================== ========================= ==================================================
3676 Action Default shortcut Description
3677 =============================== ========================= ==================================================
3678 Toggle case of selection Ctrl-Alt-U Changes the case of the selection. A lowercase
3679 selection will be changed into uppercase and vice
3680 versa. If the selection contains lower- and
3681 uppercase characters, all will be converted to
3684 Comment line Comments current line or selection.
3686 Uncomment line Uncomments current line or selection.
3688 Toggle line commentation Ctrl-E Comments a line if it is not commented or removes
3689 a comment if the line is commented.
3691 Increase indent Ctrl-I Indents the current line or selection by one tab
3692 or with spaces in the amount of the tab width
3695 Decrease indent Ctrl-U Removes one tab or the amount of spaces of
3696 the tab width setting from the indentation of the
3697 current line or selection.
3699 Increase indent by one space Indents the current line or selection by one
3702 Decrease indent by one space Deindents the current line or selection by one
3705 Smart line indent Indents the current line or all selected lines
3706 with the same indentation as the previous line.
3708 Send to Custom Command 1 (2,3) Ctrl-1 (2,3) Passes the current selection to a configured
3709 external command (available for the first
3710 9 configured commands, see
3711 `Sending text through custom commands`_ for
3714 Send Selection to Terminal Sends the current selection or the current
3715 line (if there is no selection) to the
3716 embedded Terminal (VTE).
3718 Reflow lines/block Reformat selected lines or current
3719 (indented) text block,
3720 breaking lines at the long line marker or the
3721 line breaking column if line breaking is
3722 enabled for the current document.
3724 Join Lines Replace line endings and following indentation
3725 with a single space throughout the selection
3726 or current (indented) text block.
3727 =============================== ========================= ==================================================
3730 Settings keybindings
3731 ````````````````````
3732 =============================== ========================= ==================================================
3733 Action Default shortcut Description
3734 =============================== ========================= ==================================================
3735 Preferences Ctrl-Alt-P Opens preferences dialog.
3737 Plugin Preferences Opens plugin preferences dialog.
3738 =============================== ========================= ==================================================
3743 =============================== ========================= ==================================================
3744 Action Default shortcut Description
3745 =============================== ========================= ==================================================
3746 Find Ctrl-F (C) Opens the Find dialog.
3748 Find Next Ctrl-G Finds next result.
3750 Find Previous Ctrl-Shift-G Finds previous result.
3752 Find Next Selection Finds next occurrence of selected text.
3754 Find Previous Selection Finds previous occurrence of selected text.
3756 Replace Ctrl-H (C) Opens the Replace dialog.
3758 Find in files Ctrl-Shift-F Opens the Find in files dialog.
3760 Next message Jumps to the line with the next message in
3761 the Messages window.
3763 Previous message Jumps to the line with the previous message
3764 in the Messages window.
3766 Find Usage Ctrl-Shift-E Finds all occurrences of the current word
3767 or selection (see note below) in all open
3768 documents and displays them in the messages
3771 Find Document Usage Ctrl-Shift-D Finds all occurrences of the current word
3772 or selection (see note below) in the current
3773 document and displays them in the messages
3776 Mark All Ctrl-Shift-M Highlight all matches of the current
3777 word/selection (see note below) in the current
3778 document with a colored box. If there's nothing
3779 to find, or the cursor is next to an existing
3780 match, the highlighted matches will be cleared.
3781 =============================== ========================= ==================================================
3784 The keybindings marked "see note below" work like this: if no text is
3785 selected, the word under cursor is used, and *it has to match fully*
3786 (like when `Match only a whole word` is enabled in the Search dialog).
3787 However if some text is selected, then it is matched regardless of
3793 =============================== ========================= ==================================================
3794 Action Default shortcut Description
3795 =============================== ========================= ==================================================
3796 Navigate forward a location Alt-Right (C) Switches to the next location in the navigation
3797 history. See the section called `Code Navigation
3800 Navigate back a location Alt-Left (C) Switches to the previous location in the
3801 navigation history. See the section called
3802 `Code navigation history`_.
3804 Go to line Ctrl-L Focuses the Go to Line entry (if visible) or
3805 shows the Go to line dialog.
3807 Go to matching brace Ctrl-B If the cursor is ahead or behind a brace, then it
3808 is moved to the brace which belongs to the current
3809 one. If this keyboard shortcut is pressed again,
3810 the cursor is moved back to the first brace.
3812 Toggle marker Ctrl-M Set a marker on the current line, or clear the
3813 marker if there already is one.
3815 Go to next marker Ctrl-. Go to the next marker in the current document.
3817 Go to previous marker Ctrl-, Go to the previous marker in the current document.
3819 Go to symbol definition Ctrl-T Jump to the definition of the current word or
3820 selection. See `Go to symbol definition`_.
3822 Go to symbol declaration Ctrl-Shift-T Jump to the declaration of the current word or
3823 selection. See `Go to symbol declaration`_.
3825 Go to Start of Line Home Move the caret to the start of the line.
3826 Behaves differently if smart_home_key_ is set.
3828 Go to End of Line End Move the caret to the end of the line.
3830 Go to Start of Display Line Alt-Home Move the caret to the start of the display line.
3831 This is useful when you use line wrapping and
3832 want to jump to the start of the wrapped, virtual
3833 line, not the real start of the whole line.
3834 If the line is not wrapped, it behaves like
3835 `Go to Start of Line`.
3837 Go to End of Display Line Alt-End Move the caret to the end of the display line.
3838 If the line is not wrapped, it behaves like
3839 `Go to End of Line`.
3841 Go to Previous Word Part Ctrl-/ Go to the previous part of the current word.
3843 Go to Next Word Part Ctrl-\\ Go to the next part of the current word.
3844 =============================== ========================= ==================================================
3848 =============================== ========================= ==================================================
3849 Action Default shortcut Description
3850 =============================== ========================= ==================================================
3851 Fullscreen F11 (C) Switches to fullscreen mode.
3853 Toggle Messages Window Toggles the message window (status and compiler
3854 messages) on and off.
3856 Toggle Sidebar Shows or hides the sidebar.
3858 Toggle all additional widgets Hide and show all additional widgets like the
3859 notebook tabs, the toolbar, the messages window
3862 Zoom In Ctrl-+ (C) Zooms in the text.
3864 Zoom Out Ctrl-- (C) Zooms out the text.
3866 Zoom Reset Ctrl-0 Reset any previous zoom on the text.
3867 =============================== ========================= ==================================================
3871 ================================ ========================= ==================================================
3872 Action Default shortcut Description
3873 ================================ ========================= ==================================================
3874 Switch to Editor F2 Switches to editor widget.
3875 Also reshows the document statistics line
3876 (after a short timeout).
3878 Switch to Search Bar F7 Switches to the search bar in the toolbar (if
3881 Switch to Message Window Focus the Message Window's current tab.
3883 Switch to Compiler Focus the Compiler message window tab.
3885 Switch to Messages Focus the Messages message window tab.
3887 Switch to Scribble F6 Switches to scribble widget.
3889 Switch to VTE F4 Switches to VTE widget.
3891 Switch to Sidebar Focus the Sidebar.
3893 Switch to Sidebar Symbol List Focus the Symbol list tab in the Sidebar
3896 Switch to Sidebar Document List Focus the Document list tab in the Sidebar
3898 ================================ ========================= ==================================================
3901 Notebook tab keybindings
3902 ````````````````````````
3903 =============================== ========================= ==================================================
3904 Action Default shortcut Description
3905 =============================== ========================= ==================================================
3906 Switch to left document Ctrl-PageUp (C) Switches to the previous open document.
3908 Switch to right document Ctrl-PageDown (C) Switches to the next open document.
3910 Switch to last used document Ctrl-Tab Switches to the previously shown document (if it's
3912 Holding Ctrl (or another modifier if the keybinding
3913 has been changed) will show a dialog, then repeated
3914 presses of the keybinding will switch to the 2nd-last
3915 used document, 3rd-last, etc. Also known as
3916 Most-Recently-Used documents switching.
3918 Move document left Ctrl-Shift-PageUp Changes the current document with the left hand
3921 Move document right Ctrl-Shift-PageDown Changes the current document with the right hand
3924 Move document first Moves the current document to the first position.
3926 Move document last Moves the current document to the last position.
3927 =============================== ========================= ==================================================
3930 Document keybindings
3931 ````````````````````
3932 ==================================== ==================== ==================================================
3933 Action Default shortcut Description
3934 ==================================== ==================== ==================================================
3935 Clone See `Cloning documents`_.
3937 Replace tabs with space Replaces all tabs with the right amount of spaces
3938 in the whole document, or the current selection.
3940 Replace spaces with tabs Replaces leading spaces with tab characters in the
3941 whole document, or the current selection.
3943 Toggle current fold Toggles the folding state of the current code block.
3945 Fold all Folds all contractible code blocks.
3947 Unfold all Unfolds all contracted code blocks.
3949 Reload symbol list Ctrl-Shift-R Reloads the symbol list.
3951 Toggle Line wrapping Enables or disables wrapping of long lines.
3953 Toggle Line breaking Enables or disables automatic breaking of long
3954 lines at a configurable column.
3956 Remove Markers Remove any markers on lines or words which
3957 were set by using 'Mark All' in the
3958 search dialog or by manually marking lines.
3960 Remove Error Indicators Remove any error indicators in the
3963 Remove Markers and Error Indicators Combines ``Remove Markers`` and
3964 ``Remove Error Indicators``.
3965 ==================================== ==================== ==================================================
3970 =============================== ========================= ==================================================
3971 Action Default shortcut Description
3972 =============================== ========================= ==================================================
3973 New Create a new project.
3974 Open Opens a project file.
3975 Properties Shows project properties.
3976 Close Close the current project.
3977 =============================== ========================= ==================================================
3982 =============================== ========================= ==================================================
3983 Action Default shortcut Description
3984 =============================== ========================= ==================================================
3985 Compile F8 Compiles the current file.
3987 Build F9 Builds (compiles if necessary and links) the
3990 Make all Shift-F9 Builds the current file with the Make tool.
3992 Make custom target Ctrl-Shift-F9 Builds the current file with the Make tool and a
3995 Make object Shift-F8 Compiles the current file with the Make tool.
3997 Next error Jumps to the line with the next error from the
4000 Previous error Jumps to the line with the previous error from
4001 the last build process.
4003 Run F5 Executes the current file in a terminal emulation.
4005 Set Build Commands Opens the build commands dialog.
4006 =============================== ========================= ==================================================
4011 =============================== ========================= ==================================================
4012 Action Default shortcut Description
4013 =============================== ========================= ==================================================
4014 Show Color Chooser Opens the Color Chooser dialog.
4015 =============================== ========================= ==================================================
4020 =============================== ========================= ==================================================
4021 Action Default shortcut Description
4022 =============================== ========================= ==================================================
4023 Help F1 (C) Opens the manual.
4024 =============================== ========================= ==================================================
4032 You must use UTF-8 encoding *without BOM* for configuration files.
4035 Configuration file paths
4036 ------------------------
4037 Geany has default configuration files installed for the system and
4038 also per-user configuration files.
4040 The system files should not normally be edited because they will be
4041 overwritten when upgrading Geany.
4043 The user configuration directory can be overridden with the ``-c``
4044 switch, but this is not normally done. See `Command line options`_.
4047 Any missing subdirectories in the user configuration directory
4048 will be created when Geany starts.
4050 You can check the paths Geany is using with *Help->Debug Messages*.
4051 Near the top there should be 2 lines with something like::
4053 Geany-INFO: System data dir: /usr/share/geany
4054 Geany-INFO: User config dir: /home/username/.config/geany
4057 Paths on Unix-like systems
4058 ^^^^^^^^^^^^^^^^^^^^^^^^^^
4059 The system path is ``$prefix/share/geany``, where ``$prefix`` is the
4060 path where Geany is installed (see `Installation prefix`_).
4062 The user configuration directory is normally:
4063 ``/home/username/.config/geany``
4067 The system path is the ``data`` subfolder of the installation path
4070 The user configuration directory might vary, but on Windows XP it's:
4071 ``C:\Documents and Settings\UserName\Application Data\geany``
4072 On Windows 7 and above you most likely will find it at:
4073 ``C:\users\UserName\Roaming\geany``
4078 There's a *Configuration files* submenu in the *Tools* menu that
4079 contains items for some of the available user configuration files.
4080 Clicking on one opens it in the editor for you to update. Geany will
4081 reload the file after you have saved it.
4084 Other configuration files not shown here will need to be opened
4085 manually, and will not be automatically reloaded when saved.
4086 (see *Reload Configuration* below).
4088 There's also a *Reload Configuration* item which can be used if you
4089 updated one of the other configuration files, or modified or added
4092 *Reload Configuration* is also necessary to update syntax highlighting colors.
4095 Syntax highlighting colors aren't updated in open documents after
4096 saving filetypes.common as this may take a significant
4100 Customizing Geany's appearance using GTK+ CSS
4101 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4103 To override GTK+ CSS styles, you can use traditional mechanisms or you
4104 can use the *Tools->Configuration files* menu to open a file named
4105 ``geany.css`` which will be loaded after other CSS styles
4106 are applied to allow overriding the default styles.
4108 Geany offers a number of CSS IDs which can be used to taylor its
4109 appearance. Among the more interesting include:
4111 * ``geany-compiler-context`` - the style used for build command output surrounding errors
4112 * ``geany-compiler-error`` - the style used for build command errors
4113 * ``geany-compiler-message`` - the style other output encountered while running build command
4114 * ``geany-document-status-changed`` - the style for document tab labels when the document is changed
4115 * ``geany-document-status-disk-changed`` - the style for document tab labels when the file on disk has changed
4116 * ``geany-document-status-readyonly``` - the style for document tab labels when the document is read-only
4117 * ``geany-search-entry-no-match`` - the style of find/replace dialog entries when no match is found
4118 * ``geany-terminal-dirty`` - the style for the message window Terminal tab label when the terminal output has changed.
4121 Global configuration file
4122 -------------------------
4124 System administrators can add a global configuration file for Geany
4125 which will be used when starting Geany and a user configuration file
4128 The global configuration file is read from ``geany.conf`` in the
4129 system configuration path - see `Configuration file paths`_. It can
4130 contain any settings which are found in the usual configuration file
4131 created by Geany, but does not have to contain all settings.
4134 This feature is mainly intended for package maintainers or system
4135 admins who want to set up Geany in a multi user environment and
4136 set some sane default values for this environment. Usually users won't
4141 Filetype definition files
4142 -------------------------
4144 All color definitions and other filetype specific settings are
4145 stored in the filetype definition files. Those settings are colors
4146 for syntax highlighting, general settings like comment characters or
4147 word delimiter characters as well as compiler and linker settings.
4149 See also `Configuration file paths`_.
4153 Each filetype has a corresponding filetype definition file. The format
4154 for built-in filetype `Foo` is::
4158 The extension is normally just the filetype name in lower case.
4160 However there are some exceptions:
4162 =============== =========
4164 =============== =========
4168 Matlab/Octave matlab
4169 =============== =========
4171 There is also the `special file filetypes.common`_.
4173 For `custom filetypes`_, the filename for `Foo` is different::
4177 See the link for details.
4181 The system-wide filetype configuration files can be found in the
4182 system configuration path and are called ``filetypes.$ext``,
4183 where $ext is the name of the filetype. For every
4184 filetype there is a corresponding definition file. There is one
4185 exception: ``filetypes.common`` -- this file is for general settings,
4186 which are not specific to a certain filetype.
4189 It is not recommended that users edit the system-wide files,
4190 because they will be overridden when Geany is updated.
4194 To change the settings, copy a file from the system configuration
4195 path to the subdirectory ``filedefs`` in your user configuration
4196 directory. Then you can edit the file and the changes will still be
4197 available after an update of Geany.
4199 Alternatively, you can create the file yourself and add only the
4200 settings you want to change. All missing settings will be read from
4201 the corresponding system configuration file.
4205 At startup Geany looks for ``filetypes.*.conf`` files in the system and
4206 user filetype paths, adding any filetypes found with the name matching
4207 the '``*``' wildcard - e.g. ``filetypes.Bar.conf``.
4209 Custom filetypes are not as powerful as built-in filetypes, but
4210 support for the following has been implemented:
4212 * Recognizing and setting the filetype (after the user has manually updated
4213 the `filetype extensions`_ file).
4214 * `Filetype group membership`_.
4215 * Reading filetype settings in the ``[settings]`` section, including:
4216 * Using an existing syntax highlighting lexer (`lexer_filetype`_ key).
4217 * Using an existing tags parser (`tag_parser`_ key).
4218 * Build commands (``[build-menu]`` section).
4219 * Loading global tags files (sharing the ``tag_parser`` filetype's namespace).
4221 See `Filetype configuration`_ for details on each setting.
4223 Creating a custom filetype from an existing filetype
4224 ````````````````````````````````````````````````````
4225 Because most filetype settings will relate to the syntax
4226 highlighting (e.g. styling, keywords, ``lexer_properties``
4227 sections), it is best to copy an existing filetype file that uses
4228 the lexer you wish to use as the basis of a custom filetype, using
4229 the correct filename extension format shown above, e.g.::
4231 cp filetypes.foo filetypes.Bar.conf
4233 Then add the ``lexer_filetype=Foo`` setting (if not already present)
4234 and add/adjust other settings.
4237 The ``[styling]`` and ``[keywords]`` sections have key names
4238 specific to each filetype/lexer. You must follow the same
4239 names - in particular, some lexers only support one keyword
4243 Filetype configuration
4244 ^^^^^^^^^^^^^^^^^^^^^^
4246 As well as the sections listed below, each filetype file can contain
4247 a [build-menu] section as described in `[build-menu] section`_.
4252 In this section the colors for syntax highlighting are defined. The
4255 * ``key=foreground_color;background_color;bold_flag;italic_flag``
4257 Colors have to be specified as RGB hex values prefixed by
4258 0x or # similar to HTML/CSS hex triplets. For example, all of the following
4259 are valid values for pure red; 0xff0000, 0xf00, #ff0000, or #f00. The
4260 values are case-insensitive but it is a good idea to use lower-case.
4261 Note that you can also use *named colors* as well by substituting the
4262 color value with the name of a color as defined in the ``[named_colors]``
4263 section, see the `[named_colors] Section`_ for more information.
4265 Bold and italic are flags and should only be "true" or "false". If their
4266 value is something other than "true" or "false", "false" is assumed.
4268 You can omit fields to use the values from the style named ``"default"``.
4270 E.g. ``key=0xff0000;;true``
4272 This makes the key style have red foreground text, default background
4273 color text and bold emphasis.
4277 The second format uses a *named style* name to reference a style
4278 defined in filetypes.common.
4280 * ``key=named_style``
4281 * ``key2=named_style2,bold,italic``
4283 The bold and italic parts are optional, and if present are used to
4284 toggle the bold or italic flags to the opposite of the named style's
4285 flags. In contrast to style definition booleans, they are a literal
4286 ",bold,italic" and commas are used instead of semi-colons.
4288 E.g. ``key=comment,italic``
4290 This makes the key style match the ``"comment"`` named style, but with
4293 To define named styles, see the filetypes.common `[named_styles]
4296 Reading styles from another filetype
4297 ************************************
4298 You can automatically copy all of the styles from another filetype
4299 definition file by using the following syntax for the ``[styling]``
4304 Where Foo is a filetype name. The corresponding ``[styling]``
4305 section from ``filetypes.foo`` will be read.
4307 This is useful when the same lexer is being used for multiple
4308 filetypes (e.g. C/C++/C#/Java/etc). For example, to make the C++
4309 styling the same as the C styling, you would put the following in
4318 This section contains keys for different keyword lists specific to
4319 the filetype. Some filetypes do not support keywords, so adding a
4320 new key will not work. You can only add or remove keywords to/from
4324 The keywords list must be in one line without line ending characters.
4327 [lexer_properties] section
4328 ``````````````````````````
4329 Here any special properties for the Scintilla lexer can be set in the
4330 format ``key.name.field=some.value``.
4332 Properties Geany uses are listed in the system filetype files. To find
4333 other properties you need Geany's source code::
4335 egrep -o 'GetProperty\w*\("([^"]+)"[^)]+\)' scintilla/Lex*.cxx
4342 This is the default file extension used when saving files, not
4343 including the period character (``.``). The extension used should
4344 match one of the patterns associated with that filetype (see
4345 `Filetype extensions`_).
4347 *Example:* ``extension=cxx``
4350 These characters define word boundaries when making selections
4351 and searching using word matching options.
4353 *Example:* (look at system filetypes.\* files)
4356 This overrides the *wordchars* filetypes.common setting, and
4357 has precedence over the *whitespace_chars* setting.
4360 A character or string which is used to comment code. If you want to use
4361 multiline comments only, don't set this but rather comment_open and
4364 Single-line comments are used in priority over multiline comments to
4365 comment a line, e.g. with the `Comment/Uncomment line` command.
4367 *Example:* ``comment_single=//``
4370 A character or string which is used to comment code. You need to also
4371 set comment_close to really use multiline comments. If you want to use
4372 single-line comments, prefer setting comment_single.
4374 Multiline comments are used in priority over single-line comments to
4375 comment a block, e.g. template comments.
4377 *Example:* ``comment_open=/*``
4380 If multiline comments are used, this is the character or string to
4383 *Example:* ``comment_close=*/``
4386 Set this to false if a comment character or string should start at
4387 column 0 of a line. If set to true it uses any indentation of the
4390 Note: Comment indentation
4392 ``comment_use_indent=true`` would generate this if a line is
4393 commented (e.g. with Ctrl-D)::
4397 ``comment_use_indent=false`` would generate this if a line is
4398 commented (e.g. with Ctrl-D)::
4400 # command_example();
4403 Note: This setting only works for single line comments (like '//',
4406 *Example:* ``comment_use_indent=true``
4409 A command which can be executed on the current word or the current
4412 Example usage: Open the API documentation for the
4413 current function call at the cursor position.
4416 be set for every filetype or if not set, a global command will
4417 be used. The command itself can be specified without the full
4418 path, then it is searched in $PATH. But for security reasons,
4419 it is recommended to specify the full path to the command. The
4420 wildcard %s will be replaced by the current word at the cursor
4421 position or by the current selection.
4423 Hint: for PHP files the following could be quite useful:
4424 context_action_cmd=firefox "https://www.php.net/%s"
4426 *Example:* ``context_action_cmd=devhelp -s "%s"``
4431 The TagManager language name, e.g. "C". Usually the same as the
4437 A filetype name to setup syntax highlighting from another filetype.
4438 This must not be recursive, i.e. it should be a filetype name that
4439 doesn't use the *lexer_filetype* key itself, e.g.::
4444 The second line is wrong, because ``filetypes.cpp`` itself uses
4445 ``lexer_filetype=C``, which would be recursive.
4447 symbol_list_sort_mode
4448 What the default symbol list sort order should be.
4450 ===== ========================================
4452 ===== ========================================
4453 0 Sort symbols by name
4454 1 Sort symbols by appearance (line number)
4455 ===== ========================================
4457 .. _xml_indent_tags:
4460 If this setting is set to *true*, a new line after a line ending with an
4461 unclosed XML/HTML tag will be automatically indented. This only applies
4462 to filetypes for which the HTML or XML lexer is used. Such filetypes have
4463 this setting in their system configuration files.
4466 The MIME type for this file type, e.g. "text/x-csrc". This is used
4467 for example to chose the icon to display for this file type.
4470 [indentation] section
4471 `````````````````````
4473 This section allows definition of default indentation settings specific to
4474 the file type, overriding the ones configured in the preferences. This can
4475 be useful for file types requiring specific indentation settings (e.g. tabs
4476 only for Makefile). These settings don't override auto-detection if activated.
4479 The forced indentation width.
4482 The forced indentation type.
4484 ===== =======================
4485 Value Indentation type
4486 ===== =======================
4489 2 Mixed (tabs and spaces)
4490 ===== =======================
4493 [build-menu] filetype section
4494 `````````````````````````````
4495 This supports the same keys as the ``geany.conf`` `[build-menu] section`_.
4500 FT_00_CM=gcc -c "%f"
4503 FT_01_CM=gcc -o "%e" "%f"
4508 error_regex=^([^:]+):([0-9]+):
4510 [build_settings] section
4511 ````````````````````````
4512 As of Geany 0.19 this section is for legacy support.
4513 Values that are set in the [build-menu] section will override those in this section.
4515 If any build menu item settings have been configured in the
4516 `Set Build Commands dialog`_ (or the *Build* tab of the
4517 `Project Properties`_ dialog), then these settings are stored in the
4518 [build-menu] section and will override the settings in this section for
4522 See the [build-menu] section for details.
4527 This item specifies the command to compile source code files. But
4528 it is also possible to use it with interpreted languages like Perl
4529 or Python. With these filetypes you can use this option as a kind of
4530 syntax parser, which sends output to the compiler message window.
4532 You should quote the filename to also support filenames with
4533 spaces. The following wildcards for filenames are available:
4535 * %f -- complete filename without path
4536 * %e -- filename without path and without extension
4538 *Example:* ``compiler=gcc -Wall -c "%f"``
4541 This item specifies the command to link the file. If the file is not
4542 already compiled, it will be compiled while linking. The -o option
4543 is automatically added by Geany. This item works well with GNU gcc,
4544 but may be problematic with other compilers (esp. with the linker).
4546 *Example:* ``linker=gcc -Wall "%f"``
4549 Use this item to execute your file. It has to have been built
4550 already. Use the %e wildcard to have only the name of the executable
4551 (i.e. without extension) or use the %f wildcard if you need the
4552 complete filename, e.g. for shell scripts.
4554 *Example:* ``run_cmd="./%e"``
4557 Special file filetypes.common
4558 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4560 There is a special filetype definition file called
4561 filetypes.common. This file defines some general non-filetype-specific
4564 You can open the user filetypes.common with the
4565 *Tools->Configuration Files->filetypes.common* menu item. This adds
4566 the default settings to the user file if the file doesn't exist.
4567 Alternatively the file can be created manually, adding only the
4568 settings you want to change. All missing settings will be read from
4572 See the `Filetype configuration`_ section for how to define styles.
4575 [named_styles] section
4576 ``````````````````````
4577 Named styles declared here can be used in the [styling] section of any
4582 *In filetypes.common*::
4585 foo=0xc00000;0xffffff;false;true
4593 This saves copying and pasting the whole style definition into several
4597 You can define aliases for named styles, as shown with the ``bar``
4598 entry in the above example, but they must be declared after the
4602 [named_colors] section
4603 ``````````````````````
4604 Named colors declared here can be used in the ``[styling]`` or
4605 ``[named_styles]`` section of any filetypes.* file or color scheme.
4610 my_red_color=#FF0000
4611 my_blue_color=#0000FF
4614 foo=my_red_color;my_blue_color;false;true
4616 This allows to define a color palette by name so that to change a color
4617 scheme-wide only involves changing the hex value in a single location.
4622 This is the default style. It is used for styling files without a
4625 *Example:* ``default=0x000000;0xffffff;false;false``
4628 The style for coloring selected text. The format is:
4632 * Use foreground color
4633 * Use background color
4635 The colors are only set if the 3rd or 4th argument is true. When
4636 the colors are not overridden, the default is a dark grey
4637 background with syntax highlighted foreground text.
4639 *Example:* ``selection=0xc0c0c0;0x00007F;true;true``
4642 The style for brace highlighting when a matching brace was found.
4644 *Example:* ``brace_good=0xff0000;0xFFFFFF;true;false``
4647 The style for brace highlighting when no matching brace was found.
4649 *Example:* ``brace_bad=0x0000ff;0xFFFFFF;true;false``
4652 The style for coloring the caret(the blinking cursor). Only first
4653 and third argument is interpreted.
4654 Set the third argument to true to change the caret into a block caret.
4656 *Example:* ``caret=0x000000;0x0;false;false``
4659 The width for the caret(the blinking cursor). Only the first
4660 argument is interpreted. The width is specified in pixels with
4661 a maximum of three pixel. Use the width 0 to make the caret
4664 *Example:* ``caret_width=3``
4667 The style for coloring the background of the current line. Only
4668 the second and third arguments are interpreted. The second argument
4669 is the background color. Use the third argument to enable or
4670 disable background highlighting for the current line (has to be
4673 *Example:* ``current_line=0x0;0xe5e5e5;true;false``
4676 The style for coloring the indentation guides. Only the first and
4677 second arguments are interpreted.
4679 *Example:* ``indent_guide=0xc0c0c0;0xffffff;false;false``
4682 The style for coloring the white space if it is shown. The first
4683 both arguments define the foreground and background colors, the
4684 third argument sets whether to use the defined foreground color
4685 or to use the color defined by each filetype for the white space.
4686 The fourth argument defines whether to use the background color.
4688 *Example:* ``white_space=0xc0c0c0;0xffffff;true;true``
4691 Line number margin foreground and background colors.
4693 .. _Folding Settings:
4696 Fold margin foreground and background colors.
4698 fold_symbol_highlight
4699 Highlight color of folding symbols.
4702 The style of folding icons. Only first and second arguments are
4705 Valid values for the first argument are:
4712 Valid values for the second argument are:
4715 * 1 -- for straight lines
4716 * 2 -- for curved lines
4718 *Default:* ``folding_style=1;1;``
4720 *Arrows:* ``folding_style=3;0;``
4723 Draw a thin horizontal line at the line where text is folded. Only
4724 first argument is used.
4726 Valid values for the first argument are:
4728 * 0 -- disable, do not draw a line
4729 * 1 -- draw the line above folded text
4730 * 2 -- draw the line below folded text
4732 *Example:* ``folding_horiz_line=0;0;false;false``
4735 First argument: drawing of visual flags to indicate a line is wrapped.
4736 This is a bitmask of the values:
4738 * 0 -- No visual flags
4739 * 1 -- Visual flag at end of subline of a wrapped line
4740 * 2 -- Visual flag at begin of subline of a wrapped line. Subline is
4741 indented by at least 1 to make room for the flag.
4743 Second argument: wether the visual flags to indicate a line is wrapped
4744 are drawn near the border or near the text. This is a bitmask of the values:
4746 * 0 -- Visual flags drawn near border
4747 * 1 -- Visual flag at end of subline drawn near text
4748 * 2 -- Visual flag at begin of subline drawn near text
4750 Only first and second arguments are interpreted.
4752 *Example:* ``line_wrap_visuals=3;0;false;false``
4755 First argument: sets the size of indentation of sublines for wrapped lines
4756 in terms of the width of a space, only used when the second argument is ``0``.
4758 Second argument: wrapped sublines can be indented to the position of their
4759 first subline or one more indent level. Possible values:
4761 * 0 - Wrapped sublines aligned to left of window plus amount set by the first argument
4762 * 1 - Wrapped sublines are aligned to first subline indent (use the same indentation)
4763 * 2 - Wrapped sublines are aligned to first subline indent plus one more level of indentation
4765 Only first and second arguments are interpreted.
4767 *Example:* ``line_wrap_indent=0;1;false;false``
4770 Translucency for the current line (first argument) and the selection
4771 (second argument). Values between 0 and 256 are accepted.
4773 Note for Windows 95, 98 and ME users:
4774 keep this value at 256 to disable translucency otherwise Geany might crash.
4776 Only the first and second arguments are interpreted.
4778 *Example:* ``translucency=256;256;false;false``
4781 The style for a highlighted line (e.g when using *Go to line* or *Go to symbol*).
4782 The foreground color (first argument) is only used when the Markers margin
4783 is enabled (see View menu).
4785 Only the first and second arguments are interpreted.
4787 *Example:* ``marker_line=0x000000;0xffff00;false;false``
4790 The style for a marked search results (when using "Mark" in Search dialogs).
4791 The second argument sets the background color for the drawn rectangle.
4793 Only the second argument is interpreted.
4795 *Example:* ``marker_search=0x000000;0xb8f4b8;false;false``
4798 The style for a marked line (e.g when using the "Toggle Marker" keybinding
4799 (Ctrl-M)). The foreground color (first argument) is only used
4800 when the Markers margin is enabled (see View menu).
4802 Only the first and second arguments are interpreted.
4804 *Example:* ``marker_mark=0x000000;0xb8f4b8;false;false``
4807 Translucency for the line marker (first argument) and the search marker
4808 (second argument). Values between 0 and 256 are accepted.
4810 Note for Windows 95, 98 and ME users:
4811 keep this value at 256 to disable translucency otherwise Geany might crash.
4813 Only the first and second arguments are interpreted.
4815 *Example:* ``marker_translucency=256;256;false;false``
4818 Amount of space to be drawn above and below the line's baseline.
4819 The first argument defines the amount of space to be drawn above the line, the second
4820 argument defines the amount of space to be drawn below.
4822 Only the first and second arguments are interpreted.
4824 *Example:* ``line_height=0;0;false;false``
4827 The style for coloring the calltips. The first two arguments
4828 define the foreground and background colors, the third and fourth
4829 arguments set whether to use the defined colors.
4831 *Example:* ``calltips=0xc0c0c0;0xffffff;false;false``
4834 The color of the error indicator.
4836 Only the first argument (foreground color) is used.
4838 *Example:* ``indicator_error=0xff0000``
4844 Characters to treat as whitespace. These characters are ignored
4845 when moving, selecting and deleting across word boundaries
4846 (see `Scintilla keyboard commands`_).
4848 This should include space (\\s) and tab (\\t).
4850 *Example:* ``whitespace_chars=\s\t!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~``
4853 These characters define word boundaries when making selections
4854 and searching using word matching options.
4856 *Example:* ``wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789``
4859 This has precedence over the *whitespace_chars* setting.
4867 To change the default filetype extension used when saving a new file,
4868 see `Filetype definition files`_.
4870 You can override the list of file extensions that Geany uses to detect
4871 filetypes using the user ``filetype_extensions.conf`` file. Use the
4872 *Tools->Configuration Files->filetype_extensions.conf* menu item. See
4873 also `Configuration file paths`_.
4875 You should only list lines for filetype extensions that you want to
4876 override in the user configuration file and remove or comment out
4877 others. The patterns are listed after the ``=`` sign, using a
4878 semi-colon separated list of patterns which should be matched for
4881 For example, to override the filetype extensions for Make, the file
4885 Make=Makefile*;*.mk;Buildfile;
4887 Filetype group membership
4888 ^^^^^^^^^^^^^^^^^^^^^^^^^
4889 Filetype groups are used in the `Document->Set Filetype` menu.
4891 Group membership is also stored in ``filetype_extensions.conf``. This
4892 file is used to store information Geany needs at startup, whereas the
4893 separate filetype definition files hold information only needed when
4894 a document with their filetype is used.
4896 The format looks like::
4905 The key names cannot be configured.
4908 Group membership is only read at startup.
4911 You can make commonly used filetypes appear in the top-level of the
4912 filetype menu by adding them to the `None` group, e.g.
4915 Preferences file format
4916 -----------------------
4918 The user preferences file ``geany.conf`` holds settings for all the items configured
4919 in the preferences dialog. This file should not be edited while Geany is running
4920 as the file will be overwritten when the preferences in Geany are changed or Geany
4924 [build-menu] section
4925 ^^^^^^^^^^^^^^^^^^^^
4927 The [build-menu] section contains the configuration of the build menu.
4928 This section can occur in filetype, preferences and project files and
4929 always has the format described here. Different menu items are loaded
4930 from different files, see the table in the `Build Menu Configuration`_
4931 section for details. All the settings can be configured from the dialogs
4932 except the execute command in filetype files and filetype definitions in
4933 the project file, so these are the only ones which need hand editing.
4937 The build-menu section stores one entry for each setting for each menu item that
4938 is configured. The keys for these settings have the format:
4944 * GG - is the menu item group,
4946 - FT for filetype build
4947 - NF for independent (non-filetype) build
4950 * NN - is a two decimal digit number of the item within the group,
4952 * FF - is the field,
4956 - WD for working directory
4958 See `[build-menu] filetype section`_ for an example.
4960 Error regular expression
4961 ````````````````````````
4963 This is a Perl-compatible regular expression (PCRE) to parse a filename
4964 (absolute or relative) and line number from the build output.
4965 If undefined, Geany will fall back to its default error message parsing.
4967 Only the first two match groups will be read by Geany. These groups can
4968 occur in any order: the match group consisting of only digits will be used
4969 as the line number, and the other group as the filename. In no group
4970 consists of only digits, the match will fail.
4972 *Example:* ``error_regex=^(.+):([0-9]+):[0-9]+``
4974 This will parse a message such as:
4975 ``test.py:7:24: E202 whitespace before ']'``
4981 The project file contains project related settings and possibly a
4982 record of the current session files.
4985 [build-menu] additions
4986 ^^^^^^^^^^^^^^^^^^^^^^
4988 The project file also can have extra fields in the [build-menu] section
4989 in addition to those listed in `[build-menu] section`_ above.
4991 When filetype menu items are configured for the project they are stored
4992 in the project file.
4994 The ``filetypes`` entry is a list of the filetypes which exist in the
4997 For each filetype the entries for that filetype have the format defined in
4998 `[build-menu] section`_ but the key is prefixed by the name of the filetype
4999 as it appears in the ``filetypes`` entry, eg the entry for the label of
5000 filetype menu item 0 for the C filetype would be
5008 Geany supports the following templates:
5012 * Function description
5017 To use these templates, just open the Edit menu or open the popup menu
5018 by right-clicking in the editor widget, and choose "Insert Comments"
5019 and insert templates as you want.
5021 Some templates (like File header or ChangeLog entry) will always be
5022 inserted at the top of the file.
5024 To insert a function description, the cursor must be inside
5025 of the function, so that the function name can be determined
5026 automatically. The description will be positioned correctly one line
5027 above the function, just check it out. If the cursor is not inside
5028 of a function or the function name cannot be determined, the inserted
5029 function description won't contain the correct function name but "unknown"
5033 Geany automatically reloads template information when it notices you
5034 save a file in the user's template configuration directory. You can
5035 also force this by selecting *Tools->Reload Configuration*.
5041 Meta data can be used with all templates, but by default user set
5042 meta data is only used for the ChangeLog and File header templates.
5044 In the configuration dialog you can find a tab "Templates" (see
5045 `Template preferences`_). You can define the default values
5046 which will be inserted in the templates.
5052 File templates are templates used as the basis of a new file. To
5053 use them, choose the *New (with Template)* menu item from the *File*
5054 menu. If there is more than one template for a filetype then they
5055 will be grouped in a submenu.
5057 By default, file templates are installed for some filetypes. Custom
5058 file templates can be added by creating the appropriate template file. You can
5059 also edit the default file templates.
5061 The file's contents are just the text to place in the document, with
5062 optional template wildcards like ``{fileheader}``. The fileheader
5063 wildcard can be placed anywhere, but it's usually put on the first
5064 line of the file, followed by a blank line.
5066 Adding file templates
5067 `````````````````````
5069 File templates are read from ``templates/files`` under the
5070 `Configuration file paths`_.
5072 The filetype to use is detected from the template file's extension, if
5073 any. For example, creating a file ``module.c`` would add a menu item
5074 which created a new document with the filetype set to 'C'.
5076 The template file is read from disk when the corresponding menu item is
5080 Customizing templates
5081 ^^^^^^^^^^^^^^^^^^^^^
5083 Each template can be customized to your needs. The templates are
5084 stored in the ``~/.config/geany/templates/`` directory (see the section called
5085 `Command line options`_ for further information about the configuration
5086 directory). Just open the desired template with an editor (ideally,
5087 Geany ;-) ) and edit the template to your needs. There are some
5088 wildcards which will be automatically replaced by Geany at startup.
5094 All wildcards must be enclosed by "{" and "}", e.g. {date}.
5096 **Wildcards for character escaping**
5098 ============== ============================================= =======================================
5099 Wildcard Description Available in
5100 ============== ============================================= =======================================
5101 ob { Opening Brace (used to prevent other file templates, file header, snippets.
5102 wildcards being expanded).
5103 cb } Closing Brace. file templates, file header, snippets.
5104 pc \% Percent (used to escape e.g. ``%block%``
5105 in snippets). snippets.
5106 ============== ============================================= =======================================
5111 These are configurable, see `Template preferences`_.
5113 ============== ============================================= =======================================
5114 Wildcard Description Available in
5115 ============== ============================================= =======================================
5116 developer The name of the developer. file templates, file header,
5117 function description, ChangeLog entry,
5120 initial The developer's initials, e.g. "ET" for file templates, file header,
5121 Enrico Tröger or "JFD" for John Foobar Doe. function description, ChangeLog entry,
5124 mail The email address of the developer. file templates, file header,
5125 function description, ChangeLog entry,
5128 company The company the developer is working for. file templates, file header,
5129 function description, ChangeLog entry,
5132 version The initial version of a new file. file templates, file header,
5133 function description, ChangeLog entry,
5135 ============== ============================================= =======================================
5137 Date & time wildcards
5138 *********************
5140 The format for these wildcards can be changed in the preferences
5141 dialog, see `Template preferences`_. For a list of available conversion
5142 specifiers see https://docs.gtk.org/glib/method.DateTime.format.html.
5144 ============== ============================================= =======================================
5145 Wildcard Description Available in
5146 ============== ============================================= =======================================
5147 year The current year. Default format is: YYYY. file templates, file header,
5148 function description, ChangeLog entry,
5151 date The current date. Default format: file templates, file header,
5152 YYYY-MM-DD. function description, ChangeLog entry,
5155 datetime The current date and time. Default format: file templates, file header,
5156 DD.MM.YYYY HH:mm:ss ZZZZ. function description, ChangeLog entry,
5158 ============== ============================================= =======================================
5163 ============== ============================================= =======================================
5164 Wildcard Description Available in
5165 ============== ============================================= =======================================
5166 untitled The string "untitled" (this will be file templates, file header,
5167 translated to your locale), used in function description, ChangeLog entry,
5168 file templates. bsd, gpl, snippets.
5170 geanyversion The actual Geany version, e.g. file templates, file header,
5171 "Geany |(version)|". function description, ChangeLog entry,
5174 filename The filename of the current file. file header, snippets, file
5175 For new files, it's only replaced when templates.
5176 first saving if found on the first 4 lines
5179 project The current project's name, if any. file header, snippets, file templates.
5181 description The current project's description, if any. file header, snippets, file templates.
5183 functionname The function name of the function at the function description.
5184 cursor position. This wildcard will only be
5185 replaced in the function description
5188 command:path Executes the specified command and replace file templates, file header,
5189 the wildcard with the command's standard function description, ChangeLog entry,
5190 output. See `Special {command:} wildcard`_ bsd, gpl, snippets.
5192 ============== ============================================= =======================================
5194 Template insertion wildcards
5195 ****************************
5197 ============== ============================================= =======================================
5198 Wildcard Description Available in
5199 ============== ============================================= =======================================
5200 gpl This wildcard inserts a short GPL notice. file header.
5202 bsd This wildcard inserts a BSD licence notice. file header.
5204 fileheader The file header template. This wildcard snippets, file templates.
5205 will only be replaced in file templates.
5206 ============== ============================================= =======================================
5209 Special {command:} wildcard
5210 ***************************
5212 The ``{command:}`` wildcard is a special one because it can execute
5213 a specified command and put the command's output (stdout) into
5222 Linux localhost 2.6.9-023stab046.2-smp #1 SMP Mon Dec 10 15:04:55 MSK 2007 x86_64 GNU/Linux
5224 Using this wildcard you can insert nearly any arbitrary text into the
5227 In the environment of the executed command the variables
5228 ``GEANY_FILENAME``, ``GEANY_FILETYPE`` and ``GEANY_FUNCNAME`` are set.
5229 The value of these variables is filled in only if Geany knows about it.
5230 For example, ``GEANY_FUNCNAME`` is only filled within the function
5231 description template. However, these variables are *always* set,
5232 just maybe with an empty value.
5233 You can easily access them e.g. within an executed shell script using::
5239 If the specified command could not be found or not executed, the wildcard is substituted
5240 by an empty string. In such cases, you can find the occurred error message on Geany's
5241 standard error and in the *Help->Debug Messages* dialog.
5244 Customizing the toolbar
5245 -----------------------
5247 You can add, remove and reorder the elements in the toolbar by using
5248 the toolbar editor, or by manually editing the configuration file
5251 The toolbar editor can be opened from the preferences editor on the Toolbar tab or
5252 by right-clicking on the toolbar itself and choosing it from the menu.
5254 Manually editing the toolbar layout
5255 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5257 To override the system-wide configuration file, copy it to your user
5258 configuration directory (see `Configuration file paths`_).
5262 % cp /usr/local/share/geany/ui_toolbar.xml /home/username/.config/geany/
5264 Then edit it and add any of the available elements listed in the file or remove
5265 any of the existing elements. Of course, you can also reorder the elements as
5266 you wish and add or remove additional separators.
5267 This file must be valid XML, otherwise the global toolbar UI definition
5268 will be used instead.
5270 Your changes are applied once you save the file.
5273 (1) You cannot add new actions which are not listed below.
5274 (2) Everything you add or change must be inside the /ui/toolbar/ path.
5277 Available toolbar elements
5278 ^^^^^^^^^^^^^^^^^^^^^^^^^^
5280 ================== ==============================================================================
5281 Element name Description
5282 ================== ==============================================================================
5283 New Create a new file
5284 Open Open an existing file
5285 Save Save the current file
5286 SaveAll Save all open files
5287 Reload Reload the current file from disk
5288 Close Close the current file
5289 CloseAll Close all open files
5290 Print Print the current file
5291 Cut Cut the current selection
5292 Copy Copy the current selection
5293 Paste Paste the contents of the clipboard
5294 Delete Delete the current selection
5295 Undo Undo the last modification
5296 Redo Redo the last modification
5297 NavBack Navigate back a location
5298 NavFor Navigate forward a location
5299 Compile Compile the current file
5300 Build Build the current file, includes a submenu for Make commands. Geany
5301 remembers the last chosen action from the submenu and uses this as default
5302 action when the button itself is clicked.
5303 Run Run or view the current file
5304 Color Open a color chooser dialog, to interactively pick colors from a palette
5305 ZoomIn Zoom in the text
5306 ZoomOut Zoom out the text
5307 UnIndent Decrease indentation
5308 Indent Increase indentation
5309 Replace Replace text in the current document
5310 SearchEntry The search field belonging to the 'Search' element (can be used alone)
5311 Search Find the entered text in the current file (only useful if you also
5313 GotoEntry The goto field belonging to the 'Goto' element (can be used alone)
5314 Goto Jump to the entered line number (only useful if you also use 'GotoEntry')
5315 Preferences Show the preferences dialog
5317 ================== ==============================================================================
5321 Plugin documentation
5322 ====================
5327 The HTML Characters plugin helps when working with special
5328 characters in XML/HTML, e.g. German Umlauts ü and ä.
5331 Insert entity dialog
5332 ^^^^^^^^^^^^^^^^^^^^
5334 When the plugin is enabled, you can insert special character
5335 entities using *Tools->Insert Special HTML Characters*.
5337 This opens up a dialog where you can find a huge amount of special
5338 characters sorted by category that you might like to use inside your
5339 document. You can expand and collapse the categories by clicking on
5340 the little arrow on the left hand side. Once you have found the
5341 desired character click on it and choose "Insert". This will insert
5342 the entity for the character at the current cursor position. You
5343 might also like to double click the chosen entity instead.
5346 Replace special chars by its entity
5347 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5349 To help make a XML/HTML document valid the plugin supports
5350 replacement of special chars known by the plugin. Both bulk
5351 replacement and immediate replacement during typing are supported.
5353 A few characters will not be replaced. These are
5364 You can activate/deactivate this feature using the *Tools->HTML
5365 Replacement->Auto-replace Special Characters* menu item. If it's
5366 activated, all special characters (beside the given exceptions from
5367 above) known by the plugin will be replaced by their entities.
5369 You could also set a keybinding for the plugin to toggle the status
5376 After inserting a huge amount of text, e.g. by using copy & paste, the
5377 plugin allows bulk replacement of all known characters (beside the
5378 mentioned exceptions). You can find the function under the same
5379 menu at *Tools->HTML Replacement->Replace Characters in Selection*, or
5380 configure a keybinding for the plugin.
5389 This plugin provides an option to automatically save documents.
5390 You can choose to save the current document, or all of your documents, at
5397 You can save the current document when the editor's focus goes out.
5398 Every pop-up, menu dialogs, or anything else that can make the editor lose the focus,
5399 will make the current document to be saved.
5404 This plugin sets on every new file (*File->New* or *File->New (with template)*)
5405 a randomly chosen filename and set its filetype appropriate to the used template
5406 or when no template was used, to a configurable default filetype.
5407 This enables you to quickly compile, build and/or run the new file without the
5408 need to give it an explicit filename using the Save As dialog. This might be
5409 useful when you often create new files just for testing some code or something
5416 This plugin creates a backup copy of the current file in Geany when it is
5417 saved. You can specify the directory where the backup copy is saved and
5418 you can configure the automatically added extension in the configure dialog
5419 in Geany's plugin manager.
5421 After the plugin was loaded in Geany's plugin manager, every file is
5422 copied into the configured backup directory *after* the file has been saved
5425 The created backup copy file permissions are set to read-write only for
5426 the user. This should help to not create world-readable files on possibly
5427 unsecure destination directories like /tmp (especially useful
5428 on multi-user systems).
5429 This applies only to non-Windows systems. On Windows, no explicit file
5430 permissions are set.
5433 Additionally, you can define how many levels of the original file's
5434 directory structure should be replicated in the backup copy path.
5435 For example, setting the option
5436 *Directory levels to include in the backup destination* to *2*
5437 cause the plugin to create the last two components of the original
5438 file's path in the backup copy path and place the new file there.
5441 Contributing to this document
5442 =============================
5444 This document (``geany.txt``) is written in `reStructuredText`__
5445 (or "reST"). The source file for it is located in Geany's ``doc``
5446 subdirectory. If you intend on making changes, you should grab the
5447 source right from Git to make sure you've got the newest version.
5448 First, you need to configure the build system to generate the HTML
5449 documentation passing the *--enable-html-docs* option to the *configure*
5450 script. Then after editing the file, run ``make`` (from the root build
5451 directory or from the *doc* subdirectory) to build the HTML documentation
5452 and see how your changes look. This regenerates the ``geany.html`` file
5453 inside the *doc* subdirectory. To generate a PDF file, configure with
5454 *--enable-pdf-docs* and run ``make`` as for the HTML version. The generated
5455 PDF file is named geany-|(version)|.pdf and is located inside the *doc*
5458 __ https://docutils.sourceforge.net/rst.html
5460 After you are happy with your changes, create a patch e.g. by using::
5462 % git diff geany.txt > foo.patch
5464 or even better, by creating a Git-formatted patch which will keep authoring
5465 and description data, by first committing your changes (doing so in a fresh
5466 new branch is recommended for `master` not to diverge from upstream) and then
5467 using git format-patch::
5469 % git checkout -b my-documentation-changes # create a fresh branch
5470 % git commit geany.txt
5471 Write a good commit message...
5472 % git format-patch HEAD^
5473 % git checkout master # go back to master
5475 and then submit that file to the mailing list for review.
5477 Also you can clone the Geany repository at GitHub and send a pull request.
5479 Note, you will need the Python docutils software package installed
5480 to build the docs. The package is named ``python-docutils`` on Debian
5486 Scintilla keyboard commands
5487 ===========================
5489 Copyright © 1998, 2006 Neil Hodgson <neilh(at)scintilla(dot)org>
5491 This appendix is distributed under the terms of the License for
5492 Scintilla and SciTE. A copy of this license can be found in the file
5493 ``scintilla/License.txt`` included with the source code of this
5494 program and in the appendix of this document. See `License for
5495 Scintilla and SciTE`_.
5504 Keyboard commands for Scintilla mostly follow common Windows and GTK+
5505 conventions. All move keys (arrows, page up/down, home and end)
5506 allows to extend or reduce the stream selection when holding the
5507 Shift key, and the rectangular selection when holding the
5508 appropriate keys (see `Column mode editing (rectangular selections)`_).
5510 Some keys may not be available with some national keyboards
5511 or because they are taken by the system such as by a window manager
5512 or GTK. Keyboard equivalents of menu commands are listed in the
5513 menus. Some less common commands with no menu equivalent are:
5515 ============================================= ======================
5517 ============================================= ======================
5518 Magnify text size. Ctrl-Keypad+
5519 Reduce text size. Ctrl-Keypad-
5520 Restore text size to normal. Ctrl-Keypad/
5522 Dedent block. Shift-Tab
5523 Delete to start of word. Ctrl-BackSpace
5524 Delete to end of word. Ctrl-Delete
5525 Delete to start of line. Ctrl-Shift-BackSpace
5526 Go to start of document. Ctrl-Home
5527 Extend selection to start of document. Ctrl-Shift-Home
5528 Go to start of display line. Alt-Home
5529 Extend selection to start of display line. Alt-Shift-Home
5530 Go to end of document. Ctrl-End
5531 Extend selection to end of document. Ctrl-Shift-End
5532 Extend selection to end of display line. Alt-Shift-End
5533 Previous paragraph. Shift extends selection. Ctrl-Up
5534 Next paragraph. Shift extends selection. Ctrl-Down
5535 Previous word. Shift extends selection. Ctrl-Left
5536 Next word. Shift extends selection. Ctrl-Right
5537 ============================================= ======================
5548 * Double-click on empty space in the notebook tab bar to open a
5550 * Middle-click on a document's notebook tab to close the document.
5551 * Hold `Ctrl` and click on any notebook tab to switch to the last used
5553 * Double-click on a document's notebook tab to toggle all additional
5554 widgets (to show them again use the View menu or the keyboard
5555 shortcut). The interface pref must be enabled for this to work.
5560 * Alt-scroll wheel moves up/down a page.
5561 * Ctrl-scroll wheel zooms in/out.
5562 * Shift-scroll wheel scrolls 8 characters right/left.
5563 * Ctrl-click on a word in a document to perform *Go to Symbol Definition*.
5564 * Ctrl-click on a bracket/brace to perform *Go to Matching Brace*.
5569 * Double-click on a symbol-list group to expand or compact it.
5574 * Scrolling the mouse wheel over a notebook tab bar will switch
5577 The following are derived from X-Windows features (but GTK still supports
5580 * Middle-click pastes the last selected text.
5581 * Middle-click on a scrollbar moves the scrollbar to that
5582 position without having to drag it.
5586 Compile-time options
5587 ====================
5589 There are some options which can only be changed at compile time,
5590 and some options which are used as the default for configurable
5591 options. To change these options, edit the appropriate source file
5592 in the ``src`` subdirectory. Look for a block of lines starting with
5593 ``#define GEANY_*``. Any definitions which are not listed here should
5597 Most users should not need to change these options.
5602 ============================== ============================================ ==================
5603 Option Description Default
5604 ============================== ============================================ ==================
5605 GEANY_STRING_UNTITLED A string used as the default name for new untitled
5606 files. Be aware that the string can be
5607 translated, so change it only if you know
5609 GEANY_WINDOW_MINIMAL_WIDTH The minimal width of the main window. 620
5610 GEANY_WINDOW_MINIMAL_HEIGHT The minimal height of the main window. 440
5611 GEANY_WINDOW_DEFAULT_WIDTH The default width of the main window at the 900
5613 GEANY_WINDOW_DEFAULT_HEIGHT The default height of the main window at the 600
5615 **Windows specific**
5616 GEANY_USE_WIN32_DIALOG Set this to 1 if you want to use the default 0
5617 Windows file open and save dialogs instead
5618 GTK's file open and save dialogs. The
5619 default Windows file dialogs are missing
5620 some nice features like choosing a filetype
5621 or an encoding. *Do not touch this setting
5622 when building on a non-Win32 system.*
5623 ============================== ============================================ ==================
5628 ============================== ============================================ ==================
5629 Option Description Default
5630 ============================== ============================================ ==================
5631 GEANY_PROJECT_EXT The default filename extension for Geany geany
5632 project files. It is used when creating new
5633 projects and as filter mask for the project
5635 ============================== ============================================ ==================
5640 ============================== ============================================ ==================
5641 Option Description Default
5642 ============================== ============================================ ==================
5643 GEANY_FILETYPE_SEARCH_LINES The number of lines to search for the 2
5644 filetype with the extract filetype regex.
5645 ============================== ============================================ ==================
5650 ============================== ============================================ ==================
5651 Option Description Default
5652 ============================== ============================================ ==================
5653 GEANY_WORDCHARS These characters define word boundaries when a string with:
5654 making selections and searching using word a-z, A-Z, 0-9 and
5655 matching options. underscore.
5656 ============================== ============================================ ==================
5661 These are default settings that can be overridden in the `Preferences`_ dialog.
5663 ============================== ============================================ ==================
5664 Option Description Default
5665 ============================== ============================================ ==================
5666 GEANY_MIN_SYMBOLLIST_CHARS How many characters you need to type to 4
5667 trigger the autocompletion list.
5668 GEANY_DISK_CHECK_TIMEOUT Time in seconds between checking a file for 30
5670 GEANY_DEFAULT_TOOLS_MAKE The make tool. This can also include a path. "make"
5671 GEANY_DEFAULT_TOOLS_TERMINAL A terminal emulator command, see See below.
5672 `Terminal emulators`_.
5673 GEANY_DEFAULT_TOOLS_BROWSER A web browser. This can also include a path. "firefox"
5674 GEANY_DEFAULT_TOOLS_PRINTCMD A printing tool. It should be able to accept "lpr"
5675 and process plain text files. This can also
5677 GEANY_DEFAULT_TOOLS_GREP A grep tool. It should be compatible with "grep"
5678 GNU grep. This can also include a path.
5679 GEANY_DEFAULT_MRU_LENGTH The length of the "Recent files" list. 10
5680 GEANY_DEFAULT_FONT_SYMBOL_LIST The font used in sidebar to show symbols and "Sans 9"
5682 GEANY_DEFAULT_FONT_MSG_WINDOW The font used in the messages window. "Sans 9"
5683 GEANY_DEFAULT_FONT_EDITOR The font used in the editor window. "Monospace 10"
5684 GEANY_TOGGLE_MARK A string which is used to mark a toggled "~ "
5686 GEANY_MAX_AUTOCOMPLETE_WORDS How many autocompletion suggestions should 30
5688 GEANY_DEFAULT_FILETYPE_REGEX The default regex to extract filetypes from See below.
5690 ============================== ============================================ ==================
5694 The GEANY_DEFAULT_FILETYPE_REGEX default value is -\\*-\\s*([^\\s]+)\\s*-\\*- which finds Emacs filetypes.
5696 The GEANY_DEFAULT_TOOLS_TERMINAL default value on Windows is::
5700 and on any non-Windows system is::
5702 xterm -e "/bin/sh %c"
5708 ============================== ============================================ ==================
5709 Option Description Default
5710 ============================== ============================================ ==================
5711 GEANY_BUILD_ERR_HIGHLIGHT_MAX Amount of build error indicators to 50
5712 be shown in the editor window.
5713 This affects the special coloring
5714 when Geany detects a compiler output line as
5715 an error message and then highlights the
5716 corresponding line in the source code.
5717 Usually only the first few messages are
5718 interesting because following errors are
5720 All errors in the Compiler window are parsed
5721 and unaffected by this value.
5722 PRINTBUILDCMDS Every time a build menu item priority FALSE
5723 calculation is run, print the state of the
5724 menu item table in the form of the table
5725 in `Build Menu Configuration`_. May be
5726 useful to debug configuration file
5727 overloading. Warning produces a lot of
5728 output. Can also be enabled/disabled by the
5729 debugger by setting printbuildcmds to 1/0
5730 overriding the compile setting.
5731 ============================== ============================================ ==================
5735 GNU General Public License
5736 ==========================
5740 GNU GENERAL PUBLIC LICENSE
5741 Version 2, June 1991
5743 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5744 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
5745 Everyone is permitted to copy and distribute verbatim copies
5746 of this license document, but changing it is not allowed.
5750 The licenses for most software are designed to take away your
5751 freedom to share and change it. By contrast, the GNU General Public
5752 License is intended to guarantee your freedom to share and change free
5753 software--to make sure the software is free for all its users. This
5754 General Public License applies to most of the Free Software
5755 Foundation's software and to any other program whose authors commit to
5756 using it. (Some other Free Software Foundation software is covered by
5757 the GNU Library General Public License instead.) You can apply it to
5760 When we speak of free software, we are referring to freedom, not
5761 price. Our General Public Licenses are designed to make sure that you
5762 have the freedom to distribute copies of free software (and charge for
5763 this service if you wish), that you receive source code or can get it
5764 if you want it, that you can change the software or use pieces of it
5765 in new free programs; and that you know you can do these things.
5767 To protect your rights, we need to make restrictions that forbid
5768 anyone to deny you these rights or to ask you to surrender the rights.
5769 These restrictions translate to certain responsibilities for you if you
5770 distribute copies of the software, or if you modify it.
5772 For example, if you distribute copies of such a program, whether
5773 gratis or for a fee, you must give the recipients all the rights that
5774 you have. You must make sure that they, too, receive or can get the
5775 source code. And you must show them these terms so they know their
5778 We protect your rights with two steps: (1) copyright the software, and
5779 (2) offer you this license which gives you legal permission to copy,
5780 distribute and/or modify the software.
5782 Also, for each author's protection and ours, we want to make certain
5783 that everyone understands that there is no warranty for this free
5784 software. If the software is modified by someone else and passed on, we
5785 want its recipients to know that what they have is not the original, so
5786 that any problems introduced by others will not reflect on the original
5787 authors' reputations.
5789 Finally, any free program is threatened constantly by software
5790 patents. We wish to avoid the danger that redistributors of a free
5791 program will individually obtain patent licenses, in effect making the
5792 program proprietary. To prevent this, we have made it clear that any
5793 patent must be licensed for everyone's free use or not licensed at all.
5795 The precise terms and conditions for copying, distribution and
5796 modification follow.
5798 GNU GENERAL PUBLIC LICENSE
5799 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
5801 0. This License applies to any program or other work which contains
5802 a notice placed by the copyright holder saying it may be distributed
5803 under the terms of this General Public License. The "Program", below,
5804 refers to any such program or work, and a "work based on the Program"
5805 means either the Program or any derivative work under copyright law:
5806 that is to say, a work containing the Program or a portion of it,
5807 either verbatim or with modifications and/or translated into another
5808 language. (Hereinafter, translation is included without limitation in
5809 the term "modification".) Each licensee is addressed as "you".
5811 Activities other than copying, distribution and modification are not
5812 covered by this License; they are outside its scope. The act of
5813 running the Program is not restricted, and the output from the Program
5814 is covered only if its contents constitute a work based on the
5815 Program (independent of having been made by running the Program).
5816 Whether that is true depends on what the Program does.
5818 1. You may copy and distribute verbatim copies of the Program's
5819 source code as you receive it, in any medium, provided that you
5820 conspicuously and appropriately publish on each copy an appropriate
5821 copyright notice and disclaimer of warranty; keep intact all the
5822 notices that refer to this License and to the absence of any warranty;
5823 and give any other recipients of the Program a copy of this License
5824 along with the Program.
5826 You may charge a fee for the physical act of transferring a copy, and
5827 you may at your option offer warranty protection in exchange for a fee.
5829 2. You may modify your copy or copies of the Program or any portion
5830 of it, thus forming a work based on the Program, and copy and
5831 distribute such modifications or work under the terms of Section 1
5832 above, provided that you also meet all of these conditions:
5834 a) You must cause the modified files to carry prominent notices
5835 stating that you changed the files and the date of any change.
5837 b) You must cause any work that you distribute or publish, that in
5838 whole or in part contains or is derived from the Program or any
5839 part thereof, to be licensed as a whole at no charge to all third
5840 parties under the terms of this License.
5842 c) If the modified program normally reads commands interactively
5843 when run, you must cause it, when started running for such
5844 interactive use in the most ordinary way, to print or display an
5845 announcement including an appropriate copyright notice and a
5846 notice that there is no warranty (or else, saying that you provide
5847 a warranty) and that users may redistribute the program under
5848 these conditions, and telling the user how to view a copy of this
5849 License. (Exception: if the Program itself is interactive but
5850 does not normally print such an announcement, your work based on
5851 the Program is not required to print an announcement.)
5853 These requirements apply to the modified work as a whole. If
5854 identifiable sections of that work are not derived from the Program,
5855 and can be reasonably considered independent and separate works in
5856 themselves, then this License, and its terms, do not apply to those
5857 sections when you distribute them as separate works. But when you
5858 distribute the same sections as part of a whole which is a work based
5859 on the Program, the distribution of the whole must be on the terms of
5860 this License, whose permissions for other licensees extend to the
5861 entire whole, and thus to each and every part regardless of who wrote it.
5863 Thus, it is not the intent of this section to claim rights or contest
5864 your rights to work written entirely by you; rather, the intent is to
5865 exercise the right to control the distribution of derivative or
5866 collective works based on the Program.
5868 In addition, mere aggregation of another work not based on the Program
5869 with the Program (or with a work based on the Program) on a volume of
5870 a storage or distribution medium does not bring the other work under
5871 the scope of this License.
5873 3. You may copy and distribute the Program (or a work based on it,
5874 under Section 2) in object code or executable form under the terms of
5875 Sections 1 and 2 above provided that you also do one of the following:
5877 a) Accompany it with the complete corresponding machine-readable
5878 source code, which must be distributed under the terms of Sections
5879 1 and 2 above on a medium customarily used for software interchange; or,
5881 b) Accompany it with a written offer, valid for at least three
5882 years, to give any third party, for a charge no more than your
5883 cost of physically performing source distribution, a complete
5884 machine-readable copy of the corresponding source code, to be
5885 distributed under the terms of Sections 1 and 2 above on a medium
5886 customarily used for software interchange; or,
5888 c) Accompany it with the information you received as to the offer
5889 to distribute corresponding source code. (This alternative is
5890 allowed only for noncommercial distribution and only if you
5891 received the program in object code or executable form with such
5892 an offer, in accord with Subsection b above.)
5894 The source code for a work means the preferred form of the work for
5895 making modifications to it. For an executable work, complete source
5896 code means all the source code for all modules it contains, plus any
5897 associated interface definition files, plus the scripts used to
5898 control compilation and installation of the executable. However, as a
5899 special exception, the source code distributed need not include
5900 anything that is normally distributed (in either source or binary
5901 form) with the major components (compiler, kernel, and so on) of the
5902 operating system on which the executable runs, unless that component
5903 itself accompanies the executable.
5905 If distribution of executable or object code is made by offering
5906 access to copy from a designated place, then offering equivalent
5907 access to copy the source code from the same place counts as
5908 distribution of the source code, even though third parties are not
5909 compelled to copy the source along with the object code.
5911 4. You may not copy, modify, sublicense, or distribute the Program
5912 except as expressly provided under this License. Any attempt
5913 otherwise to copy, modify, sublicense or distribute the Program is
5914 void, and will automatically terminate your rights under this License.
5915 However, parties who have received copies, or rights, from you under
5916 this License will not have their licenses terminated so long as such
5917 parties remain in full compliance.
5919 5. You are not required to accept this License, since you have not
5920 signed it. However, nothing else grants you permission to modify or
5921 distribute the Program or its derivative works. These actions are
5922 prohibited by law if you do not accept this License. Therefore, by
5923 modifying or distributing the Program (or any work based on the
5924 Program), you indicate your acceptance of this License to do so, and
5925 all its terms and conditions for copying, distributing or modifying
5926 the Program or works based on it.
5928 6. Each time you redistribute the Program (or any work based on the
5929 Program), the recipient automatically receives a license from the
5930 original licensor to copy, distribute or modify the Program subject to
5931 these terms and conditions. You may not impose any further
5932 restrictions on the recipients' exercise of the rights granted herein.
5933 You are not responsible for enforcing compliance by third parties to
5936 7. If, as a consequence of a court judgment or allegation of patent
5937 infringement or for any other reason (not limited to patent issues),
5938 conditions are imposed on you (whether by court order, agreement or
5939 otherwise) that contradict the conditions of this License, they do not
5940 excuse you from the conditions of this License. If you cannot
5941 distribute so as to satisfy simultaneously your obligations under this
5942 License and any other pertinent obligations, then as a consequence you
5943 may not distribute the Program at all. For example, if a patent
5944 license would not permit royalty-free redistribution of the Program by
5945 all those who receive copies directly or indirectly through you, then
5946 the only way you could satisfy both it and this License would be to
5947 refrain entirely from distribution of the Program.
5949 If any portion of this section is held invalid or unenforceable under
5950 any particular circumstance, the balance of the section is intended to
5951 apply and the section as a whole is intended to apply in other
5954 It is not the purpose of this section to induce you to infringe any
5955 patents or other property right claims or to contest validity of any
5956 such claims; this section has the sole purpose of protecting the
5957 integrity of the free software distribution system, which is
5958 implemented by public license practices. Many people have made
5959 generous contributions to the wide range of software distributed
5960 through that system in reliance on consistent application of that
5961 system; it is up to the author/donor to decide if he or she is willing
5962 to distribute software through any other system and a licensee cannot
5965 This section is intended to make thoroughly clear what is believed to
5966 be a consequence of the rest of this License.
5968 8. If the distribution and/or use of the Program is restricted in
5969 certain countries either by patents or by copyrighted interfaces, the
5970 original copyright holder who places the Program under this License
5971 may add an explicit geographical distribution limitation excluding
5972 those countries, so that distribution is permitted only in or among
5973 countries not thus excluded. In such case, this License incorporates
5974 the limitation as if written in the body of this License.
5976 9. The Free Software Foundation may publish revised and/or new versions
5977 of the General Public License from time to time. Such new versions will
5978 be similar in spirit to the present version, but may differ in detail to
5979 address new problems or concerns.
5981 Each version is given a distinguishing version number. If the Program
5982 specifies a version number of this License which applies to it and "any
5983 later version", you have the option of following the terms and conditions
5984 either of that version or of any later version published by the Free
5985 Software Foundation. If the Program does not specify a version number of
5986 this License, you may choose any version ever published by the Free Software
5989 10. If you wish to incorporate parts of the Program into other free
5990 programs whose distribution conditions are different, write to the author
5991 to ask for permission. For software which is copyrighted by the Free
5992 Software Foundation, write to the Free Software Foundation; we sometimes
5993 make exceptions for this. Our decision will be guided by the two goals
5994 of preserving the free status of all derivatives of our free software and
5995 of promoting the sharing and reuse of software generally.
5999 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
6000 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
6001 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
6002 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
6003 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6004 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
6005 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
6006 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
6007 REPAIR OR CORRECTION.
6009 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
6010 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
6011 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
6012 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
6013 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
6014 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
6015 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
6016 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
6017 POSSIBILITY OF SUCH DAMAGES.
6019 END OF TERMS AND CONDITIONS
6021 How to Apply These Terms to Your New Programs
6023 If you develop a new program, and you want it to be of the greatest
6024 possible use to the public, the best way to achieve this is to make it
6025 free software which everyone can redistribute and change under these terms.
6027 To do so, attach the following notices to the program. It is safest
6028 to attach them to the start of each source file to most effectively
6029 convey the exclusion of warranty; and each file should have at least
6030 the "copyright" line and a pointer to where the full notice is found.
6032 <one line to give the program's name and a brief idea of what it does.>
6033 Copyright (C) <year> <name of author>
6035 This program is free software; you can redistribute it and/or modify
6036 it under the terms of the GNU General Public License as published by
6037 the Free Software Foundation; either version 2 of the License, or
6038 (at your option) any later version.
6040 This program is distributed in the hope that it will be useful,
6041 but WITHOUT ANY WARRANTY; without even the implied warranty of
6042 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6043 GNU General Public License for more details.
6045 You should have received a copy of the GNU General Public License along
6046 with this program; if not, write to the Free Software Foundation, Inc.,
6047 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
6050 Also add information on how to contact you by electronic and paper mail.
6052 If the program is interactive, make it output a short notice like this
6053 when it starts in an interactive mode:
6055 Gnomovision version 69, Copyright (C) year name of author
6056 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
6057 This is free software, and you are welcome to redistribute it
6058 under certain conditions; type `show c' for details.
6060 The hypothetical commands `show w' and `show c' should show the appropriate
6061 parts of the General Public License. Of course, the commands you use may
6062 be called something other than `show w' and `show c'; they could even be
6063 mouse-clicks or menu items--whatever suits your program.
6065 You should also get your employer (if you work as a programmer) or your
6066 school, if any, to sign a "copyright disclaimer" for the program, if
6067 necessary. Here is a sample; alter the names:
6069 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
6070 `Gnomovision' (which makes passes at compilers) written by James Hacker.
6072 <signature of Ty Coon>, 1 April 1989
6073 Ty Coon, President of Vice
6075 This General Public License does not permit incorporating your program into
6076 proprietary programs. If your program is a subroutine library, you may
6077 consider it more useful to permit linking proprietary applications with the
6078 library. If this is what you want to do, use the GNU Library General
6079 Public License instead of this License.
6084 License for Scintilla and SciTE
6085 ===============================
6087 Copyright 1998-2003 by Neil Hodgson <neilh(at)scintilla(dot)org>
6091 Permission to use, copy, modify, and distribute this software and
6092 its documentation for any purpose and without fee is hereby granted,
6093 provided that the above copyright notice appear in all copies and
6094 that both that copyright notice and this permission notice appear in
6095 supporting documentation.
6097 NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
6098 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
6099 NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
6100 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
6101 OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
6102 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
6103 USE OR PERFORMANCE OF THIS SOFTWARE.