• Stars
    star
    279
  • Rank 147,967 (Top 3 %)
  • Language
    Go
  • License
    BSD 3-Clause "New...
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐ŸŒ€ Config-free text editor and IDE limited to VT100. Suitable for writing git commit messages, editing Markdown, config files, source code, viewing man pages and for quick edit-compile cycles when programming. Incl. syntax highlighting, jump-to-error, rainbow parentheses, macros, tab compl., cut/paste portals, a gdb front-end & ChatGPT supp.

Orbiton Logo

Build Go Report Card License Stand With Ukraine

Orbiton is a text editor and a minimalistic IDE.

It might be a good fit for:

  • Editing git commit messages (using EDITOR=o git commit).
  • Editing README.md and TODO.md files.
  • Write Markdown and then export to HTML or to a PDF.
  • Learning programming languages, like Rust or Zig.
  • Editing files deep within larger Go or C++ projects.
  • Solving Advent of Code tasks.
  • Generate poetry or code with the help of ChatGPT, by prefixing a prompt with !.
  • Being placed on a live image for a Linux or BSD distro, since it supports VT100, is small and self-contained, has a built-in log, man page and image viewer, can be used as EDITOR=o visudo and has built-in support for editing and formatting /etc/fstab files.
  • Write X number of words in a distraction-free and full-screen environment. Press ctrl-g to see the word count in the status bar.

For a more feature complete editor that is also written in Go, check out micro.

Screenshots

Screenshot of the VTE GUI application that can be found in the og directory, running the o editor:

screenshot

Stepping through the assembly instructions of a Rust program by entering debug mode with the ctrl-o menu and then stepping with ctrl-n:

debug rust

Editing a C source file in og using the "synthwave" theme:

synthwave theme

Packaging status

orbiton o-editor
Packaging status Packaging status

Quick start

With Go 1.17 or later, the development version of o can be installed like this:

go install github.com/xyproto/orbiton/v2@latest && mv -i ~/go/bin/orbiton ~/go/bin/o

Adjust the mv flags and the ~/go/bin path as needed. Perhaps go install will have an -o flag in the future.

Alternatively, download and install a release version. For example, for Raspberry Pi 2, 3 or 4 running Linux:

curl -sL 'https://github.com/xyproto/orbiton/releases/download/v2.62.7/orbiton-2.62.7-linux_armv7_static.tar.xz' | tar JxC /tmp && sudo install -Dm755 /tmp/orbiton-2.62.7-linux_armv7_static/o /usr/bin/o && sudo install -Dm644 /tmp/orbiton-2.62.7-linux_armv7_static/o.1.gz /usr/share/man/man1/o.1.gz

Setting o as the default editor executable for git

To set:

git config --global core.editor o

To unset:

git config --global --unset core.editor

Viewing man pages

By setting the MANPAGER environment variable, it's possible to use o for viewing man pages:

export MANPAGER=o

An alternative to viewing man pages in o is to use less:

export MANPAGER='less -s -M +Gg'

Setting up o on OpenSUSE

Install o manually, until an OpenSUSE package exists:

git clone https://github.com/xyproto/orbiton
cd orbiton
make && sudo make install

The following is not strictly needed, but it sets everything up to make full use of o:

Add this to ~/.alias:

alias o=/usr/bin/o

Add this to ~/.profile:

export MANPAGER=/usr/bin/o
export EDITOR=/usr/bin/o

Log out and in again to activate the changes.

Themes

Themes can be selected with the ctrl-o menu. The theme menu also lists the theme names, which can be specified in the O_THEME environment variable.

The O_THEME environment variable is an exception to the claim that o is complettely configuration-free, but it is completely optional.

For using ie. the Synthwave theme, the /usr/bin/sw symlink can be used, or this can be added to ~/.profile:

export O_THEME=synthwave

Unique features

These features are unique to o, as far as I am aware:

  • If the loaded file is read-only, all text will be red by default.
  • Smart cursor movement, trying to maintain the X position when moving up and down, across short and long lines.
  • Press ctrl-v once to paste one line, press ctrl-v again to paste the rest.
  • Press ctrl-c once to copy one line, press ctrl-c again to copy a block of lines (until a blank line).
  • Open or close a portal with ctrl-r. When a portal is open, copy lines across files (or within the same file) with ctrl-v.
  • Build code with ctrl-space and format code with ctrl-w, for a wide range of programming languages.
  • Cycle git rebase keywords with ctrl-w or ctrl-r, when an interactive git rebase session is in progress.
  • Jump to a line with ctrl-l. Either enter a number to jump to a line or just press return to jump to the top. Press ctrl-l and return again to jump to the bottom.
  • When jumping to a specific line in a file with ctrl-l, jumping to a percentage (like 50%) or a fraction (like 0.5 or .5) is also possible.
  • If tab completion in the terminal went wrong and you are trying to open a main. file that does not exist, but main.cpp and main.o does exists, then main.cpp will be opened.
  • Search by pressing ctrl-f, entering text and pressing return. Replace by pressing tab instead of return, then enter the replacement text and press return. Searching for unicode runes on the form u+0000 is also supported.
  • Type iferr on a single line in a Go or Odin program and press return to insert a suitable if err != nil { return ... } block, based on koron/iferr.
  • For C-like languages, missing parentheses are added to statements like if, for and while when return is pressed.
  • Correct mistakes as lines are typed in, but only if the OpenAI API key is set, and if the "fix as you type" feature is enabled from the ctrl-o menu.
  • A built-in Markdown table editor that can be launched by pressing ctrl-t when the cursor is on a table.

