Skip to content
ACTomPublic

About

TyEditor 是一个使用 **Lazarus + TyControls + ATSynEdit** 构建的多标签文本编辑器。

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

TyEditor

TyEditor

A focused, cross-platform text editor built with Lazarus/Free Pascal.

TyEditor is a native desktop text editor for Linux, Windows and macOS. It keeps the familiar habits of a classic editor: tabs, sessions, encodings, search, macros, bookmarks and syntax highlighting. It is deliberately not an IDE — there is no LSP, terminal, debugger, project workspace, Git integration or code intelligence.

English · 简体中文

TyEditor screenshot

Highlights

  • Native and fast — Lazarus/LCL with TyControls; Linux uses Qt6, Windows uses the native Win32 widgetset, macOS uses Cocoa.
  • Your work survives restarts — restores tabs, carets, selections, scroll positions, encoding/EOL, language, bookmarks and folding; unsaved buffers are backed up and crash recovery is offered on the next launch.
  • Encoding-aware — UTF-8/16/32 with BOM detection, ANSI code pages, GBK, Big5, Shift-JIS, EUC-KR and more; convert or reload from the status bar.
  • Search that stays responsive — find/replace with regex, case, whole-word and selection modes; asynchronous find/replace in files with progress, cancellation and export.
  • A text editor’s editing model — multi-caret and column editing, line operations, comment toggle, bracket matching, macros and bookmarks.
  • 58 built-in syntax lexers — 19 EControl lexers plus 39 TyEditor language definitions, selected automatically by extension. Highlighting is lexical: keywords, types, constants, strings, comments, numbers and operators.
  • Installable plugins v1 — .typlugin packages with their own manifest, commands, options and translations. Process and PascalScript runtimes share a JSON request/response boundary; install, enable, reload and uninstall from the plugin manager.
  • External tools — configure your own commands under Tools > Manage Tools.... Tools receive the selection or document on standard input, write to standard output, support placeholders such as ${file} and ${line}, and run in the background with cancellation and timeout. They stay separate from plugins.
  • Readable for long sessions — seven editor color schemes with light/dark palettes, TyControls interface themes, minimap/micromap, line numbers, ruler, whitespace display and a read-only document map (F8).
  • Printing and customization — print preview, optional selection printing, syntax-colored output, page margins, header/footer and line numbers. A redesigned Preferences dialog and a Keyboard Shortcuts editor make the editor configurable without editing JSON.
  • Desktop integration — single-instance command-line opening, drag and drop, Linux desktop entry, Windows installer with optional .txt association, and a macOS app bundle.

Quick start

Build from source

You need Lazarus with FPC, TyControls, ATSynEdit, ATSynEdit_Ex, EControl, EncConv, Printer4Lazarus and the PascalScript component package. On Linux, install the Qt6 development libraries as well.

git clone https://github.com/ACTom/TyEditor.git
cd TyEditor
cp scripts/env.example.sh scripts/env.local.sh
# Edit scripts/env.local.sh for your lazbuild, TyControls and CCR paths.
./scripts/build.sh

The default target is Linux x86_64 with Qt6, and the binary is written to dist/linux-x86_64/TyEditor. Other targets include linux-aarch64, win32, win64, macos (Intel x86_64 and Apple Silicon arm64), macos-x86_64, macos-aarch64 and all.

See Building and installing for the full setup, cross-compilation notes and packaging commands.

Run

dist/linux-x86_64/TyEditor
dist/linux-x86_64/TyEditor file1.txt file2.md

On first launch TyEditor creates its settings and session directory:

Platform Configuration directory
Linux ~/.config/TyEditor/
Windows %APPDATA%\TyEditor\
macOS ~/Library/Application Support/TyEditor/

Documentation

Guide What it covers
Installing and building Dependencies, build targets, packaging and desktop installation
Using TyEditor Sessions, encodings, search, editing, views and settings
Languages and syntax All built-in lexers, extensions and limitations
Plugins Installing, using and writing plugins
External tools Configuring commands that operate on the current document
Keyboard shortcuts Menu shortcuts and common editing keys
Architecture Source layout and extension points
Build and release workflow Script flow, cross builds and release checks
Plugin protocol Package format, manifest, runtimes and JSON protocol
Testing Automated tests and manual acceptance checklist
Roadmap Current scope and planned work

Plugins

TyEditor v1 plugins are installable .typlugin packages: ZIP archives with a root plugin.json, optional locales/ translations and the plugin's scripts or executables. Packages declare their own ID, version, editor/platform compatibility, runtime, permissions, commands and options. User plugins override bundled plugins with the same ID.

Bundled samples live in data/plugins/:

  • Base64 Tools — encode or decode the current selection.
  • Text Tools — uppercase, lowercase, title case, or trim trailing spaces.
  • Caesar Cipher — demo encryption/decryption (shift 3, not secure).
  • JSON Formatter — format or minify JSON with indent/sort options.

The four samples use the embedded PascalScript runtime, so they work on every supported platform without an external interpreter. For running an external formatter such as clang-format, configure it under Tools > Manage Tools... instead of installing a plugin.

Use Plugins > Manage Plugins... to install a package, enable or disable it, reload, open the user plugin directory or uninstall it. The manager keeps state in plugins.json; incompatible packages remain visible but disabled with a reason. Plugins run in the background; process plugins also have a timeout and captured stderr, and every plugin can be cancelled. Each package owns its translations, resolved through exact locale, base language, default locale and English.

Read docs/user/plugins.md to install and use plugins, or docs/dev/PLUGIN_PROTOCOL.md to build one.

External tools

External tools are plain commands you configure yourself; they are not plugins and are not installed from .typlugin packages. Open Tools > Manage Tools... to add a command, choose what it receives on standard input (nothing, the selection or the whole document), choose where its output goes, and set a timeout. Arguments are one per line and never go through a shell. Placeholders such as ${file}, ${dir}, ${line}, ${col}, ${lexer} and ${inputfile} connect the command to the current document.

Enabled tools appear directly in the Tools menu. Execution runs in the background with a Cancel button; non-zero exit codes, timeouts and missing commands are reported with their standard error output. Definitions are stored in tools.json in the configuration directory.

Read docs/user/tools.md for every option and examples.

Scope

TyEditor focuses on being a good text editor:

  • No language server, completion engine or diagnostics panel.
  • No integrated terminal, debugger or project task runner.
  • No project/workspace model or Git integration.
  • No editable split view; F8 opens a read-only document map only.

License

TyEditor is licensed under the Apache License 2.0. Third-party components and data remain under their own licenses; see THIRD_PARTY_NOTICES.md and NOTICE.

About

TyEditor 是一个使用 **Lazarus + TyControls + ATSynEdit** 构建的多标签文本编辑器。

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages