Ox is a code editor that runs in your terminal

Related tags

Command-line ox
Overview

Logo

Ox editor

Ox is a code editor that runs in your terminal.


Build Status Build Status License

About The Project

Ox is a code editor. It was written in Rust using ANSI escape sequences. It assists developers with programming by providing several tools to speed up and make programming easier and a refreshing alternative to heavily bloated and resource hungry editors such as VS Code and JetBrains. Ox is lightweight so it can be used on older computers.

Bear in mind, this is a personal project and is nowhere near ready to replace your existing tools just yet.

It runs in the terminal and runs on platforms like Linux and macOS but doesn't work on Windows directly (it works if you use WSL) due to a lack of a good command line. There are many text editors out there and each one of them has their flaws and I hope to have a text editor that overcomes many of the burdens and issues.

Ox is not based on any other editor and has been built from the ground up without any base at all.

What features does Ox have and why should I use it?

Ox aims to be an editor that takes features from some of the most popular editors out there, gaining the best of all worlds.

Vim http://vim.org: Vim provides a plugin system for adding features to it as it is very minimal and only provides basic text editing functionality by default. It is quite extensive and has its own programming language for configuring and writing plugins for it. It has a steep learning curve due to being a “modal” text editor, having special modes for editing text. Ox is easier to use than Vim because it doesn’t have modes where the keyboard is repurposed, however it takes the idea of being a keyboard-only editor and being able to act just like an IDE after some configuration.

Nano https://www.nano-editor.org/: Nano is an editor that is very simple to grasp due to its intuitive key bindings such as Ctrl+S to save and Ctrl+? for the help menu etc. Ox took the idea for the key bindings from this editor, they are simple to remember, Ctrl+F for “Find”, Ctrl+Q for “Quit”, meaning that Ox doesn’t have as steep a learning curve.

Micro https://micro-editor.github.io/: Micro has a plugin system that is programmed with a language called Lua however I can’t seem to find any up to date plugins for it and it lacks features such as a file tree. It is micro that inspired me to add mouse functionality and other features.

Emacs https://www.gnu.org/software/emacs/: Emacs is still actively used today due to its freedom to modify and change the source code. Ox took the idea for the customization and extensibility of Emacs and made a configuration system where you can change the colours and appearance of the editor.

Xi https://xi-editor.io/: Xi is also written in Rust but is purely a backend at the moment, I decided to make Ox both a frontend and a backend because Xi has many frontends, but most of them are broken and it lacks a lot of features.

Kiro https://github.com/rhysd/kiro-editor: Kiro is an amazing text editor written in Rust and adds features such as Unicode support, a nicer colour scheme and small things like resizing and it is a very inspiring editor. Ox took the ideas for the improvements from Kiro, however implemented them differently. Kiro’s source code also seems to be quite advanced in some areas, so I decided to keep Ox as simple as I could.

Built With

Ox is super minimal and aims to use as few dependencies as possible, allowing for rapid compile time and low risk of breakage.

Getting Started

You can currently only build Ox from source. While this may sound daunting to many people, it really isn't that hard and takes 1 minute worst case scenario!

Prerequisites

Because Ox is written in Rust, you must have a modern and working version of rustc and cargo.

On Arch Linux, you can run this command:

sudo pacman -S rustup
rustup toolchain install stable

If you are not using Arch, you can easily set it up on other distros by running the distro-neutral command:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
/usr/bin/rustup toolchain install stable

You must have curl installed in order to run this command.

Installation

Icons

Ox uses NerdFonts to display icons. You can install nerdfonts from https://nerdfonts.com If you use Arch Linux, you can install it by installing the package ttf-nerd-fonts-symbols-mono. There is a potential that you will need to add it to your terminal emulator.

Manual

cargo install --git https://github.com/curlpipe/ox

Arch Linux

Install ox-bin or ox-git from the Arch User Repository.

That's all there is to it!

Fedora/CentOS

Install ox from the COPR Repository:

sudo dnf copr enable atim/ox -y
sudo dnf install ox

Homebrew

Install ox from Homebrew core tap.

brew install ox

MacPorts

On macOS, you can install ox via MacPorts

sudo port selfupdate
sudo port install ox

Usage

Opening files in Ox