Other features and limitations

  • The syntax highlighting is instant.
  • Can compile "Hello, World" in many popular programming languages simply by pressing ctrl-space.
  • Configuration-free, for better and for worse.
  • Can preview .png, .jpg, .jpeg, .gif, .ico, .bmp or .webp images directly in the terminal (using a scaled down version and up to 16 colors).
  • The -p flag followed by a filename can be used for just pasting the clipboard to a new file, instead of editing a file.
  • ctrl-t can jump between a C++ header and source file, when editing C++ code.
  • ctrl-t shows the Markdown table editor, when editing Markdown and the cursor is on a Markdown table.
  • Can only edit one file at the time, by design.
  • Provides syntax highlighting for Go, C++, Markdown, Bash and several other languages. There is generic syntax highlighting built-in.
  • Will jump to the last visited line when opening a recent file.
  • Is provided as a single self-contained executable.
  • Loads faster than both vim and emacs, for small files.
  • Can render text to PDF either by itself or by using pandoc.
  • Tested with alacritty, konsole, st, urxvt, xfce4-terminal, xterm and zutty.
  • Tested on Arch Linux, Debian, FreeBSD and OpenBSD.
  • Never asks before saving or quitting. Be careful.
  • The NO_COLOR environment variable can be set to disable all colors.
  • Rainbow parentheses makes lines with many parentheses easier to read.
  • Limited to VT100, so hotkeys like ctrl-a and ctrl-e must be used instead of Home and End. And for browsing up and down, ctrl-n and ctrl-p must be used. PgUp and PgDn can be used with the GUI frontend, but are not recognized by VT100.
  • Compiles with either go or gccgo.
  • Will strip trailing whitespace whenever it can.
  • Must be given a filename at start.
  • May provide smart indentation.
  • Requires that /dev/tty is available.
  • xclip for X, wl-clipboard for Wayland or pbcopy for macOS needs to be installed to access the system clipboard.
  • May take a line number as the second argument, with an optional + or : prefix.
  • If the filename is COMMIT_EDITMSG, the look and feel will be adjusted for git commit messages.
  • Supports UTF-8, but some runes may be displayed incorrectly.
  • Only UNIX-style line endings are supported (\n).
  • Will convert DOS/Windows line endings (\r\n) to UNIX line endings (just \n), whenever possible.
  • Will replace non-breaking space (0xc2 0xa0) with a regular space (0x20) whenever possible.
  • If interactive rebase is launched with git rebase -i, then either ctrl-w or ctrl-r will cycle the keywords for the current line (fixup, drop, edit etc).
  • If the editor executable is renamed to a word starting with r (or have a symlink with that name), the default theme will be red/black.
  • If the editor executable is renamed to a word starting with l (or have a symlink with that name), the default theme will be suitable for light backgrounds.
  • If the editor executable is renamed to a word starting with s (or have a symlink with that name), the default theme will be the "synthwave" theme.
  • Want to quickly convert Markdown to HTML and have pandoc installed? Try o filename.md, press ctrl-space twice and quit with ctrl-q.
  • The default syntax highlighting theme aims to be as pretty as possible with less than 16 colors, but it mainly aims for clarity. It should be easy to spot a keyword, number, string or a stray parenthesis.
  • Press ctrl-w to toggle the check mark in - [ ] TODO item boxes in Markdown.
  • Orbiton is written mostly in Orbiton, with some use of NeoVim for the initial development.
  • Can load, edit and save gzipped text files or man pages that ends with a .gz extension.
  • Has fewer hotkeys to learn than GNU Nano.

Known issues

  • Using tmux and resizing the terminal emulator window may trigger text rendering issues. Try pressing esc to redraw the text, or ctrl-f to search for text. Setting TERM correctly might help.
  • For some terminal emulators, if o is busy performing an operation, pressing ctrl-s may lock the terminal. Some terminal emulators, like konsole, can be configured to turn off this behavior. Press ctrl-q to unlock the terminal again (together with the unfortunate risk of quitting o). To sidestep this issue, the ctrl-o menu can be used instead, for saving and quitting.
  • Some unicode runes may disrupt the text flow! This is generally not a problem for editing code and configuration files, but is an issue when editing files that contains text in many languages, or using emojis.
  • o may have issues with large files (of several MB+). For normal text files or source code files, this is a non-issue.
  • Middle-click pasting (instead of pasting with ctrl-v) will only paste the first character.
  • Pressing cmd-v, cmd-x and cmd-c on macOS only works when using the og GUI/VTE frontend. For o, ctrl-v, ctrl-x and ctrl-c can be used instead.
  • The Markdown table editor does not have scrolling, so the table must fit within the current terminal emulator width and height. Resize the terminal as needed.

