.\" SPDX-License-Identifier: BSL-1.0 .\" Manpage for chr .\" Make pull requests at: https://github.com/istoph/editor or create an issue for error corrections. .TH man 1 "20 Mar 2024" "0.1.78" "chr man page" .SH NAME chr \- chr is a terminal based editor .SH SYNOPSIS Usage: chr [options] [[+line[,char]] file …] [[+/searchword] file …] [/directory] Options: -h, --help Displays help on commandline options. --help-all Displays help including Qt specific options. -v, --version Displays version information. -l, --line-number The line numbers are displayed -b, --big-file Open bigger file then 100MB -w, --wrap-lines Wrap log lines (NoWrap Default) --attributesfile Safe file for attributes, default ~/.cache/chr/chr.json -c, --config Load customized config file. The default if it exist is ~/.config/chr --syntax-highlighting-theme Name of syntax-highlighting-theme, you can list installed themes with: kate-syntax-highlighter --list-themes --disable-syntax disable syntax highlighting Arguments: [[+line[,char]] file …] Optional is the line number and position. Several files can be opened in multiple windows. [[+/searchword] file …] A search word can be set. [/directory] Or a directory can be specified to search in the open dialog. .SH DESCRIPTION Chr is a terminal based text editor. Keyboard shortcuts are similar to the default editors in Gnome, KDE and other desktop environments. This is to ease workflows alternating between GUIs and terminal. The look and feel is a blend of modern GUI editors and late 90s PC text mode editors (e.g. Turbo Vision based or edit.com) adapted to fit into terminal based workflows. .SH Quick Start The important operations can be invoked from the menu. The menu can be opened with \fBF10\fP or with Alt together with the highlighted letter of the menu item (e.g. \fBAlt + f\fP). In dialogs \fBTab\fP is used to navigate between the elements. Use \fBF6\fP to navigate between windows/dialogs. Text can be marked in most terminals with Shift + arrow key. \fBCtrl + c\fP is used for copying. Paste with \fBCtrl + v\fP. Changes can be saved with \fBCtrl + s\fP and the editor can be exited with \fBCtrl + q\fP. .SH SHORT CUTS Shift + Cursor Selects text Ctrl + a Selects all text in the document Ctrl + c / Ctrl + Insert Copies the selected text into the clipboard Ctrl + d Deletes the current line Ctrl + e, up/down/left/right Switches the active window. Use the arrow keys to specify the direction for the next active window. Ctrl + e, Ctrl + up/down/left/right Change window size Ctrl + f Open the search dialog Ctrl + Backspace Delete a word (left from cursor position) Ctrl + r Open the replace dialog Ctrl + n Creates a window with an empty document Ctrl + q Quits the editor Ctrl + s Save (or save as for new documents) Ctrl + v / Shift + Insert Inserts the contents of the clipboard at the current cursor position. Ctrl + x / Shift + Delete Cuts out the selected text and moves it to the clipboard Ctrl + y Redos an action that has been undone Ctrl + z Undoes an action Ctrl + Shift + up Moves the current selection or line upwards Ctrl + Shift + down Moves the current selection or line down Ctrl + Left Jump a word to the left Ctrl + Shift + Left Selects a word to the left Ctrl + Right Jump a word to the right Ctrl + Shift Right Selects a word to the right Alt + - Open the window menu Alt + Shift + up/down/left/right Marks the text in blocks. Inserting the clipboard duplicates the text per line. If an equal number of lines is marked as to be inserted, the lines from the clipboard will be distributed across the selected lines. Alt + Shift + S Sort the selected lines (lexicographical by code-point) Alt + x Opens a command line. Type "help" for help. Tab / Shift + Tab Indents a selected block by a tab stop or remove one level of indention F3 / Shift + F3 Find the next or previously search element F4 Toggles the selection mode to allow selecting text in terminals where marking with Shift + arrow keys does not work F6 / Shift + F6 Change active window, with Shift in reverse order ESC Closes an active dialog menu or action. .SH MENU .SH File .SS New Opens a new an empty unnamed document. .SS Open Opens a file dialog to select a file to be opened. .SS Save Saves the current status of the file. If the save path is not yet specified, the "Save as ..." dialog is opened. .SS Save as... A storage location to save the file to can be selected here via a file dialog. .SS Reload Reloads the current file. All changes are discarded. .SS Close Closes the active window. .SS Quit Closes the editor. If there is a file open that has not yet been saved, the Save dialog will be opened first. .SH Edit .SS Cut, Copy, Paste, Select all Text can be selected using the arrow keys while holding down the Shift key. The entire text can be selected with \fBSelect all\fP. This selected text can then be copied using \fBCopy\fP or cut using \fBCut\fP. With \fBPaste\fP, this text can be inserted again at the current cursor position. If there is text in the clipboard before copying (or cutting), it will be replaced. These functions use an internal clipboard that contains different content than the clipboard used in the terminal as copy and paste commands, as the editor cannot access the system clipboard. .SS Delete Line Deletes the entire line. .SS Select Mode Toggles the selection mode to allow selecting text in terminals where marking with Shift + arrow keys does not work. .SS Undo, Redo With \fBUndo\fP or CTRL + z, edits can be undone. With \fBRedo\fP or CTRL + y the undo can be undone again. .SS Search Use Search or Ctrl + f to open the search dialog. Enter a search term in the "Find" field. You can refine the search using the options. If live search is activated, the first matching result is automatically selected while the search term is being entered. If the text document is active, you can press F3 to jump to the next result or Shift + F3 to jump to the previous result. .SS Search Next Jump to the next match for the current search term. .SS Search Previous Jump to the previous match for the current search term. .SS Replace With Replace or CTRL + r the Replace dialog is opened. Enter a search term in the "Find" field. In the field "Replace" the word to be inserted is specified. "Next" jumps to the next match for the current search term. With "Replace" the current match is replaced. With "All" all occurrences of the search term are replaced at once. .SS Insert Character... Opens a dialog in which a character code (Unicode codepoint) of a special character to be inserted can be entered. .SS Goto To jump to a line, open a Goto Line dialog under "Goto". .SS Sort Selected Lines Sort the selected lines (lexicographical by code-point). .SH Options .SS Tab settings Opens the Tab settings dialog. Here the settings for a tab can be made. You can choose between tab (\\t) and space. You can also set the width of the indention. The default settings can also be set in the ~/.config/chr file. Here you can specify: "tabsize=8" or "tab=false" for spaces. .SS Line Number Shows the line number on the left side of the editor. The default settings can also be made in the ~/.config/chr file. Here you can specify: "line_number=true". .SS Formatting In the Formatting dialog, "Formatting Characters", "Color Tabs" and "Color Spacs at end of line" can be switched on and off. The "Formatting characters" marks spaces with a dot: "·" end of line (\\n) with a "¶" and the end of the file with: "♦". With "Color Tabs" tabs are colorized. The tab border is made darker. "Color Spaces at end of line" is used to spaces mark at the end of the line in red. In the configuration file: ~/.config/chr the behavior can be influenced with the option "formatting_characters=true", "color_tabs=true", "color_space_end=true". .SS Wrap long lines Selects if lines that are wider than the window are displayed clipped or wrapped.. It can be wrapped at the word boundary or hard at the end of the line. This behavior can be influenced by the option "wrap_lines=WordWrap" or "wrap_lines=WrapAnywhere" in the ~/.config/chr file. In addition, the option "Display Right Margin at Column" can be used to specify a numerical value above which the background color is darkened. This value can also be set with the configuration option: "right_margin_hint=80" in ~/.config/chr. .SS Stop Input Pipe Reading from a pipe is interrupted. The standard input file descriptor is closed. .SS Highlight Brackets If active and the cursor is on a bracket the bracket at the cursor position and the matching other bracket are highlighted. The following opening and closing brackets can be highlighted when the cursor moves over them. With the option "highlight_bracket=true" this behavior can be influenced in the ~/.config/chr. Supported bracket types are: \fB[{(<>)}]\fP. .SS Syntax Highlighting If the editor has been compiled with the "SyntaxHighlighting" feature, syntax highlighting is generally available. The language is automatically detected when a file is opened and displayed in the status bar. If required, it can also be switched on and off or adjusted via the syntax highlighting dialog. Syntax highlighting can also be deactivated in this dialog. The theme can be customized via the command line switch "--syntax-highlighting-theme". The editor comes with the themes "chr-bluebg" and "chr-blackbg". If required, a theme from the list that can be displayed with "kate-syntax-highlighter --list-themes" can be used. With the option "syntax_highlighting_theme=chr-bluebg" the theme can be set in ~/.config/chr. Syntax highlighting can be switched off via the command line using "--disable-syntax" when the editor is started. With the option "disable_syntax=true" the theme can be set in ~/.config/chr. .SS Theme It opens the dialog for selecting a theme. The Classic (blue) or the Dark (black and white) mode is available. With the option "theme=classic" or "theme=dark", this can be set in the ~/.config/chr. .SH Window .SS Next, Previous Switches the active window, with Shift in reverse order. (See F6) .SS Tile Vertically, Horizontally, Fullscreen Selects how multiple open documents are shown. Vertical and horizontal distribute the available space across the documents. When Fullscreen is selected only one document is shown at once. (See F6) .SH CUSTOM CONFIG The editor loads a configuration file from \fB~/.config/chr\fP (if available). (If the environment variable \fB$XDG_CONFIG_HOME\fP is set, then from \fB$XDG_CONFIG_HOME/chr\fP) In addition to the options documented above, the following options are available: .SS eat_space_before_tabs This option is only active if \fBtab=false\fP is set. If this option is active and the Tab key is pressed while the cursor is in the indentation at the beginning of a line, the indentation is extended to the next tab position. .SS attributes_file Specifies the path of the file in which the cursor and scroll position of files opened in the past is saved. .SH Default config There is a default config (~/.config/chr) where the following options can be set. .EX attributes_file="/home/user/.cache/chr/chr.json" color_space_end=false color_tabs=false disable_syntax=false eat_space_before_tabs=true formatting_characters=false highlight_bracket=true line_number=false logfile="" right_margin_hint=0 syntax_highlighting_theme="chr-bluebg" tab=false tab_size=4 theme="classic" wrap_lines="NoWrap" .EE .SH FILES ~/.config/chr Your personal chr initializations. ~/.cache/chr/chr.json History about the changed files. This is where cursor positions are stored. .SH BUGS Errors in this software can be reported via the bugtracker on https://github.com/istoph/editor. .SH AUTHOR Christoph Hüffelmann Martin Hostettler