At the moment, you can open ox by using the command

ox

This will open up an empty document.

If you wish to open a file straight from the command line, you can run

ox /path/to/file

To open and edit a file.

You can also open a file from within Ox by using the Ctrl + O Key binding

If at any time, you wish to create a new file, you can use Ctrl + N to do so.

You can find more command line options for Ox by typing:

ox --help

Moving the cursor around

You can use the arrow keys to move the cursor around

You can also use:

  • PageUp - Go to the top of the document
  • PageDown - Go to the bottom of the document
  • Home - Go to the start of the current line
  • End - Go to the end of the current line

Editing the file

You can use the keys Backspace and Return / Enter as well as all the characters on your keyboard to edit files!

Ox is controlled via your keyboard shortcuts. Here are the default shortcuts that you can use:

Keybinding What it does
Ctrl + Q Exits the current tab or the editor if only one tab open.
Ctrl + S Saves the open file to the disk.
Alt + S Prompts you for a file name and saves it to disk as that file name.
Ctrl + W Saves all the currently open files to the disk.
Ctrl + N Creates a new tab with a blank document.
Ctrl + O Prompts you for a file and opens that file in a new tab.
Ctrl + F Searches the document for a search query. Allows pressing of and to move the cursor to the previous occurance fof the query and and to move to the next occurance of the query. Press Return to cancel the search at the current cursor position or Esc to cancel the search and return to the initial location of the cursor. Note: this allows you to use regular expressions.
Ctrl + Z Undoes your last action. The changes are committed to the undo stack every time you press the space bar, create / destroy a new line and when there is no activity after a certain period of time which can be used to capture points where you pause for thought or grab a coffee etc...
Ctrl + Y Redoes your last action. The changes are committed to the undo stack every time you press the space bar, create / destroy a new line and when there is no activity after a certain period of time which can be used to capture points where you pause for thought or grab a coffee etc...
Ctrl + R Allows replacing of occurances in the document. Uses the same keybindings as the search feature: and to move the cursor to the previous occurance fof the query and and to move to the next occurance of the query. You can also press Return, y or Space to carry out the replace action. To exit replace mode once you're finished, you can press Esc to cancel and return back to your initial cursor position. Note: this allows you to use regular expressions.
Ctrl + A Carries out a batch replace option. It will prompt you for a target to replace and what you want to replace it with and will then replace every occurance in the document. Note: this allows you to use regular expressions.
Ctrl + Left Navigates to the previous tab.
Ctrl + Right Navigates to the next tab.
Alt + A Focuses the command line.

Configuring Ox

Ox features a configuration system that allows modification and personalization of the editor.

By default, Ox will look for a file here: $XDG_CONFIG_HOME/ox/ox.ron or ~/.config/ox/ox.ron.

Ox's configuration language is RON.

There is a default config in the 'config' folder. You will have to either download it and place it in the default config directory or create your own using the example ones as a reference. If you don't have a config file, don't worry :), Ox will just ignore it if you don't have one.

If you wish to specify the configuration file path, you can do so using the '--config' option (or '-c' if you prefer). For Example:

ox --config /path/to/my_config.ron file_to_edit.txt

Roadmap

You can see the tasks.todo.md file to see my full plans for the future of the editor!

Here is the current summary

  • Initial Research (0.1.0, 0.1.1) [741 lines]
  • Basic editing functions (0.2.0)
  • Line numbers (0.2.0)
  • Searching (0.2.0) [1040 lines]
  • Undo and Redo (0.2.1) [1282 lines]
  • Input bug (0.2.2) [1278 lines]
  • Good command line interface (0.2.3)
  • Config files (0.2.3)
  • Replacing text (0.2.3) [1549 lines]
  • Syntax highlighting (0.2.4) [1894 lines]
  • Tabs for multitasking (0.2.5) [2050 lines]
  • Macros (0.2.6) [3414 lines]
  • Tweaks (0.2.7) [3241 lines]
  • Mouse support (0.2.8)
  • Auto indentation (0.3.0)
  • Prettifier / Automatic code formatter (0.3.0)
  • Built In linter (0.3.0)
  • Auto brackets (0.3.1)
  • Auto complete (0.3.2)
  • File tree (0.3.4)
  • Start page (0.3.5)