Hotkeys

There are fewer hotkeys to remember than for GNU Nano.

  • ctrl-s - Save.
  • ctrl-q - Quit.
  • ctrl-r - Open or close a portal. Text can be pasted from the portal into another (or the same) file with ctrl-v. For "git interactive rebase" mode (git rebase -i), this will cycle the rebase keywords instead.
  • ctrl-w - Format the current file (see the table below), or cycle git rebase keywords. For Markdown, toggle checkboxes or re-format tables.
  • ctrl-a - Go to start of text, then start of line and then to the previous line.
  • ctrl-e - Go to end of line and then to the next line
  • ctrl-n - Scroll down 10 lines, or go to the next match if a search is active. Insert a column when in the Markdown table editor.
  • ctrl-p - Scroll up 10 lines, or go to the previous match if a search is active, or jump to the matching parenthesis or bracket, if the cursor just moved on to one. Remove an empty column when in the Markdown table editor.
  • ctrl-k - Delete characters to the end of the line, then delete the line.
  • ctrl-g - Display simple help the first 2 times, then toggle the status bar. Can also jump to function definitions within the same file.
  • ctrl-_ - Insert a symbol by typing in a 2-letter digraph.
  • ctrl-d - Delete a single character.
  • ctrl-t - For C and C++: jump between the current header and source file. For Agda and Ivy, insert a symbol. For Markdown, launch the Markdown table editor if the cursor is on a table. For the rest, record and play back keypresses. Press Esc to clear the current macro.
  • ctrl-o - Open a command menu with actions that can be performed.
  • ctrl-x - Cut the current line. Press twice to cut a block of text (to the next blank line).
  • ctrl-c - Copy one line. Press twice to copy a block of text.
  • ctrl-v - Paste one trimmed line. Press twice to paste multiple untrimmed lines.
  • ctrl-space - Build program, render to PDF or export to man page (see table below).
  • ctrl-j - Join lines (or jump to the bookmark, if set).
  • ctrl-u - Undo (ctrl-z is also possible, but may background the application).
  • ctrl-l - Jump to a specific line number. Press return to jump to the top. If at the top, press return to jump to the bottom.
  • ctrl-f - Search for a string. The search wraps around and is case sensitive. Press tab instead of return to search and replace.
  • ctrl-b - Toggle a bookmark for the current line, or if set: jump to a bookmark on a different line.
  • ctrl-\ - Comment in or out a block of code.
  • ctrl-~ - Jump to a matching parenthesis or bracket.
  • esc - Redraw everything and clear the last search.

Build and format

  • Press ctrl-space to build or export the current file.
  • Press ctrl-w to format the current file, in an opinionated way. If the current file is empty, a "Hello, World!" template will be inserted, for some file extensions.
Programming language File extensions Jump to error Build command Format command ($filename is a temporary file)
Ada .ada WIP WIP WIP
Agda .agda yes agda -c $filename N/A
C and C++ .cpp, .cc, .cxx, .h, .hpp, .c++, .h++, .c yes cxx clang-format -fallback-style=WebKit -style=file -i -- $filename
C# .cs yes csc -nologo -unsafe $filename astyle -mode=cs $filename
Clojure .clj, .cljs, .clojure WIP lein uberjar WIP
Crystal .cr yes crystal build --no-color $filename crystal tool format $filename
D .d yes gdc WIP
Dart .dart yes dart compile exe --verbosity error $filename dart format
Garnet .gt WIP garnetc -o $executable $filename N/A
Go .go yes go build goimports -w -- $filename
Hare .ha yes hare build N/A
Haskell .hs yes ghc -dynamic $filename brittany --write-mode=inplace $filename
Ivy .ivy WIP WIP N/A
Jakt .jakt WIP WIP WIP
Java .java yes javac + jar, see details below google-java-format -i $filename
JavaScript .js WIP WIP prettier --tab-width 4 -w $filename
Just .just, .justfile, justfile no no just --unstable --fmt -f $filename
Kotlin, if kotlinc-native is installed .kt yes kotlinc-native -nowarn -opt -Xallocator=mimalloc -produce program -linker-option '--as-needed' $filename ktlint
Kotlin .kt yes kotlinc $filename -include-runtime -d ktlint
Lua .lua yes luac lua-format -i --no-keep-simple-function-one-line --column-limit=120 --indent-width=2 --no-use-tab $filename
Nim .nim WIP nim c WIP
Object Pascal .pas, .pp, .lpr yes fpc WIP
OCaml .ml WIP ocamlopt -o $executable $filename WIP
Odin .odin yes odin build N/A
Python .py yes python -m py_compile $filename autopep8 -i --maxline-length 120 $filename
Rust, if Cargo.toml or ../Cargo.toml exists .rs yes cargo build rustfmt $filename
Rust .rs yes rustc $filename rustfmt $filename
Scala .scala yes scalac + jar, see details below WIP
Standard ML .sml yes mlton WIP
TypeScript .ts WIP WIP WIP
V .v yes v build v fmt $filename
Zig .zig yes zig build-exe -lc $filename zig fmt $filename

