Beta

garedit

Native Text & Code Editor

A native X11 text editor for the gar desktop suite. Built with Cairo/Pango rendering via gartk, garedit provides responsive editing with full undo/redo history, mouse-driven text selection, word-level navigation, and line number display. Designed for lightweight, fast editing that fits naturally into the gardesk environment. Control running instances via gareditctl for scripting and automation.

Features

  • Cairo/Pango text rendering via gartk
  • Full undo/redo with 512-snapshot history
  • Mouse click, drag selection, and scroll
  • Word-level cursor movement and deletion
  • Configurable line number gutter
  • UTF-8 text with CRLF/LF detection
  • Current line highlight
  • TOML configuration with CLI overrides
  • File open/save prompts with ~ expansion
  • Unsaved changes confirmation dialogs
  • IPC protocol for external control (gareditctl)
  • Consistent gartk theming with gardesk

Quick Start Guide

Get garedit running as a standalone editor or integrate it with the gar desktop environment.

1. Installation

Install garedit using the unified installer or build from source:

terminal
$ curl -fsSL https://gar.musicsian.com/install.sh | bash -s -- --component=garedit # Install via script
$ cd ~/.local/src/gardesk/garedit && cargo build --release # Or build from source

2. Opening Files

Open a file directly or start with a scratch buffer:

terminal
$ garedit /path/to/file.rs # Open a file
$ garedit # Start with scratch buffer
$ garedit --font-size 16 --tab-width 2 file.py # With overrides

3. Essential Keybindings

The most commonly used shortcuts:

Key Action
Ctrl+OOpen file
Ctrl+SSave (or save-as if no path)
Ctrl+Shift+SSave as
Ctrl+ZUndo
Ctrl+Shift+Z / Ctrl+YRedo
Ctrl+ASelect all
Ctrl+QQuit (with unsaved confirmation)
EscapeClear selection or quit

4. Integration with gar

Bind garedit to a key in your gar config:

~/.config/gar/init.lua
-- Bind garedit to Mod+E
gar.key({ gar.mod, "e", gar.spawn("garedit") })

-- Or open a specific file
gar.key({ gar.mod, "shift", "e", gar.spawn("garedit ~/.config/gar/init.lua") })

5. Control with gareditctl

Control a running garedit instance via IPC:

terminal
$ gareditctl status # Query editor status
$ gareditctl open /path/to/file.rs # Open a file
$ gareditctl open --line 42 --column 10 file.rs # Open at position
$ gareditctl quit # Close the editor

6. Configuration Priority

garedit checks configuration in this order:

  1. Command-line arguments (highest priority)
  2. ~/.config/garedit/config.toml — TOML config file
  3. Built-in defaults