License

Distributed under the GNU GPLv2 License. See LICENSE for more information.

Contact

You can contact me on Discord at curlpipe#1496. I'll be happy to answer any questions you may have!

Acknowledgements

You might also like...
Ask ChatGPT for a shell script, code, or anything, directly from your terminal 🤖🧠👨‍💻
Ask ChatGPT for a shell script, code, or anything, directly from your terminal 🤖🧠👨‍💻

ShellGPT Ask ChatGPT for a shell script, code, or anything, directly from your terminal 🤖 🧠 👨‍💻 Demo Install The binary is named gpt when installe

CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a plotable format.

Lighthouse Aggregator CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" f

Librarian runs pre-configured commands against a group of files that match a set of filters

Filesystem Librarian Librarian runs pre-configured commands against a group of files that match a set of filters. The group of files is called a libra

ABQ is a universal test runner that runs test suites in parallel. It’s the best tool for splitting test suites into parallel jobs locally or on CI

🌐 abq.build   🐦 @rwx_research   💬 discord   📚 documentation ABQ is a universal test runner that runs test suites in parallel. It’s the best tool f

Pure Rust Fault Proof Program that runs the rollup state-transition to verify an L2 output from L1 inputs.

palmtop palmtop is a fault proof program that runs the rollup state transition to verify an L2 output from L1 inputs. The verifiable L2 output can the

A PAM module that runs multiple other PAM modules in parallel, succeeding as long as one of them succeeds.

PAM Any A PAM module that runs multiple other PAM modules in parallel, succeeding as long as one of them succeeds. Development I created a VM to test

Print your git contributions in your terminal, blazingly fast
Print your git contributions in your terminal, blazingly fast

Takoyaki Blazingly fast git contribution graph in your terminal Features ✔️ Customizable ✔️ Plugins to support a bunch of cloud based git repositories

Get your github contributions right in your terminal, blazingly fast!
Get your github contributions right in your terminal, blazingly fast!

GitColorScripts Get your github contributions right in your terminal! Installation Install via yay yay -S gitcolorscripts Install manually Download t

languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments!
languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments!

languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments! Overview Install MacO

Owner
null
Simple system monitoring app that runs on terminal. Made purely with Rust.

What is it? RCTOP is a simple WIP system monitoring app that runs purely on terminal and doesn't feature GUI. One can compare it to htop, but more str

Niko Huuskonen 7 Oct 14, 2022
Use Thunk to build your Rust program that runs on old Windows platforms, support Windows XP and more!

Use Thunk to build your Rust program that runs on old platforms. Thunk uses VC-LTL5 and YY-Thunks to build programs that support old platforms. So, ho

null 6 May 21, 2023
Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Tim Oram 1.2k Jan 2, 2023
A performant terminal-based project editor with extensive shortcuts

omega A performant and extensive terminal-based project editor with a wide variety of modern shortcuts. How to use omega [path] This section will guid

Nils Wrenger 3 Mar 31, 2024
ask.sh: AI terminal assistant that can read and write your terminal directly!

ask.sh: AI terminal assistant that read from & write to your terminal ask.sh is an AI terminal assistant based on OpenAI APIs such as GPT-3.5/4! What'

hmirin 5 Jun 20, 2023
A standalone code editor with syntax highlighting and themes.

CodeEditor A standalone code (and text) editor for people like me who write their own user interfaces utilizing crates like pixels. CodeEditor renders

Markus Moenig 8 Nov 25, 2022
Simple code editor made with Freya 🦀

Simple code editor made with Freya ?? This is a >work in progress< simple code editor that showcases how to use tree-sitter and freya together. WARNIN

Marc Espín 12 Dec 12, 2022
Move multiple files, with the power of your editor

NOTE FOR USERS THAT WANT TO TRY THIS OUT! The current code on the master branch doesn’t work as documented, as a newer more powerful interface is bein

Thomas Voss 3 Dec 22, 2022
Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp 10.4k Jan 4, 2023
The-way - A code snippets manager for your terminal.

The Way A code snippets manager for your terminal. Record and retrieve snippets you use every day, or once in a blue moon, without having to spin up a

OutOfCheeseError 254 Jan 7, 2023