.\" -*-Nroff-*- .\" .TH "o" 1 "18 Jun 2026" "o" "User Commands" .SH NAME o \- an editor .SH SYNOPSIS .B o filename [LINE NUMBER] .sp .SH DESCRIPTION Edit an existing file or create a new one. .sp .SH OPTIONS .sp The line number can be prefixed with \fB+\fP, or be a suffix of the filename if prefixed with \fB:\fP. .sp .TP .B \-c FILENAME or \-\-copy FILENAME Copy the given file into the clipboard. .TP .B \-f or \-\-force Ignore file locks when opening files. .TP .B \-l or \-\-last-command Output the last used build/format/export command. .TP .B \-m FILENAME or \-\-monitor FILENAME Monitor the given file for changes, and open it as read-only. .TP .B \-n or \-\-no-cache Avoid writing the location history, search history, game highscore and last build/format/export command to the cache directory. .TP .B \-p FILENAME or \-\-paste FILENAME Paste the contents of the clipboard into the given file. Combine with \-f to overwrite the file. .TP .B \-e or \-\-clear-locks Clear all file locks and close all portals. .TP .B \-o or \-\-ollama Enable Ollama-specific features. The model can be specified in the \fBOLLAMA_MODEL\fP environment variable. This requires that Ollama is up and running, either locally or at the host specified in the \fBOLLAMA_HOST\fP environment variable. .TP .B \-r or \-\-release Build release executables when ctrl-b is pressed, or projects when no filenames are given. .TP .B \-t or \-\-list List the file in a colorful way without opening it for editing. .TP .B \-b or \-\-build Build the given file instead of opening it for editing. .TP .B \-F or \-\-fmt Format the given file in place and quit. Runs headless: no TTY, no UI. .TP .B \-k or \-\-create-dir When opening a new file, create directories as needed. .TP .B \-d or \-\-debug Start in debug mode. .TP .B \-s or \-\-digraphs List all possible digraphs. .TP .B \-i FILENAME or \-\-input-file FILENAME Used as stdin when running programs with ctrl-b. The default filename is input.txt. .TP .B \-a or \-\-nano Emulate Pico/Nano. .TP .B \-q or \-\-quick-help Always display the quick help pane at start. .TP .B \-z or \-\-no-quick-help Never display the quick help pane at start. .TP .B \-x or \-\-noapprox Disable approximate filename matching. .TP .B \-g GLOB or \-\-glob GLOB Search for and open the first filename that matches the given substring. .TP .B \-v or \-\-version Display the current version. .TP .B \-h or \-\-help Display brief usage information. .PP .SH KEYBINDINGS .sp .B ctrl-q Quit o. .sp .B ctrl-s Save the file. .sp .B ctrl-w Format the current file with \fBgoimports\fP or \fBclang-format\fP, depending on the file extension. Zig, V, Rust (\fBrustfmt\fP), Haskell (\fBormolu\fP) and Python (\fBruff format\fP) are also supported. If in git mode, cycle the git interactive rebase keyword on the current line. If in Markdown mode, format the table under the cursor. Double press to toggle block editing mode. .sp .B ctrl-a Go to start of the text, then the start of the line and then the previous line. .sp .B ctrl-e Go to end of the line and then the next line. .sp .sp .B ctrl-n Scroll down 10 lines or go to the next match if a search is active. Insert a new column when in the Markdown table editor. Jump to a matching parenthesis or bracket if the arrow keys were just used. .B ctrl-p Scroll up 10 lines or go to the previous match if a search is active. Remove an empty column when in the Markdown table editor. Jump to a matching parenthesis or bracket if the arrow keys were just used. .sp .B ctrl-k Delete all characters to the end of the line. Delete the line if it is empty. .sp .B ctrl-g Go to an include or definition, or toggle the status bar. .sp .B ctrl-d Delete a single character. .sp .B ctrl-o Open the command menu, which is a list of actions that can be performed. If editing a PKGBUILD file and guessica is installed, there will be a menu option for updating the pkgver + source fields. If pandoc is installed, a menu option for rendering to PDF may appear. .sp .B ctrl-t For C and C++: switch between the corresponding header and implementation. For Agda, insert a symbol. For Markdown, if the cursor is on a table, launch the Markdown table editor. For the rest, record and play back keypresses. Press escape to clear the current macro. .sp .B ctrl-c Press twice to copy the current block of text (until a blank line or the end of the file). Press once to only copy the current line. Also closes the portal. .sp .B ctrl-v Press once to paste only the first line of the copied text, trimmed. Press twice to paste the all copied text, untrimmed. .sp .B ctrl-x Press once to only cut the current line (or delete the line, if empty). Press twice to cut the current block of text (until a blank line or the end of the file). Also closes the portal. .sp .B ctrl-b Build programs, render to PDF or export to man page. Press twice to also run after building. Use \fBo -l\fP to view the last build command. Toggle bold in book mode. Toggle a breakpoint in debug mode. .sp .B ctrl-j Join lines. .sp .B ctrl-u Undo (\fBctrl-z\fP is also possible, but may background the application). .sp .B ctrl-y Redo. .sp .B ctrl-l Jump to a specific line number or percentage. Press return to jump to the top. Press return again to jump to the bottom. Press one of the highlighted on-screen letters to jump to that location. .sp .B ctrl-f Search for a string from the current location. The search wraps around and is case sensitive. There is also support for text replacement, after typing in the search term: To replace all, press tab instead of return, enter a replace term and then press tab. To replace once, press tab instead of return, enter a replace term and then press return. Search for just \fBf\fP to find the previous function signature. .sp .B esc Go back after having gone to another location or file. Redraw the screen and clear the last search. .sp .B ctrl-space Build programs, render to PDF or export to man page. Press twice to also run after building. Toggle checkboxes in Markdown. Cycle display and export options in book mode. .sp The last used external command by `o` can be found in `~/.cache/o/last_command.sh`. .sp .B ctrl-~ Insert the current date and time. .sp `o` will try to jump to the location where the error is and otherwise display "Success". .sp .B ctrl-\\\\ Toggle single-line comments for a block of code. .sp .B ctrl-_ Insert a symbol by typing in a 2-letter digraph. The digraphs are the same as for ViM. For a full overview, see: https://raw.githubusercontent.com/xyproto/digraph/main/digraphs.txt .sp .B ctrl-r Jump to matching bracket or rename something when programming, otherwise toggle "wrap when typing". For git interactive rebase, cycle keywords. Press twice to open or close a portal. .sp .SH "ENV" .sp The \fBNO_COLOR\fP environment variable can be set to 1 to disable all colors. .sp If \fBXTERM_VERSION\fP is set (usually automatically by xterm), the "light" color scheme will be used. .sp The \fBORBITON_OLLAMA\fP environment variable can be set to 1 to enable Ollama-specific features. .sp The \fBOLLAMA_MODEL\fP environment variable can be set to specify which Ollama model to use for code completion. .sp The \fBOLLAMA_HOST\fP environment variable specifies the host for the Ollama service if a non-local service should be used. .sp .SH "MAN PAGER" O can be used for viewing man pages by setting MANPAGER to "o" with ie. \fBexport MANPAGER=o\fP. .SH "WHY" .sp I wanted to write a simple editor that only used VT100 terminal codes. .SH "SEE ALSO" .BR e3 (1) .BR nano (1) .BR micro (1) .SH KNOWN BUGS In some terminal emulators, scrolling quickly up or down with the arrow keys can make the text jump around (it works fine in \fBalacritty\fP). Scroll up and down with \fBctrl-n\fP and \fBctrl-p\fP instead to avoid this. Press \fBesc\fP to repaint the text, if needed. .sp Some unicode runes may disrupt the text flow. This is generally not a problem for editing code and configuration files, but may be an issue when editing files that contains text in many languages. .sp For some terminal emulators, if \fBo\fP is busy performing an operation, pressing \fBctrl-s\fP may lock the terminal. Some terminal emulators, like \fBkonsole\fP, can be configured to turn off this behavior. Press \fBctrl-q\fP to unlock the terminal again (together with the unfortunate risk of quitting \fBo\fP). You can also use the \fBctrl-o\fP menu for saving and quitting. .sp \fBo\fP may have issues with large files (of several MB+). For normal text files or source code files, this is a non-issue. .sp Middle-click pasting (instead of pasting with \fBctrl-v\fP) may have issues with only pasting the first character. .sp The smart indentation is not always smart. .SH VERSION 2.74.4 .SH AUTHOR .B o was written by Alexander F. Rødseth