%medit-defines; ]> Preferences Preferences dialog Preferences provides access to almost all &medit; settings. Some settings are not available here, see . Preferences dialog has several tabs: General Contains settings which didn't find place in other sections, see . View Contains settings which control how &medit; displays text. File Contains settings which control how &medit; saves and loads files, see . Languages See . File Filters See . Plugins Displays information about available plugings and allows to disable/enable them. File Selector Contains File Selector settings, see . Tools User-defined tools, see . <guilabel>General</guilabel> tab Smart Home and End If checked, Home key moves cursor to first non-whitespace character on the line on first Home key press, and moves cursor to the first character on the line on second key press. Analogously End key moves cursor past last non-whitespace character on the line, and then past last character on next key press. Enable auto indentation If checked, pressing Enter key inserts line end character and whitespace to indent next line according to indentation settings. Do not use tabs for indentation If checked, spaces are used for indentation instead of tab character. Tab key indents If checked, Tab key inserts whitespace characters according to indentation settings to indent text at cursor. Otherwise Tab key only inserts single tab character. Tab width Displayed width of tab character in spaces. By default it is 8. Indent width Number of spaces inserted by single Tab key press. If tabs are used for indentation then Tab key inserts spaces until line indent is multiple of tab width, then it replaces spaces with tabs (if indent width is a multiple of tab width then only tab characters are used.) <guilabel>File</guilabel> tab Encodings to autodetect This entry contains comma-separated list of encodings used when loading files if encoding is not specified in the Open. &medit; tries every encoding from the list one by one and stops when file content is valid text in this encoding. LOCALE denotes encoding from current locale. Encoding for new files This is default encoding to save new files. For every document its encoding on disk can be changed using Encoding submenu of Document menu. Remove trailing spaces If checked, trailing whitespace characters are removed from each line of the document on save. Ensure trailing newline If checked, new line character will be added to document on save if it doesn't end with one. Make backups If checked, old file contents will be moved to backup file on save. Enable session support If checked, &medit; will remember open documents on exit and restore them next time it's launched. Open and Save As dialogs show current document folder If checked, Open and Save As dialogs will show folder of the current document. Otherwise they will show last used folder. <guilabel>Languages</guilabel> tab Languages and files tab allows customizing how syntax highlighting language and editing options are chosen depending on the document filename, as well as setting editing options for all documents which use given language and choosing file patterns and mime types for which the given language should be used. Here you can set editing options on per-language basis, as well as define for which file patterns and mime types given language should be used. Language combo box Choose the language you want to customize. Settings for None will apply to documents for which no syntax highlighting language was chosen. Mime types Selected language will be used for files with these mime types, unless the language is chosen based on the filename or overridden in the File filters tab section. Extensions Selected language will be used for files whose filenames match these patterns, unless overridden in the File filters tab section. Options Default editing options to use in documents which use the given language. These options can be overridden using File filters tab section, and options set in the file text have a higher priority as well. See for format of this entry content. File filters tab File filters tab section allows to customize editing options, as well as syntax highlighting language, on per-document basis using regular expressions which are matched against the document filename (globs can also be used, see below). Full file paths are used, so one can have per-directory settings. The filters are applied in the order they appear in the list, one by one. All filters are applied to every file, so several filters may affect options in the same file. In this way one can set some options for a set of files or a directory, then set or modify some additional options for certain files in that set, etc. To add a filter, use New button. Click the filter in the list to select it, then click the Filter or Options part of it to edit. Use Delete button to delete a filter, and Up and Down buttons to change the order in which they are applied. Filter field contains a regular expression matched agains the document filename. If it is found in the filename, then the options from the Options field are applied to the document. Example: projects/moo/ Use dollar if you need to match ends of filenames, e.g. "\.doc$" will work as "*.doc" pattern. Alternatively it can be a comma-separated list of globs prefixed with "globs:" or a list of language ids prefixed with "langs:", e.g. globs:*.c,*.h or langs:c,c++ Options field contains the options, in format described in . <guilabel>File Selector</guilabel> tab File Selector tab in the Preferences dialog allows to define custom commands which are available in Open With submenu of context menu in File Selector. By default this submenu contains single item Default Application which opens selected file with default application as configured in the system. Here you can add additional commands and set whether they should be available only for given file patterns or syntax highlighting languages. Use New button to create new command, Delete button to delete selected command, and Up and Down to change relative order of the commands, they will appear in the menu in the same order as in this list. The following entries set the command properties: Name Menu item label for this command. Command Shell command to execute when the menu item is activated. %f will be replaced with full path of the selected file; if more than one file is selected then the command will be executed for each file one by one. If command contains %F and several files are selected then %F will be replaced with the space-separated list of paths of all selected files. If a single file is selected then %f and %F behave in the same way. Example: firefox %f, glade %F Extensions Semicolon-separated list of file patterns to define for which files this command is available, e.g. *.c;*.h. Use * if the command should be available for all files. Mime types Semicolon-separated list of mime types to define for which files this command is available, e.g. application/docbook+xml;application/x-glade. Leave it empty if Extensions entry defines whether the command should be enabled. Options for editing text &medit; has some editing options which can be set in the document text, or in the Preferences dialog for sets of files or for given syntax highlighting language. To set the options in the document text, place the following on the first, second or the last line of the document: -%- options -%- where options is the option string key: value; key: value; ... (the latter is the format used also in the Preferences dialog). For example, the following might be the first line in a C file: /* -%- indent-width: 2; use-tabs: yes; strip: yes -%- */ Values can be strings, integers, or booleans. Booleans are yes, no, true, false, 1, 0. If a string value contains : character, then the following syntax may be used: key=/value/. Any character may be used instead of slash (and it must not occur in the value). Example: word-chars=@-/:@ The following options are available: lang syntax highlighting language to use in this document. Special value none will turn off syntax highlighting in this document. strip a boolean value, whether trailing whitespace should be removed from the document on save. add-newline a boolean value, whether the editor should ensure that saved files have a trailing new line character. indent-width an integer specifying indentation offset used when the Tab key is pressed to indent text. tab-width displayed width of the tab character. Note that this is not the same as indent-width. use-tabs whether tab character should be used for indentation. &medit; tries to understand modelines of Vim, Emacs, and Kate text editors, so chances are it will correctly pick up the conventional settings from source files. Preferences files &medit; preferences are stored in &medit-prefs-xml-unix; file. It is an XML file which may be edited to set preferences which have not found their place in the Preferences dialog. &medit; reads the preferences file on startup and writes it whenever OK or Apply button is clicked in the Preferences dialog. Therefore, if you modify the preferences file, your changes may be overwritten, and they not take effect until you restart &medit;. The following "hidden" settings are available: Editor/window_title Format of the window title. It is a string which may contain format sequences, which are percent sign followed by a character: %a application name %b current document basename %f full path of the current document %u URI of the current document %s the status of the current document, e.g. " [modified]". It is prefixed with a space, so that "%b%s" produces a nice string %% the percent character Default value is "%a - %f%s" which produces something like "medit - /home/user/file [modified]". Editor/window_title_no_doc same as Editor/window_title, used when no document is open. Default value is "%a".