Skip to main content

A sleek, powerful terminal text editor built with Textual

Project description

Axiom TUI

A terminal text editor that doesn't make you feel lame.

demo

I have an ubuntu server on my rpi5 running in my room and I kept needing to edit files on it. Nano works but it looks like it's from the 90s. I tried vim but it wasn't satisfactory using it, So I thought why not make an usable, modern tui text editor for fun? I was out of ideas and I had a weekend to spare. So I built this.

It's not trying to replace anything. It's just a small editor you can open from the terminal when you need to make a quick edit and you want it to not look terrible.

Install

You need Python 3.11+ and Textual (python lib)

Just want to try it out? Clone and run:

git clone https://github.com/adyanthm/axiom-tui.git
cd axiom-tui
pip install textual
python main.py somefile.py

Want to actually use it regularly? Install it as a command:

git clone https://github.com/adyanthm/axiom-tui.git
cd axiom-tui
pip install -e .

Now you can open files from anywhere on your system:

axiom main.py
axiom ~/.bashrc
axiom /etc/nginx/nginx.conf

Just axiom and the file path. That's it. Works from any directory.

Don't want to deal with Python at all?

Grab axiom.exe (or the Linux/Mac binary) from the releases page. No Python needed, everything is bundled inside.

To use it as a global command (so you can just type axiom file.py from anywhere):

Windows:

  1. Download axiom.exe
  2. Put it somewhere like C:\tools\
  3. Add that folder to your PATH (search "environment variables" in Start, edit the Path variable, add C:\tools\)
  4. Open a new terminal and you're good to go

Linux:

chmod +x axiom-linux
sudo mv axiom-linux /usr/local/bin/axiom

Mac:

chmod +x axiom-macos
sudo mv axiom-macos /usr/local/bin/axiom

After that, just use it like any other command:

axiom server.py
axiom ~/.bashrc
axiom config.yml

What it does

  • Syntax highlighting for Python, JS, TS, Rust, Go, C, Java, Ruby, and a bunch more.
  • File tree on the left so you can browse around without leaving the editor.
  • Search that actually jumps to the match.
  • Line numbers and a status bar with cursor position.
  • Unsaved changes indicator (little dot next to the filename).
  • Theme sync - When you switch app themes the syntax colors follow along. This one took me an embarrassingly long time to figure out because Textual's TextArea has its own theme system completely separate from the app. Fun.

Keybinds

Key Does
ctrl+s Save
ctrl+f Search (Enter to find, Esc to close)
ctrl+b Toggle file tree
ctrl+q Quit

You can also switch themes through Textual's command palette.

The Theme Thing

So here's a fun rabbit hole I fell into: Textual has app themes (like Dracula, Nord, Catppuccin etc) and the TextArea widget has its own completely separate syntax highlighting themes. When you switch the app theme, only the UI chrome changes - the actual code highlighting stays the same.

I fixed this by mapping each app theme to the closest syntax theme. It's not perfect but it works. If you switch to Dracula the syntax goes Dracula, if you pick something light it switches to GitHub Light, etc.

Stuff I might add

  • Find and replace (right now it's just find)
  • Tabs for multiple files
  • Remember last open file
  • Goto line number

No promises though. This is a weekend project that I use for myself. If it helps you too, cool.

Contributing

PRs are welcome. Just keep it simple - the whole point is that this is a small, clean codebase. If your feature doubles the line count, maybe it should be a fork instead.

License

MIT. Do whatever you want with it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

axiom_tui-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

axiom_tui-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file axiom_tui-1.0.0.tar.gz.

File metadata

  • Download URL: axiom_tui-1.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for axiom_tui-1.0.0.tar.gz
Algorithm Hash digest
SHA256 aaec0a7253c295af15e36dad583eabb34ede5e1c6f041996c9588f5834339be9
MD5 e2f2a83bbc7f5f52275c13c2f5cb8507
BLAKE2b-256 74250b8db266a9957794071323f8c3494a8af27ee192de29caafde190a60555e

See more details on using hashes here.

Provenance

The following attestation bundles were made for axiom_tui-1.0.0.tar.gz:

Publisher: release.yml on adyanthm/axiom-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file axiom_tui-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: axiom_tui-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for axiom_tui-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b100022be52143fe1a0a7b66ccfb775f53980a0830b6b99542d41414edbd7adf
MD5 a7ce1c756fa045e2253517226a46a0dd
BLAKE2b-256 06b95137d765a1e07a366edcfb03b4ba024ac9940dfbb73ad7ed8c09ef12b694

See more details on using hashes here.

Provenance

The following attestation bundles were made for axiom_tui-1.0.0-py3-none-any.whl:

Publisher: release.yml on adyanthm/axiom-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page