/etc/fstab, JSON and HTML files are also supported, and can be formatted with ctrl-w.

  • o will try to jump to the location where the error is and otherwise display Success.
  • For regular text files, ctrl-w will word wrap the lines to a length of 99.
  • If kotlinc-native is not available, this build command will be used instead: kotlinc $filename -include-runtime -d $name.jar

CXX can be downloaded here: GitHub project page for CXX.

File type File extensions Build or export command
AsciiDoc .adoc asciidoctor -b manpage (writes to out.1)
scdoc .scd, .scdoc scdoc (writes to out.1)
Markdown .md pandoc -N --toc -V geometry:a4paper (writes to $filename.pdf)

Debug support for C and C++

This is a brand new feature and needs more testing.

  • If gdb is installed, it's possible to select "Debug mode" from the ctrl-o menu and then build and step through a program with ctrl-space, or set a breakpoint with ctrl-b and continue with ctrl-space.
  • Messages printed to stdout are displayed as a status message when that line is reached.
  • An indication of which line the program is at has not yet been added, and is a work in progress.
  • There are status messages indicating when the debug session is started and ended.

Markdown table editor

While in the Markdown table editor:

  • Cells can be typed into.
  • The arrow keys can be used to move around.
  • tab can be used to go to the next cell, or insert new cells if the last cell is reached.
  • return can be used to either move to a blank cell below or to insert a new row below.
  • backspace can be used to delete letters, but also for deleting the current row if it is empty.
  • ctrl-n can be used to insert a new column to the right.
  • ctrl-d can be used to delete the current column (if all fields are empty).
  • esc or ctrl-t can be used to close the Markdown table editor.

Inserting a symbol

  • To insert a symbol, like รฆ, just press ctrl-_ and type in ae. To insert ยต, type in My.
  • These are the same digraphs as ViM uses.
  • For a full overview of digraphs, see digraphs.txt.

Code generation

  • Obtain an API key from openai.com and set it as the OPENAI_API_KEY, OPENAI_KEY or CHATGPT_API_KEY environment variable.
  • Press return after writing ie. !write a function that adds two numbers or // Write a function that adds two numbers.
  • Watch syntax highlighted code being generated in front of your eyes. ChatGPT generates the code.
  • Press Esc to stop code from being generated.
  • Select Fix as you type from the ctrl-o menu to let ChatGPT try to correct every line as it is typed in. The API key must be set for the menu option to appear.

Manual installation on Linux

git clone https://github.com/xyproto/orbiton
cd orbiton
make && sudo make install

And optionally:

make gui && sudo make gui-install

It is also possible to install the symlinks that are suggested further down in this document.

OpenBSD installation instructions

Install dependencies (use doas if needed):

add_pkg git gmake go vte3

Build both the editor o and the GUI frontend og:

gmake CXX="clang++ -w" o og

*Install both executables, a man page, an icon and a desktop shortcut file (use doas if needed`):

PREFIX=/usr/local gmake install og-install

It is also possible to install the symlinks that are suggested further down in this document.

Dependencies

C++

  • For building code with ctrl-space, cxx must be installed.
  • For formatting code with ctrl-w, clang-format must be installed.

Go

  • For building code with ctrl-space, The go compiler must be installed.
  • For formatting code with ctrl-w, goimports must be installed.

Zig

  • For building and formatting Zig code, only the zig command is needed.

V

  • For building and formatting V code, only the v command is needed.

Rust

  • For building code with ctrl-space, Cargo.toml must exist and cargo must be installed.
  • For formatting code with ctrl-w, rustfmt must be installed.

Haskell

  • For building the current file with ctrl-space, the ghc compiler must be installed.
  • For formatting code with ctrl-w, brittany must be installed.

Python

  • ctrl-space only checks the syntax, without executing. This only requires python to be available.
  • For formatting the code with ctrl-w, autopep8 must be installed.

Crystal

  • For building and formatting Crystal code, only the crystal command is needed.

Kotlin

  • For building code with ctrl-space, kotlinc must be installed. A .jar file is created if the compilation succeeded.
  • For formatting code with ctrl-w, ktlint must be installed.

Java

  • For building code with ctrl-space, javac and jar must be installed. A .jar file is created if the compilation succeeded.
  • For formatting code with ctrl-w, google-java-format must be installed.

Scala

  • For building code with ctrl-space, scalac and jar must be installed. A .jar file is created if the compilation succeeded.
  • The jar file can be executed with java -jar main.jar. Use scalac -d main.jar MyFile.scala if you want to produce a jar that can be executed with scala main.jar.
  • For formatting code with ctrl-w, scalafmt must be installed.

D

  • For building code with ctrl-space, gdc must be available.

JSON

  • The JSON formatter is built-in. Note that for some files it may reorganize items in an undesirable order, so don't save the file if the result is unexpected.

fstab

  • Formatting fstab files (usually /etc/fstab) is a built-in feature. Just press ctrl-w. If you need a standalone utility, fstabfmt is available.

JavaScript

  • For formatting JavaScript code with , prettier must be installed.

Java

Since kotlinc $filename -include-runtime -d builds to a .jar, I though I should do the same for Java. The idea is to easily compile a single or a small collection of .java files, where one of the files has a main function.

If you know about an easier way to build a .jar file from *.java, without using something like gradle, please let me know by submitting a pull request. This is pretty verbose...

javaFiles=$(find . -type f -name '*.java')
for f in $javaFiles; do
  grep -q 'static void main' "$f" && mainJavaFile="$f"
done
className=$(grep -oP '(?<=class )[A-Z]+[a-z,A-Z,0-9]*' "$mainJavaFile" | head -1)
packageName=$(grep -oP '(?<=package )[a-z,A-Z,0-9,.]*' "$mainJavaFile" | head -1)
if [[ $packageName != "" ]]; then
  packageName="$packageName."
fi
mkdir -p _o_build/META-INF
javac -d _o_build $javaFiles
cd _o_build
echo "Main-Class: $packageName$className" > META-INF/MANIFEST.MF
classFiles=$(find . -type f -name '*.class')
jar cmf META-INF/MANIFEST.MF ../main.jar $classFiles
cd ..
rm -rf _o_build

Scala

For Scala, this is the code that is used to produce a main.jar file that can be run directly with java -jar main.jar:

#!/bin/sh
scalaFiles=$(find . -type f -name '*.scala')
for f in $scalaFiles; do
  grep -q 'def main' "$f" && mainScalaFile="$f"
  grep -q ' extends App ' "$f" && mainScalaFile="$f"
done
objectName=$(grep -oP '(?<=object )[A-Z]+[a-z,A-Z,0-9]*' "$mainScalaFile" | head -1);
packageName=$(grep -oP '(?<=package )[a-z,A-Z,0-9,.]*' "$mainScalaFile" | head -1);
if [[ $packageName != "" ]]; then
  packageName="$packageName."
fi
mkdir -p _o_build/META-INF
scalac -d _o_build $scalaFiles
cd _o_build
echo -e "Main-Class: $packageName$objectName\nClass-Path: /usr/share/scala/lib/scala-library.jar" > META-INF/MANIFEST.MF
classFiles=$(find . -type f -name '*.class')
jar cmf META-INF/MANIFEST.MF ../main.jar $classFiles
cd ..
rm -rf _o_build
  • If /usr/share/scala/lib/scala-library.jar is not found scalac -d run_with_scala.jar is used instead.
  • If scala-library.jar was not found, then the resulting jar file will need scala to run.

Agda

ctrl-t brings up a menu with a selection of special symbols.

There are also these shortcuts:

  • Insert โŠค by pressing ctrl-t and then t.
  • Insert โ„• by pressing ctrl-t and then n.

Updating PKGBUILD files

When editing PKGBUILD files, it is possible to press ctrl-o and select Call Guessica to update the pkgver= and source= fields, by a combination of guesswork and online searching. This functionality depends on the Guessica package update utility being installed, and will only work for some PKGBUILD files.

List of optional runtime dependencies

  • agda - for compiling Agda code
  • asciidoctor - for writing man pages
  • astyle - for formatting C# code
  • autopep8 - for formatting Python code
  • brittany - for formatting Haskell code
  • cargo - for compiling Rust
  • clang - for formatting C++ code with clang-format
  • clojure - for compiling Clojure
  • crystal - for compiling Crystal
  • cxx - for compiling C++
  • fpc - for compiling Object Pascal
  • g++ - for compiling C++ code
  • gdc - for compiling D code
  • ghc - for compiling Haskell code
  • go - for compiling Go code
  • go-tools - for formatting Go code and handling imports with goimports
  • google-java-format - for formatting Java code
  • jad - decompile .class files on the fly when opening them with o
  • java-environment - for compiling Java code and creating .jar files with javac and jar
  • kotlin - for compiling Kotlin
  • ktlint - for formatting Kotlin code
  • lua - for compiling Lua to bytecode
  • lua-format - for formatting Lua code
  • mlton - for compiling Standard ML
  • mono - for compiling C# code
  • ocaml - for compiling and formatting OCaml code
  • odin - for compiling Odin
  • pandoc - for exporting Markdown to PDF
  • prettier - for formatting JavaScript, TypeScript and CSS
  • python - for compiling Python to bytecode
  • rustc - for compiling Rust
  • rustfmt - for formatting Rust
  • scala - for compiling Scala
  • sdoc - for writing man pages
  • tidy - for formatting XML
  • v - for compiling and formatting V code
  • zig - for compiling and formatting Zig code

Size

  • The o executable is 1.5M when built with GCC 12 (for 64-bit Linux) and compressed with upx.
  • This isn't as small as e3, an editor written in assembly (which is 234k), but it's reasonably lean.

One way of building with gccgo and upx (in the v2 directory):

go build -mod=vendor -gccgoflags '-Os -s' -o o && upx --best --lzma o

If the o executable is built with Go 1.20 instead, the size can be 8.7M, or just 2.8M when packed with upx:

go build -mod=vendor -ldflags='-s -w' -trimpath -o o && upx --best --lzma o

Jumping to a specific line when opening a file

These four ways of opening file.txt at line 7 are supported:

  • o file.txt 7
  • o file.txt +7
  • o file.txt:7
  • o file.txt+7

This also means that filenames containing + or :, and then followed by a number, are not supported.

Flags

  • -f can be used to open a file, regardless of if there are any locks. It can also be used for overwriting files together with -p.
  • -c FILENAME can be used to copy the contents of the given file to the clipboard and then exit.
  • -p FILENAME can be used to paste the contents of the clipboard to the given FILENAME (if it does not already exist) and then exit.
  • -n can be used to avoid writing lockfiles, build files, location history, search history and the game highscore to $XDG_CACHE_DIR/cache/o or ~/.cache/o. Not recommended.
  • --help can be used to get a quick overview of the supported keybindings.
  • --version will print the current version and then exit.

Spinner

When loading files that are large or from a slow disk, an animated spinner will appear. The loading operation can be interrupted by pressing esc, q or ctrl-q.

progress

Find and open

This shell function works in zsh and bash and may be useful for both searching for and opening a file at the given line number (works best if there is only one matching file, if not it will open several files in succession):

fo() { find . -type f -wholename "*$1" -exec o {} $2 \;; }

If too many files are found, it is possible to stop opening them by selecting Stop parent and quit without saving from the ctrl-o menu, which will quit the editor and also kill the parent find process.

Example use:

fo somefile.cpp 123

Pandoc

When using pandoc to export from Markdown to PDF:

  • If the PAPERSIZE environment variable is set to ie. a4 or letter, it will be respected when exporting from Markdown to PDF using pandoc, at the press of ctrl-space.
  • The --pdf-engine=xelatex and --listings flags are used, so xelatex and the listings package needs to be available. A standard installation of LaTeX and Pandoc should provide both.
  • Render to PDF with pandoc will only appear on the ctrl-o menu when editing a Markdown file and pandoc is installed.

Easter eggs

  • Press the Konami code keys while in the ctrl-o menu to start a silly little game about feeding creatures with pellets before they are eaten. Alternatively, create a symlink for starting it directly, ie.: ln -sf /usr/bin/o /usr/bin/feedgame.
  • Searching for the letter f jumps to the previous function signature.
  • Press right, down, left or left, down, right in rapid succession followed by either down to save or up to save and quit. The only purpose of this unusual shortcut is to help avoid the painful Emacs pinky.

Included executables

  • o - for terminal emulators that supports at least VT100
  • og - for the VTE GUI (optional)

Recommended symlinks

# For starting o with the Light theme
ln -sf /usr/bin/o /usr/bin/li
# For starting o with the Red/Black theme
ln -sf /usr/bin/o /usr/bin/redblack
# For starting o with the Synthwave theme
ln -sf /usr/bin/o /usr/bin/sw
# For starting o with the Blue Edit theme
ln -sf /usr/bin/o /usr/bin/edi
# For starting o with the Light VS theme
ln -sf /usr/bin/o /usr/bin/vs
# For starting the GUI version of o with the Light theme
ln -sf /usr/bin/og /usr/bin/lig
# For starting the GUI version of o with the Red/Black theme
ln -sf /usr/bin/og /usr/bin/redblackg
# For starting the GUI version of o with the Synthwave theme
ln -sf /usr/bin/og /usr/bin/swg
# For starting the GUI version of o with the Blue Edit theme
ln -sf /usr/bin/og /usr/bin/edg
# For starting the GUI version of o with the Light VS theme
ln -sf /usr/bin/og /usr/bin/vg

The GUI/VTE frontend og

Build:

make gui

Install (use sudo or doas, if needed):

make gui-install

Terminal settings

Konsole

  • Untick the Flow control option in the profile settings, to ensure that ctrl-s will never freeze the terminal.

About the name

Stars

Stargazers over time

General info

  • Version: 2.62.7
  • License: 3-clause BSD
  • Author: Alexander F. Rรธdseth <[email protected]>

More Repositories

1

algernon

Small self-contained pure-Go web server with Lua, Teal, Markdown, Ollama, HTTP/2, QUIC, Redis, SQLite and PostgreSQL support ++
Go
2,797
star
2

permissions2

๐Ÿ” Middleware for keeping track of users, login states and permissions
Go
513
star
3

wallutils

๐ŸŒ† Utilities for handling monitors, resolutions, wallpapers and timed wallpapers
Go
354
star
4

sdl2-examples

SDL2 examples, for 25 different programming languages
Makefile
279
star
5

png2svg

๐Ÿ”€ Convert small PNG images to SVG Tiny 1.2
Go
228
star
6

gendesk

๐ŸŒฟ Generate .desktop files and download .png icons by specifying a minimum of information
Go
115
star
7

cxx

๐Ÿ”Œ Configuration-free utility for building, testing and packaging executables written in C++. Can auto-detect compilation flags based on includes, via the package system and pkg-config.
Python
95
star
8

permissionbolt

๐Ÿ”ฉ Middleware for keeping track of users, login states and permissions
Go
85
star
9

go2cpp

Go to C++20 transpiler
Go
85
star
10

battlestar

๐Ÿ’ซ A different take on Assembly, with the goal of creating tiny executables.
Go
73
star
11

simplebolt

๐Ÿ”ฉ Simple way to use the Bolt database
Go
65
star
12

fstabfmt

๐Ÿ”ต Format /etc/fstab automatically.
Go
59
star
13

permissionsql

๐Ÿ” Middleware for keeping track of users, login states and permissions
Go
59
star
14

c2go

๐Ÿš  The original c2go program. Attempts to convert C to Go. Works on several simple examples, but not complex applications.
C
56
star
15

simplehstore

๐Ÿช Easy way to use a PostgreSQL database (and the HSTORE feature) from Go
Go
54
star
16

mooseware

๐Ÿ’€ Skeleton for writing a middleware handler
Go
48
star
17

http2check

โœ… Utility for checking if a web server supports HTTP/2
Go
46
star
18

onthefly

๐Ÿ”— Generate HTML and CSS together, on the fly
Go
43
star
19

setconf

๐Ÿ“— Change settings in configuration text files
Python
41
star
20

pstore

๐Ÿ”ง Middleware for keeping track of users, login states and permissions, using the HSTORE feature in PostgreSQL
Go
33
star
21

simpleredis

๐Ÿ“ป Easy way to use Redis from Go
Go
25
star
22

wann

โš–๏ธ Weight Agnostic Neural Networks in Go
Go
25
star
23

cdetect

๐Ÿ”ฌ Detect which compiler and compiler version a Linux executable (in the ELF format) was compiled with
Go
24
star
24

vt100

๐Ÿ’ป VT100 Terminal Package
Go
24
star
25

splash

๐ŸŒŠ Syntax highlight code embedded in HTML with a splash of color. Also includes the auto-updated Chroma style gallery.
Go
23
star
26

elfinfo

Utility for displaying which compiler was used for creating an ELF file + basic info
HTML
22
star
27

botsay

๐Ÿค– Output text together with randomly generated ASCII robots in colors inspired by synthwave.
Go
22
star
28

ufw-extras

Extra ufw-* files for /etc/ufw/applications.d
19
star
29

tinyxxd

Drop-in replacement and standalone version of the hex dump utility that comes with ViM
C
18
star
30

distrodetector

๐Ÿ“‡ Detect which Linux distro, macOS or BSD version a system is running.
Go
18
star
31

jit

๐Ÿ–– Go module for executing machine code directly and a machine code interpreter.
Go
18
star
32

ainur

๐ŸŒŒ Detect compiler names and versions from ELF files
Go
16
star
33

echoperm

๐Ÿ“ฃ Middleware for echo for handling users, permissions and cookies
Go
16
star
34

metatar

Manipulate tar file metadata, list tar files or convert tar to cpio. For some projects, this can replace fakeroot and cpio, when creating an initrd image that is compatible with the Linux kernel.
Go
16
star
35

monkeyjump

๐Ÿ’ Minimalistic GUI for playing Go with GnuGo
Python
16
star
36

in

๐Ÿ“‚ Create a directory if needed, then run the given command there
Go
12
star
37

kal

๐Ÿ“‡ Utility with red days and flag flying days + calendar package for Go
Go
12
star
38

teaftp

๐Ÿต Simple, read-only TFTP server
Go
12
star
39

tinyionice

Drop-in replacement for ionice in 300 lines of C
C
11
star
40

gnetlark

๐Ÿฆ Fast HTTP server that supports handlers written in Starlark
Go
11
star
41

palgen

Create a palette of N colors or convert True Color images to indexed ones. Includes png2gpl and png2act.
Go
10
star
42

grimrec

๐Ÿ˜ฌ Record a window to a GIF, under Sway/Wayland
Python
10
star
43

term

๐Ÿ“บ Simple Terminal Interface
Go
9
star
44

pastefile

๐Ÿ“ƒ Create a file that contains the contents of the clipboard
Go
9
star
45

sealion

๐ŸŒŠ Prompt lunch reminder
Python
9
star
46

cupholder

๐Ÿต Remote CD tray ejection
Go
8
star
47

mcbanner

๐ŸŽ Application for generating Minecraft banners
Go
8
star
48

aget

Minimalistic AUR helper
Go
8
star
49

interfaces

๐Ÿง‰ List all network interfaces
Go
8
star
50

guessica

๐Ÿฅข Update a PKGBUILD file by guessing the latest version number and finding the latest git tag and hash online
Go
8
star
51

yaloco

๐Ÿธ Yet Another Log Colorizer
Go
7
star
52

simplemaria

๐Ÿก Easy way to use a MariaDB/MySQL database from Go
Go
7
star
53

pf

Apply functions to each pixel in an image, concurrently
Go
7
star
54

simpletimed

The Simple Timed Wallpaper specification + Go module
7
star
55

minitree

List files in columns
Python
7
star
56

pixelpusher

๐Ÿ‘พ Plot pixels concurrently on a nostalgic 320x200 256 color canvas
Go
7
star
57

randomstring

Generate random strings
Go
7
star
58

archlinux-wallpaper

Wallpapers for the archlinux-wallpaper package
7
star
59

plates

Package for dealing with RGB, HSV and HSL colors, mixing colors and for reading and writing images
Go
7
star
60

textoutput

๐Ÿ…ฐ๏ธ Output text, with and without colors
Go
6
star
61

datablock

๐ŸŒฟ Types and functions for caching files and directory listings with a fixed buffer size
Go
6
star
62

purefunction

Given a Go source code file, find all known pure functions
Go
6
star
63

sheepcounter

๐Ÿ‘ ResponseWriter that can count bytes written to the client
Go
6
star
64

sys

๐ŸŽฑ Wrapper for "systemctl" and "service" that never believes that "start" or "stop" is the name of a service
Shell
6
star
65

env

Provide default values when fetching environment variables
Go
6
star
66

alienpdf

๐Ÿ“ƒ Generate letters
Go
5
star
67

pinterface

๐Ÿ”ญ Interfaces for the permission* and simple* packages
Go
5
star
68

swish

โœ… Optimized Swish activation function, for neural networks
Go
5
star
69

cookie

๐Ÿช Functions related to cookies
Go
5
star
70

xpm

Encode images in the X PixMap (XPM3) image format
Go
5
star
71

kitchencalendar

๐Ÿ“† Generate per-week calendars that are meant to be printed out and hung up in a kitchen area
Go
5
star
72

scoreserver

โšพ REST/JSON server for managing users and scores
Go
5
star
73

symbolhash

Given a string, returns a unicode hash of the desired length
Go
5
star
74

dialog

๐ŸŒ Basic wrapper for the dialog executable
Go
5
star
75

emojiterm

List and display GitHub emojis directly on the terminal
Go
5
star
76

getver

๐ŸŽ Given an URL, get the current version for a project
Go
4
star
77

easy

๐Ÿง nice and ionice combined to a single utility using purely Go (no C)
Go
4
star
78

rangetype

๐Ÿ”ข Mini-language/DSL for defining and dealing with ranges of numbers
Go
4
star
79

carveimg

Two image viewing utilities for the terminal
Go
4
star
80

ask

๐Ÿ‘„ Ask the user a question
Go
4
star
81

tinysvg

๐Ÿ“ Package for generating TinySVG images
Go
4
star
82

archlog

๐Ÿ“’ Generates a ChangeLog from "svn log"
Go
4
star
83

tiddlywiki-launcher

Small script for launching a TiddlyWiki per user
Python
4
star
84

event2

Simple time-based event system, for triggering events at HH:MM
Go
4
star
85

termtitle

Change the title of the currently running terminal emulator
Go
4
star
86

addinclude

๐Ÿ”ผ Add include statements within the guards of a header file
Go
4
star
87

msg2

โ›ฒ Output a blue arrow followed by a bold message
C++
4
star
88

icostring

๐Ÿ‘๏ธ Generate a favicon.ico from a short string
Go
4
star
89

shrinky-intro

Skeleton for a 4k (demoscene) intro for 64-bit Linux
C++
4
star
90

burnfont

Hand-crafted 6x6 pixel font, defined by code
Go
4
star
91

binary

๐Ÿพ Detect if a file is binary or text
Go
4
star
92

plsclient

A client for gopls
Go
3
star
93

pamcan

Learn to type "pacman" correctly
Go
3
star
94

jumpline.vim

A solid keybinding for ctrl + l for ViM and NeoVim
Vim Script
3
star
95

smileypyramid

๐Ÿ”บ Example application for argument handling using docopt, for Rust and C++
C++
3
star
96

siteengines

Building blocks for creating a web page
Go
3
star
97

copy

Copy a file locally or over ssh, and ask before overwriting
Go
3
star
98

spheremover

๐ŸŸข Interactive real-time raytracing on the CPU, using OpenMP, SDL2 and C++
C++
3
star
99

pixelprotocol

Experimental protocol for streaming games
3
star
100

mime

Takes a file extension, returns a mime type
Go
3
star