{"id":13441817,"url":"https://github.com/arximboldi/ewig","last_synced_at":"2025-04-05T17:08:51.385Z","repository":{"id":18696451,"uuid":"85006569","full_name":"arximboldi/ewig","owner":"arximboldi","description":"The eternal text editor — Didactic Ersatz Emacs to show immutable data-structures and the single-atom architecture","archived":false,"fork":false,"pushed_at":"2022-08-17T10:26:47.000Z","size":4980,"stargazers_count":540,"open_issues_count":2,"forks_count":31,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-29T16:09:44.301Z","etag":null,"topics":["cpp","data-structures","editor","emacs","immer","immutable","text"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arximboldi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"arximboldi","patreon":"sinusoidal","custom":["paypal.me/sinusoidal","sinusoid.al"]}},"created_at":"2017-03-14T23:16:48.000Z","updated_at":"2025-02-20T06:05:01.000Z","dependencies_parsed_at":"2022-08-07T09:00:52.903Z","dependency_job_id":null,"html_url":"https://github.com/arximboldi/ewig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Fewig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Fewig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Fewig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arximboldi%2Fewig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arximboldi","download_url":"https://codeload.github.com/arximboldi/ewig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","data-structures","editor","emacs","immer","immutable","text"],"created_at":"2024-07-31T03:01:38.403Z","updated_at":"2025-04-05T17:08:51.353Z","avatar_url":"https://github.com/arximboldi.png","language":"C++","readme":"[![Build Status](https://github.com/arximboldi/zug/workflows/test/badge.svg)](https://github.com/arximboldi/zug/actions?query=workflow%3Atest+branch%3Amaster)\n\u003ca href=\"https://sinusoid.al\"\u003e\u003cimg align=\"right\" src=\"https://cdn.rawgit.com/arximboldi/immer/355a113782aedc2ea22463444014809269c2376d/doc/_static/sinusoidal-badge.svg\"\u003e\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://cdn.rawgit.com/arximboldi/ewig/36d00237/doc/logo-front.svg\"\u003e\n\u003c/p\u003e\n\n**ewig** is a simple text editor\n(an [Ersatz Emacs](https://www.emacswiki.org/emacs/ErsatzEmacs)) written\nusing [immutable data-structures](https://sinusoid.es/immer/) in C++.\n\nThe code is written in a simple style to showcase a value-based\nfunctional architecture.  We invite you to\n[study the code](https://github.com/arximboldi/ewig/tree/master/src/ewig).\nLearn more in the **CppCon'17 Talk**:\n_[Postmodern Immutable Data Structures](https://www.youtube.com/watch?v=sPhpelUfu8Q)_.\n\n\u003e \u003ca href=\"https://www.patreon.com/sinusoidal\"\u003e\n\u003e     \u003cimg align=\"right\" src=\"https://cdn.rawgit.com/arximboldi/immer/master/doc/_static/patreon.svg\"\u003e\n\u003e \u003c/a\u003e\n\u003e\n\u003e This project is part of a long-term vision helping interactive and\n\u003e concurrent C++ programs become easier to write. **Help this project's\n\u003e long term sustainability by becoming a patron or buying a\n\u003e sponsorship package:** juanpe@sinusoid.al\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://asciinema.org/a/135452\"\u003e\n    \u003cimg src=\"https://cdn.rawgit.com/arximboldi/ewig/d32b8a391c4a9f788175bf982bbdc5150d3f5a96/doc/ewig.gif\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nTry it out\n----------\n\nIf you are using the [Nix package manager](https://nixos.org/nix) (we\nstrongly recommend it) you can just install the software with.\n```\n    nix-env -if https://github.com/arximboldi/ewig/archive/master.tar.gz\n```\n\nDevelopment\n-----------\n\nTo build the code you need a C++17 compiler, `cmake`, and `ncurses`\nwith unicode support (package `libncursesw5-dev` in Debian and\nfriends).\n\nYou can install those manually, but the easiest way to get a\ndevelopment environment up and running is by using\nthe [Nix package manager](https://nixos.org/nix).  At the root of the\nrepository just type:\n```\n    nix-shell\n```\nThis will download all required dependencies and create an isolated\nenvironment in which you can use these dependencies, without polluting\nyour system.\n\nThen you can **generate a development** project using [CMake](https://cmake.org/).\n```\n    mkdir build \u0026\u0026 cd build\n    cmake ..\n```\n\nTo configure an optimized build and **compile** do:\n```\n    cmake .. -DCMAKE_BUILD_TYPE=Release\n    make\n```\n\nTo **install** the compiled software globally:\n```\n    sudo make install\n```\n\nKeybindings\n-----------\n\nExcerpt from\n[`main.cpp`](https://github.com/arximboldi/ewig/blob/master/src/ewig/main.cpp):\n```cpp\nconst auto key_map_emacs = make_key_map(\n{\n    {key::seq(key::ctrl('p')), \"move-up\"},\n    {key::seq(key::up),        \"move-up\"},\n    {key::seq(key::down),      \"move-down\"},\n    {key::seq(key::ctrl('n')), \"move-down\"},\n    {key::seq(key::ctrl('b')), \"move-left\"},\n    {key::seq(key::left),      \"move-left\"},\n    {key::seq(key::ctrl('f')), \"move-right\"},\n    {key::seq(key::right),     \"move-right\"},\n    {key::seq(key::page_down), \"page-down\"},\n    {key::seq(key::page_up),   \"page-up\"},\n    {key::seq(key::backspace), \"delete-char\"},\n    {key::seq(key::backspace_),\"delete-char\"},\n    {key::seq(key::delete_),   \"delete-char-right\"},\n    {key::seq(key::home),      \"move-beginning-of-line\"},\n    {key::seq(key::ctrl('a')), \"move-beginning-of-line\"},\n    {key::seq(key::end),       \"move-end-of-line\"},\n    {key::seq(key::ctrl('e')), \"move-end-of-line\"},\n    {key::seq(key::ctrl('i')), \"insert-tab\"}, // tab\n    {key::seq(key::ctrl('j')), \"new-line\"}, // enter\n    {key::seq(key::ctrl('k')), \"kill-line\"},\n    {key::seq(key::ctrl('w')), \"cut\"},\n    {key::seq(key::ctrl('y')), \"paste\"},\n    {key::seq(key::ctrl('@')), \"start-selection\"}, // ctrl-space\n    {key::seq(key::ctrl('_')), \"undo\"},\n    {key::seq(key::ctrl('x'), key::ctrl('C')), \"quit\"},\n    {key::seq(key::ctrl('x'), key::ctrl('S')), \"save\"},\n    {key::seq(key::ctrl('x'), 'h'), \"select-whole-buffer\"},\n    {key::seq(key::ctrl('x'), '['), \"move-beginning-buffer\"},\n    {key::seq(key::ctrl('x'), ']'), \"move-end-buffer\"},\n    {key::seq(key::alt('w')),  \"copy\"},\n});\n```\n\nLicense\n-------\n\nThis software is licensed under the\n[GPLv3 license](https://www.gnu.org/licenses/gpl-3.0.en.html).\n\n    Copyright (C) 2016 Juan Pedro Bolivar Puente\n\n    This file is part of ewig.\n\n    ewig is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    ewig is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with ewig.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n[![GPL3 Logo](https://www.gnu.org/graphics/gplv3-127x51.png)](https://www.gnu.org/licenses/gpl-3.0.en.html)\n","funding_links":["https://github.com/sponsors/arximboldi","https://patreon.com/sinusoidal","paypal.me/sinusoidal","sinusoid.al","https://www.patreon.com/sinusoidal"],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farximboldi%2Fewig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farximboldi%2Fewig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farximboldi%2Fewig/lists"}