- Rust 100%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| benches | ||
| misc | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
ZTE
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
Statefrom visual layout, allowing for variable-width chars, graphemes, collapsing of functions, wrapping, etc.
- Separate
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 matchfoodandfool
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.