A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/xyproto/orbiton below:

xyproto/orbiton: Snappy and configuration-free little text editor/IDE for the terminal. Suitable for writing git commit messages, editing Markdown, config files, source code, man pages and for quick edit-format-compile cycles when programming. Has syntax highlighting, jump-to-error, rainbow parentheses, macros, cut/paste portals and a simple gdb front-end.

Orbiton is a text editor and a simple IDE with the following leading principles:

Please submit a PR if anything can be improved to help adhere to these.

Orbiton might be a good fit for:

This has been my main editor for around 3 years now (since early 2022), and it is mostly written in itself, apart from some NeoViM in the early beginning.

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

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

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

There are also light themes available:

Writing commit messages:

orbiton

With Go 1.21 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.70.0/orbiton-2.70.0-linux_armv7_static.tar.xz' | tar JxC /tmp && sudo install -Dm755 /tmp/orbiton-2.70.0-linux_armv7_static/o /usr/bin/o && sudo install -Dm644 /tmp/orbiton-2.70.0-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

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

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

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

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:

Add this to ~/.profile:

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

Log out and in again to activate the changes.

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

Other features and limitations

There are pretty few hotkeys to remember:

Programming language File extensions Jump to error Build command Format command Ada .adb, .gpr, .ads, .ada WIP WIP WIP Agda .agda Yes agda -c $filename N/A ALGOL 68 .a68 WIP a68g --compile $filename WIP Assembly .asm, .s, .S, .inc Yes yasm -f elf64 -o $output.o $filename N/A C .c, .h Yes gcc $filename -o $output clang-format -i --style=WebKit $filename C++ .cpp, .cc, .cxx, .h, .hpp, .h++, .c++ Yes g++ $filename -o $output clang-format -i --style=WebKit $filename C# .cs Yes dotnet build $filename astyle --mode=cs $filename C3 .c3 Yes c3c compile -o $output $filename c3fmt --rewrite $filename Clojure .clj, .cljs, .clojure WIP lein compile $filename WIP Crystal .cr Yes crystal build $filename --release crystal tool format $filename CSS .css WIP No prettier --tab-width 2 -w $filename D .d Yes dmd $filename -of$output WIP Dart .dart Yes dart compile exe --output $output $filename dart format $filename Erlang .erl Yes erlc $filename WIP Fortran77, Fortran90 .f, .f90 Yes gfortran -o $output $filename WIP Garnet .gt WIP garnetc -o $output $filename WIP GLSL .glsl, .vert, .frag WIP glslangValidator -V -o $output $filename WIP Go .go Yes go build $filename goimports -w $filename Hare .ha Yes hare build $filename N/A Haskell .hs Yes ghc -dynamic $filename brittany --write-mode=inplace $filename HTML .html WIP No tidy -m $filename Ivy .ivy WIP WIP N/A Java .java Yes javac + jar, see details below google-java-format -a -i $filename JavaScript .js WIP No prettier --tab-width 4 -w $filename Jakt .jakt WIP jakt $filename WIP Just justfile, .justfile No No just --unstable --fmt -f $filename Kotlin .kt, .kts Yes kotlinc $filename -include-runtime -d $output.jar ktlint -F $filename Kotlin Native .kt, .kts Yes kotlinc-native -nowarn -opt -Xallocator=mimalloc -produce program -linker-option --as-needed $filename -o $output ktlint -F $filename Lua .lua Yes luac -o $output.luac $filename lua-format -i --no-keep-simple-function-one-line --column-limit=120 --indent-width=2 --no-use-tab $filename Markdown .md WIP No prettier --write $filename Nim .nim WIP nim c -o:$output $filename WIP Objective-C .m Yes clang $filename -o $output clang-format -i --style=WebKit $filename Odin .odin Yes odin build $filename N/A Objective Pascal .pas, .pp, .lpr Yes fpc $filename WIP OCaml .ml WIP No ocamlformat $filename Perl .pl Yes perl $filename /usr/bin/vendor_perl/perltidy -se -b -i=2 -ole=unix -bt=2 -pt=2 -sbt=2 -ce $filename Python .py Yes python -m py_compile $filename black $filename Ruby .rb No No rubocop -A $filename Rust (with Cargo.toml) .rs Yes cargo build rustfmt $filename Rust .rs Yes rustc $filename rustfmt $filename Scala .scala Yes scalac $filename && jar cfe $output MainClass *.class scalafmt $filename Shell .sh, PKGBUILD, APKBUILD WIP makepkg shfmt -s -w -i 2 -bn -ci -sr -kp $filename Standard ML .sml, .fun, .mlb, .cm Yes mlton $filename WIP Swift .swift WIP WIP WIP TypeScript .ts WIP No prettier --tab-width 4 -w $filename V .v Yes v build $filename v fmt $filename XML .xml WIP No tidy -w 80 -q -i -utf8 --show-errors 0 --show-warnings no --tidy-mark no -xml -m $filename Zig .zig Yes zig build-exe $filename zig fmt $filename

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

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.

While in the Markdown table editor:

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 configuration-free, but it is completely optional.

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

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

Just building and installing o also works:

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

C++

Go

Zig

V

Rust

Haskell

Python

Crystal

Kotlin

Java

Scala

D

JSON

fstab

JavaScript

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

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

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

There are also these shortcuts:

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

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 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:

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

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.

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:

It is also possible to run a case-insensitive file search and open up the first match with, where "omfile" is a case-insensitive substring of the found filename:

When using pandoc to export from Markdown to PDF:

# 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

Build:

Install (use sudo or doas, if needed):

The built-in spellchecker uses a list of words from this project that is licensed under this MIT license:

MIT License, Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4