emetos

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT

README

Emetos

Emetos is a code editor in the spirit of Visual Studio Code, written in Go for the Linux desktop. Its interface is built on Glutter, a GUI toolkit for Go with Flutter's framework API. It is one Go binary: no Electron, no Node.js and no cgo.

It follows VS Code where VS Code has the behavior: the same settings, command ids, color themes, TextMate grammars, snippet files, settings.json and keybindings.json formats, and VS Code's Linux keyboard shortcuts, so a VS Code user finds their way. Language features (completion, diagnostics and so on) will come from language servers, and debugging from debug adapters, so the editor itself stays language-agnostic. They are not built yet (see Status).

A Go file open with the Explorer, tabs, breadcrumbs, the minimap and the status bar

Status

Version 0.1.0: the first release of areas 1 and 2 of the specification, the editor and the workbench. What is built, row by row, is in the coverage table, with what is partial.

Planned, not built: language intelligence through LSP (completion, hover, diagnostics, go to definition), project-wide search and replace, source control, run and debug, the integrated terminal, tasks, remote development, and extensions (compiled into Emetos). The Problems panel exists, but nothing reports problems until language servers do.

Install

Emetos needs Go 1.27 to build. Users install a release build (Glutter's debug builds are several times slower in the framework):

go install -tags glutter_release github.com/rm4n0s/emetos/cmd/emetos@latest

The program is put in $(go env GOBIN), or $(go env GOPATH)/bin when GOBIN is not set (~/go/bin by default). Put that folder in your PATH. From a checkout, go install -tags glutter_release ./cmd/emetos does the same, and go build -tags glutter_release ./cmd/emetos makes the binary in the current folder. CGO_ENABLED=0 go build ./... always works: there is no C code.

emetos --version prints the version, the Go version and the platform.

Requirements
  • Linux with a Wayland or X11 session.
  • Vulkan or OpenGL ES 3.0 (Glutter uses Vulkan and falls back to OpenGL ES).
  • fontconfig, and a monospace font: the editor uses the desktop's monospace font and the workbench its UI font. Emetos bundles only its icon fonts.
  • Optional: xdg-desktop-portal (with a backend for your desktop) for the Open Folder, Open File and Save As dialogs and for opening links. Without it, Emetos asks for the path in its own input box.
  • Optional, for the tray icon: a StatusNotifier host. KDE Plasma and most panels have one. GNOME shows no tray icons by itself: install the AppIndicator extension (for example "AppIndicator and KStatusNotifierItem Support"). Without a tray, the close button of the window quits Emetos instead of hiding it.
Launcher entry and icon

scripts/install-desktop.sh makes Emetos appear in your application menu and launcher, with its icon. Run it from a checkout of this repository, after installing the program:

scripts/install-desktop.sh             # install
scripts/install-desktop.sh --uninstall # remove

It writes only two things under ${XDG_DATA_HOME:-~/.local/share}: applications/dev.emetos.Emetos.desktop (the entry: Exec=emetos %F, text files and folders as its types) and the icon in every size of assets/icons as icons/hicolor/<N>x<N>/apps/dev.emetos.Emetos.png. It puts the absolute path of emetos in the entry, because a launcher often does not have ~/go/bin in its PATH (--exec <path> says which program). It runs update-desktop-database and gtk-update-icon-cache when they are installed.

Features

The feature list of SPEC §3.1 and §3.2, in short.

Editor

  • Editing: typing, auto-indent and indentation rules of each language, auto-closing and surrounding brackets and quotes, word and word-part deletion, overtype mode (Insert key), indentation detection, tab size and spaces or tabs per file.
  • Line commands: move, copy, delete, insert, join, transpose, sort, trim trailing whitespace, change case, line and block comments.
  • Multiple cursors (Alt+Click, add next occurrence with Ctrl+D, select all occurrences, column selection), expand and shrink selection, cursor undo, the primary selection of X11 and Wayland.
  • Find and replace with regular expressions, match case, whole word, find in selection and preserve case.
  • Syntax highlighting with TextMate grammars and VS Code's color themes, for Go, JSON, YAML, Markdown, Python, JavaScript, TypeScript, HTML, CSS, SCSS, Less, XML, SQL, shell, Makefile, Dockerfile, INI, C, C++, Rust, diff, git files and Go module files.
  • Bracket matching, bracket pair colorization and guides, indent guides, folding (by indentation and #region), minimap, sticky scroll, breadcrumbs.
  • Snippets in VS Code's syntax (your own files, tab-completion) and Emmet abbreviations for HTML and CSS.
  • Diff editor (side by side and inline, with character-level changes) and a three-way merge editor with accept incoming, current or both, usable from git through --diff, --merge and --wait.
  • Encodings, LF and CRLF line endings, byte order marks, read-only files, files that change on disk, large files (a 200 MB file opens in seconds), and binary files (refused with a notice).
  • Save, Save As, Save All, auto save, hot exit (unsaved changes, also of untitled files, come back after a restart or a crash), and an undo history per document.

Workbench

  • Menus, activity bar, side bar, editor area, panel and status bar; each can be hidden and the sizes are remembered. Zen mode, full screen, zoom and a centered layout.
  • Editor groups in a grid (split in any direction, move and copy editors, maximize), tabs with preview, pinned and dirty editors, drag and drop, and Ctrl+Tab to switch editors.
  • Explorer with file watching, files.exclude, new, rename, delete to the trash, cut, copy, paste, drag and drop (also from your file manager), and an Open Editors section.
  • Command palette (Ctrl+Shift+P), quick open (Ctrl+P) with fuzzy search, go to line (Ctrl+G), back and forward through your edit locations, reopen closed editor.
  • Notifications, and the Output and Problems panels.
  • Color themes (the six VS Code defaults, your own in themes/, and following the desktop's dark or light mode) and the Seti file icon theme.
  • A settings editor (Ctrl+,) and a keyboard shortcuts editor (Ctrl+K Ctrl+S), both editing the JSON files and keeping your comments, and profiles (named sets of settings, keybindings and snippets).
  • The window comes back as you left it: layout, editors with their cursors, scroll positions and folds, and the open folders.

One window, workspace tabs and the tray

Emetos has one window. Every folder you open is a workspace tab in the strip at the top of the window (the folder name, a dot when it has unsaved changes, and a close button). Tabs switch with Ctrl+Alt+PageUp and Ctrl+Alt+PageDown, Ctrl+Alt+1 to 9, or a picker, and can be dragged to a new order. Tabs that are not shown keep running (their files, watchers and auto save).

emetos <folder> reaches the running Emetos and opens or focuses that folder's tab. When the window's close button is pressed and a tray is available, the window hides to the tray icon and Emetos keeps running; click the icon to bring it back, or use its menu to choose a tab, open a folder, or quit (window.closeToTray turns this off). The tabs, their editors and the window come back when you start Emetos again.

Three workspace tabs in the strip at the top of the window

The picker that switches between workspace tabs

Command line

emetos [options] [folder] [file...]

A folder opens as a workspace tab and files open in the active tab. When Emetos is already running, the arguments are handed to it and the command ends.

Option Meaning
-g, --goto file:line[:col] open the file with the cursor at the line (and column); may be repeated
-d, --diff a b compare two files
-m, --merge p1 p2 base result merge two versions of a file with their base into the result
-w, --wait end only when the opened files (or the diff or merge editor) are closed, for git commit
-n, --new-window open in a new tab
-r, --reuse-window open in the existing tab
--profile name use the profile (made empty when it does not exist)
--log level log level: debug, info, warn or error (default info)
-v, --version print the version and exit
-h, --help print the help and exit

Use -- before a path that starts with a dash. The exit status is 0 on success, 1 on failure and 2 for a wrong command line.

Where things are

Emetos follows the XDG base directories. $XDG_CONFIG_HOME is ~/.config and $XDG_STATE_HOME is ~/.local/state unless you set them.

What Where
User settings $XDG_CONFIG_HOME/emetos/settings.json
Keybindings $XDG_CONFIG_HOME/emetos/keybindings.json
Snippets $XDG_CONFIG_HOME/emetos/snippets/ (<language>.json and *.code-snippets)
Color themes (VS Code's JSON or .tmTheme) $XDG_CONFIG_HOME/emetos/themes/
Workspace settings <folder>/.emetos/settings.json (Emetos does not read .vscode/)
Other profiles $XDG_CONFIG_HOME/emetos/profiles/<name>/ (the same files)
Window state, recent lists, backups of unsaved work, logs $XDG_STATE_HOME/emetos/
Trash (deleted files) $XDG_DATA_HOME/Trash (the freedesktop.org home trash)
Socket of the running instance $XDG_RUNTIME_DIR/emetos-<uid>.sock

The files are JSON with comments, in VS Code's formats. "Preferences: Open User Settings (JSON)" and "Open Keyboard Shortcuts (JSON)" open them in Emetos.

Privacy

Emetos sends nothing about you anywhere: no telemetry, no crash reports and no update checks. It uses the network only for what you ask of a feature. Logs stay on your disk ($XDG_STATE_HOME/emetos/logs) and are shown in the Output panel. A link in a notification opens in your browser only when you click it.

Screenshots

Made by scripts/proof.sh in a headless compositor, from the fixtures in testdata/screenshots/ (scripts/screenshots.sh makes them again).

The side by side diff editor

The merge editor with the incoming and current sides over the result

The settings editor with a search

Development

CLAUDE.md has the conventions and the checks, docs/SPEC.md is the specification, docs/IMPLEMENTATION.md the step-by-step plan, docs/IMPLEMENTED.md the log of finished steps, and docs/PERFORMANCE.md the measurements. In short:

go build ./...                  # build (CGO_ENABLED=0 works)
go test -race ./...             # tests; no display or GPU needed
go vet ./... && golangci-lint run
scripts/fetch-reference.sh      # the pinned VS Code sources used for porting (git-ignored)

License

Emetos is released under the MIT License (LICENSE). It bundles and ports material from other projects, notably Visual Studio Code (grammars, themes, the Seti icons and ported code, MIT), the Codicons icon font (CC BY 4.0: "Codicons by Microsoft Corporation, licensed under CC BY 4.0"), Emmet, vscode-textmate and vscode-go (MIT). NOTICE lists every asset with its license, and the license texts are in third_party/.

Directories

Path Synopsis
assets
icons
Package icons holds the pictures of the application icon (SPEC §10.14, §17) and embeds them in the program.
Package icons holds the pictures of the application icon (SPEC §10.14, §17) and embeds them in the program.
cmd
emetos command
Command emetos is a code editor in the spirit of Visual Studio Code, built on the Glutter GUI toolkit (SPEC §1).
Command emetos is a code editor in the spirit of Visual Studio Code, built on the Glutter GUI toolkit (SPEC §1).
internal
archtest
Package archtest checks the package boundaries and the forbidden imports of SPEC §5.3: the editor core never imports Glutter or the GUI, no cgo, and errors go through github.com/rm4n0s/errors, built where the failure happens and never in a helper (SPEC §5.3 and §13).
Package archtest checks the package boundaries and the forbidden imports of SPEC §5.3: the editor core never imports Glutter or the GUI, no cgo, and errors go through github.com/rm4n0s/errors, built where the failure happens and never in a helper (SPEC §5.3 and §13).
archtest/cmd/errortags command
Command errortags lists the error Tags of the repository, and the Tags that no test asserts.
Command errortags lists the error Tags of the repository, and the Tags that no test asserts.
core/autoclose
Package autoclose holds what the editor needs to know of the auto-closing pairs, the surrounding pairs and the "auto close before" characters of a language, and the values of the settings that control them (SPEC §8.6.4).
Package autoclose holds what the editor needs to know of the auto-closing pairs, the surrounding pairs and the "auto close before" characters of a language, and the values of the settings that control them (SPEC §8.6.4).
core/brackets
Package brackets finds bracket pairs, matches them and numbers their nesting for colorization (SPEC §8.5).
Package brackets finds bracket pairs, matches them and numbers their nesting for colorization (SPEC §8.5).
core/buffer
Package buffer holds the piece tree text buffer, immutable snapshots, positions and the line index (SPEC §6.1, §6.2).
Package buffer holds the piece tree text buffer, immutable snapshots, positions and the line index (SPEC §6.1, §6.2).
core/command
Package command holds the command registry (SPEC §11.2).
Package command holds the command registry (SPEC §11.2).
core/comment
Package comment holds the comment tokens of the languages (SPEC §8.6.5): what the commands that comment and uncomment lines need to know of a language.
Package comment holds the comment tokens of the languages (SPEC §8.6.5): what the commands that comment and uncomment lines need to know of a language.
core/contextkey
Package contextkey holds context keys and evaluates when-clause expressions (SPEC §11.2).
Package contextkey holds context keys and evaluates when-clause expressions (SPEC §11.2).
core/diff
Package diff computes line and character diffs and holds the three-way merge model (SPEC §9.11).
Package diff computes line and character diffs and holds the three-way merge model (SPEC §9.11).
core/document
Package document holds documents: a buffer with metadata, undo and decorations (SPEC §7.1).
Package document holds documents: a buffer with metadata, undo and decorations (SPEC §7.1).
core/edit
Package edit holds visual columns, text boundaries, cursors, cursor movement and the editing commands (SPEC §6.2, §7.2).
Package edit holds visual columns, text boundaries, cursors, cursor movement and the editing commands (SPEC §6.2, §7.2).
core/editorgroup
Package editorgroup holds editor inputs, editor groups and their grid, as data (SPEC §10.3).
Package editorgroup holds editor inputs, editor groups and their grid, as data (SPEC §10.3).
core/emmet
Package emmet expands Emmet abbreviations (SPEC §9.10).
Package emmet expands Emmet abbreviations (SPEC §9.10).
core/fileio
Package fileio reads and writes files: encodings, line endings, atomic saves and the trash (SPEC §6.3).
Package fileio reads and writes files: encodings, line endings, atomic saves and the trash (SPEC §6.3).
core/find
Package find holds the find and replace model (SPEC §9.8): the search of a text for a string or a regular expression (query.go, ported from VS Code's textModelSearch.ts), the replace pattern (replace.go), the state of the find widget (state.go), the decorations that mark the matches (decorations.go) and the model that moves to and replaces matches in an editor (model.go).
Package find holds the find and replace model (SPEC §9.8): the search of a text for a string or a regular expression (query.go, ported from VS Code's textModelSearch.ts), the replace pattern (replace.go), the state of the find widget (state.go), the decorations that mark the matches (decorations.go) and the model that moves to and replaces matches in an editor (model.go).
core/folding
Package folding computes folding ranges and holds the folding model (SPEC §8.7).
Package folding computes folding ranges and holds the folding model (SPEC §8.7).
core/fuzzy
Package fuzzy matches and scores strings fuzzily (SPEC §10.6).
Package fuzzy matches and scores strings fuzzily (SPEC §10.6).
core/glob
Package glob matches VS Code glob patterns and .gitignore files (SPEC §10.5, §10.6).
Package glob matches VS Code glob patterns and .gitignore files (SPEC §10.5, §10.6).
core/indent
Package indent holds indentation detection, indentation rules and on-enter rules (SPEC §8.6).
Package indent holds indentation detection, indentation rules and on-enter rules (SPEC §8.6).
core/indent/indenttest
Package indenttest holds what the tests of the indentation need: the language configurations of VS Code's tests of indentation (JavaScript, Ruby, PHP, Go, C++, HTML, Visual Basic, LaTeX and Lua) and a text with the tokens a test gives it.
Package indenttest holds what the tests of the indentation need: the language configurations of VS Code's tests of indentation (JavaScript, Ruby, PHP, Go, C++, HTML, Visual Basic, LaTeX and Lua) and a text with the tokens a test gives it.
core/ipc
Package ipc hands the command line of a second launch over to the running instance through a Unix socket (SPEC §10.11).
Package ipc hands the command line of a second launch over to the running instance through a Unix socket (SPEC §10.11).
core/jsonc
Package jsonc parses JSON with comments and edits it while keeping the comments (SPEC §11.1).
Package jsonc parses JSON with comments and edits it while keeping the comments (SPEC §11.1).
core/keybinding
Package keybinding holds keys, the keymap, chords and the keybinding resolver (SPEC §11.3).
Package keybinding holds keys, the keymap, chords and the keybinding resolver (SPEC §11.3).
core/language
Package language holds the language registry, language configurations and the bundled grammar assets (SPEC §8.1).
Package language holds the language registry, language configurations and the bundled grammar assets (SPEC §8.1).
core/language/internal/plist2json command
Command plist2json converts a TextMate grammar in the XML property list format to the JSON format that the grammar loader reads (SPEC §8.1).
Command plist2json converts a TextMate grammar in the XML property list format to the JSON format that the grammar loader reads (SPEC §8.1).
core/logs
Package logs writes the log files and keeps the log channels shown in the Output panel (SPEC §13).
Package logs writes the log files and keeps the log channels shown in the Output panel (SPEC §13).
core/notify
Package notify holds the notification model (SPEC §10.7).
Package notify holds the notification model (SPEC §10.7).
core/plist
Package plist reads XML property lists, the format of TextMate themes (.tmTheme) and of some grammars.
Package plist reads XML property lists, the format of TextMate themes (.tmTheme) and of some grammars.
core/regex
Package regex compiles Oniguruma-style regular expressions for grammars, and ECMAScript-mode expressions for find (SPEC §8.2).
Package regex compiles Oniguruma-style regular expressions for grammars, and ECMAScript-mode expressions for find (SPEC §8.2).
core/settings
Package settings holds the settings registry, its layers and change events (SPEC §11.1).
Package settings holds the settings registry, its layers and change events (SPEC §11.1).
core/snippet
Package snippet parses snippets and runs snippet sessions (SPEC §9.9).
Package snippet parses snippets and runs snippet sessions (SPEC §9.9).
core/storage
Package storage holds the XDG paths, UI state, backups and profiles (SPEC §10.10, §10.12).
Package storage holds the XDG paths, UI state, backups and profiles (SPEC §10.10, §10.12).
core/storage/storagetest
Package storagetest isolates tests from the real user folders (SPEC §15.1).
Package storagetest isolates tests from the real user folders (SPEC §15.1).
core/textmate
Package textmate loads TextMate grammars and tokenizes lines (SPEC §8.3).
Package textmate loads TextMate grammars and tokenizes lines (SPEC §8.3).
core/theme
Package theme holds color themes, token colors and the workbench color registry (SPEC §8.4).
Package theme holds color themes, token colors and the workbench color registry (SPEC §8.4).
core/tokens
Package tokens keeps the tokenization state of documents and runs the background tokenizer (SPEC §8.3).
Package tokens keeps the tokenization state of documents and runs the background tokenizer (SPEC §8.3).
core/vstest
Package vstest holds test helpers that convert VS Code's 1-based UTF-16 positions to Emetos positions (SPEC §15.1).
Package vstest holds test helpers that convert VS Code's 1-based UTF-16 positions to Emetos positions (SPEC §15.1).
core/workspace
Package workspace holds the folder model, the file tree, the file watcher and file operations (SPEC §10.5).
Package workspace holds the folder model, the file tree, the file watcher and file operations (SPEC §10.5).
core/wrap
Package wrap computes where word wrap breaks a line into rows (SPEC §9.2): the algorithm of VS Code's monospace line breaks computer, which counts columns, for lines whose characters have the width of one or two columns, and the helpers the editor uses for the other lines, which it breaks by laying the text out.
Package wrap computes where word wrap breaks a line into rows (SPEC §9.2): the algorithm of VS Code's monospace line breaks computer, which counts columns, for lines whose characters have the width of one or two columns, and the helpers the editor uses for the other lines, which it breaks by laying the text out.
gui/app
Package app starts the application, creates the workspace tabs of its one window and wires the services (SPEC §5.1, §15.2).
Package app starts the application, creates the workspace tabs of its one window and wires the services (SPEC §5.1, §15.2).
gui/diffeditor
Package diffeditor holds the diff editor (SPEC §9.11).
Package diffeditor holds the diff editor (SPEC §9.11).
gui/editor
Package editor holds the editor widget (SPEC §9).
Package editor holds the editor widget (SPEC §9).
gui/keybindingsui
Package keybindingsui holds the keybindings editor (SPEC §11.3).
Package keybindingsui holds the keybindings editor (SPEC §11.3).
gui/kit
Package kit holds the IDE widget kit built on Glutter's widgets layer (SPEC §10.2).
Package kit holds the IDE widget kit built on Glutter's widgets layer (SPEC §10.2).
gui/kit/fonts
Package fonts bundles the icon fonts and their family names (SPEC §10.2, §10.8, D14).
Package fonts bundles the icon fonts and their family names (SPEC §10.2, §10.8, D14).
gui/kit/fonts/internal/gen command
Command gen turns codicon.csv into codicon_gen.go: one constant for the code point of each codicon, and the table of the code points by short name (SPEC §10.2).
Command gen turns codicon.csv into codicon_gen.go: one constant for the code point of each codicon, and the table of the code points by short name (SPEC §10.2).
gui/mergeeditor
Package mergeeditor holds the merge editor (SPEC §9.11): the incoming and the current side of a three-way merge on top, the result below, the conflicts outlined and the three editors scrolled together.
Package mergeeditor holds the merge editor (SPEC §9.11): the incoming and the current side of a three-way merge on top, the result below, the conflicts outlined and the three editors scrolled together.
gui/quickinput
Package quickinput holds the command palette, quick open and the pickers (SPEC §10.6).
Package quickinput holds the command palette, quick open and the pickers (SPEC §10.6).
gui/settingsui
Package settingsui holds the settings editor (SPEC §11.1): the widget that lists the registered settings by group, edits them in the user's or the workspace's settings.json through core/settings, and marks the ones the file sets.
Package settingsui holds the settings editor (SPEC §11.1): the widget that lists the registered settings by group, edits them in the user's or the workspace's settings.json through core/settings, and marks the ones the file sets.
gui/testutil
Package testutil holds widget-test helpers: test fonts, isolated paths and proof images (SPEC §15).
Package testutil holds widget-test helpers: test fonts, isolated paths and proof images (SPEC §15).
gui/views/explorer
Package explorer holds the views of the Explorer (SPEC §10.5, §10.8): the tree of the folder of the window, the Open Editors list, and the welcome content of a window that has no folder.
Package explorer holds the views of the Explorer (SPEC §10.5, §10.8): the tree of the folder of the window, the Open Editors list, and the welcome content of a window that has no folder.
gui/views/output
Package output holds the Output panel (SPEC §3.2).
Package output holds the Output panel (SPEC §3.2).
gui/views/problems
Package problems holds the Problems panel (SPEC §3.2).
Package problems holds the Problems panel (SPEC §3.2).
gui/workbench
Package workbench holds the workbench: layout parts, editor group views, the title bar row (the menu and the workspace tabs), the activity bar and the status bar (SPEC §10).
Package workbench holds the workbench: layout parts, editor group views, the title bar row (the menu and the workspace tabs), the activity bar and the status bar (SPEC §10).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL