An extremely opinionated personal text editor https://blog.jsbarretto.com/post/text-editor
Find a file
Joshua Barretto 24e5dcbdcc
All checks were successful
Rust / loc (push) Successful in 4s
order search results alphabetically in all other cases
2026-04-13 14:29:39 +01:00
.forgejo/workflows Attempt to work around workflow trigger bug 2026-03-29 00:51:13 +00:00
benches Fixed to_pos offset bug 2026-02-22 22:15:02 +00:00
misc demo GIF 2026-03-24 21:33:27 +00:00
src order search results alphabetically in all other cases 2026-04-13 14:29:39 +01:00
.gitignore Began work on panes and buffers 2025-06-05 23:17:49 +01:00
Cargo.lock Better input handling for terminals 2026-03-09 14:48:02 +00:00
Cargo.toml Added demo graphic 2026-03-24 21:33:21 +00:00
README.md Better selection highlighting 2026-04-13 14:13:53 +01:00

ZTE

ZTE in action

About

ZTE is my personal text editor. I daily-drive it, and it fits my needs exactly. It probably doesn't fit yours, although I've made some effort to avoid it being overly obtuse to use.

There are no configuration options: everything is hard-coded. As a rule of thumb, I avoid speculative feature development: unless I feel a feature's lack of presence, I don't add it.

While the code is largely undocumented, I care about simplicity and make an effort to remove redundancy: you may find it a useful resource if you're building your own text editor.

You can learn more about its development here.

Installation

Install Cargo (Rust package manager). Your system package manager probably has it. If not, try here.

sudo cargo install --root / --git https://git.jsbarretto.com/zesterer/zte.git

You can run this command again to update your installation. sudo cargo remove zte will uninstall.

Features

  • Buffers
  • Buffer switching
  • Prompt
  • Cursor selection
  • Basic cursor movement
  • Multiple panes
  • Pane creation/deletion
  • Open
  • Save
  • Save as
  • Move
  • Find
  • File watching
  • Search in buffer switcher
  • Syntax highlighting
  • Project search (including file path search)
  • Regex search
  • Auto-indent (and related features)
  • Undo/redo
  • Ability to resize panes
  • Terminal buffers
  • Tabs
  • Mouse support
  • Delimiter matching

Todo

  • Replace
  • Git integration
  • LSP integration

Issues to fix

  • Return should only complete block if matching delim has different ident
  • URLs in terminal panes should get automatically detected
  • Implement elastic tabstops
    • Separate State from visual layout, allowing for variable-width chars, graphemes, collapsing of functions, wrapping, etc.

Keybindings

File & buffer manipulation

Buffers represent open files and are tracked independently of view panes.

Ctrl + n = New buffer
Ctrl + o = Open buffer
Ctrl + s = Save buffer
Ctrl + Shift + s = Save buffer as
Ctrl + m = Move buffer
Ctrl + b = Switch to buffer
Ctrl + q = Close buffer

Ctrl + t = New terminal pane (WIP)

Search and command prompt

Searching occurs across the repository that the current file resides in.

The command prompt provides access to more fine-grained commands.

Ctrl + Shift + o = Path search
Ctrl + Shift + f = Text search

Alt + Return = Open command prompt

Navigation & panes

Escape = Cancel current task or close editor

Alt + w = Select pane above
Alt + a = Select pane left
Alt + s = Select pane down
Alt + b = Select pane right

Alt + Shift + w = Create pane above
Alt + Shift + a = Create pane left
Alt + Shift + s = Create pane down
Alt + Shift + d = Create pane right

Alt + PageUp = Select tab above
Alt + PageDown = Select tab below

Alt + Shift + PageUp = Create tab above
Alt + Shift + PageDown = Create tab below

Alt + q = Close current pane

Alt + i = Grow current pane vertically
Alt + k = Shrink current pane vertically
Alt + l = Grow current pane horizontally
Alt + j = Shrink current pane horizontally

Editing

'Standard' non-modal editing controls apply, for the most-part

The mouse can be used to select and drag as one might expect

Ctrl + l = Go to line
Ctrl + Space = Select containing block
Ctrl + a = Select all
Ctrl + f = Open finder

PageUp = Scroll upward
PageDown = Scroll downward
Home = Scroll to top
End = Scroll to bottom

Ctrl + z = Undo
Ctrl + y = Redo
Ctrl + c = Copy
Ctrl + x = Cut
Ctrl + v = Paste
Ctrl + / = Comment line or selection
Ctrl + d = Duplicate line or selection

Search regex

When searching, a non-standard regex is supported in which:

  • Any inline whitespace matches any inline whitespace in the search
  • An inline regex expression can be included with @(...). For example, foo@([dl]) will match food and fool

Lines of code

As an experiment, I'm limiting zte to just 10,000 lines of Rust code (not including dependencies). I want to see what effect this might have on code quality.