{"id":13441473,"url":"https://github.com/Rezonality/zep","last_synced_at":"2025-03-20T12:30:58.106Z","repository":{"id":37392276,"uuid":"108297886","full_name":"Rezonality/zep","owner":"Rezonality","description":"Zep - An embeddable editor, with optional support for using vim keystrokes. ","archived":false,"fork":false,"pushed_at":"2024-03-23T13:08:00.000Z","size":42198,"stargazers_count":912,"open_issues_count":15,"forks_count":69,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-08-27T18:14:28.644Z","etag":null,"topics":["direct3d","editor","game-development","gap-buffer","imgui","mini-editor","notepad","opengl","qt","qt6","sdl","syntax-highlighting","text","text-editor","vim","vim-mode"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rezonality.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-10-25T16:44:25.000Z","updated_at":"2024-08-27T09:29:34.000Z","dependencies_parsed_at":"2024-03-23T14:37:11.994Z","dependency_job_id":null,"html_url":"https://github.com/Rezonality/zep","commit_stats":null,"previous_names":["cmaughan/zep"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rezonality%2Fzep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rezonality%2Fzep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rezonality%2Fzep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rezonality%2Fzep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rezonality","download_url":"https://codeload.github.com/Rezonality/zep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221760009,"owners_count":16876334,"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":["direct3d","editor","game-development","gap-buffer","imgui","mini-editor","notepad","opengl","qt","qt6","sdl","syntax-highlighting","text","text-editor","vim","vim-mode"],"created_at":"2024-07-31T03:01:34.428Z","updated_at":"2025-03-20T12:30:58.100Z","avatar_url":"https://github.com/Rezonality.png","language":"C++","readme":"[Zep](https://github.com/Rezonality/zep) - A Mini Editor\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n[![Builds](https://github.com/Rezonality/zep/workflows/Builds/badge.svg)](https://github.com/Rezonality/zep/actions?query=workflow%3ABuilds)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Resonality/zep/blob/master/LICENSE)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b14633031dfe49498719ad58ff96328a)](https://www.codacy.com/gh/Rezonality/zep/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Rezonality/zep\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/b14633031dfe49498719ad58ff96328a)](https://www.codacy.com/gh/Rezonality/zep/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=Rezonality/zep\u0026utm_campaign=Badge_Coverage)\n[![codecov](https://codecov.io/gh/Rezonality/zep/branch/master/graph/badge.svg?token=sKdLmDPcW7)](https://codecov.io/gh/Rezonality/zep)\n[![Gitter](https://badges.gitter.im/Rezonality/Zep.svg)](https://gitter.im/Rezonality/Zep?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\nZep is a simple embeddable editor, with a rendering agnostic design and optional Vim mode.  It is built as a shared modern-cmake library, using a single header include, or as a static library.  The core library is dependency-free (the demo application requires an installed package), and it is possible just to copy the files into your project and build it.  Out of the box Zep can draw to a Qt Widget or an ImGui window - useful for embedding in a game engine.  A simple syntax highlighting engine is provided, and can easily be extended. Basic theming support is included, and window tabs and vertical/horizontal splits are also available.  Zep is 'opinionated' in how it does things, but is easy to modify and supports many common features.  It is heavily influenced by Vim, but has a good notepad-style editing mode too.  A simple search feature (Ctrl+P) is a powerful way to find things, and a Repl mode is useful for implementing a console for game scripting.  Intended to eventually sit inside a live-coding environment, Zep also has a minimal mode and several configuration options which can be set in a simple toml-format file.\n\nFor an example of building Zep into a simple ImGui application, see the example project, which shows how to add Zep as a submodule and build it as a library or just include a single header file: [Integrating Zep](https://github.com/cmaughan/zep_imgui)\n\n## Video Overview\n[![Zep Overview](screenshots/video.png)](https://youtu.be/T_Kn9VzD3RE \"Zep Overview\")\n\n## Screenshot\n![ImGui](screenshots/sample.png)\n\nZep supports the standard editing keystrokes you'll find in most editors, along with a reasonable subset of modal Vim editing as an option.  The demo project lets you switch between the editing modes on the fly.  Zep is not meant to replace Vim.  I don't have a lifetime spare to write that, but it has most of the functionality I use day to day, and anything missing gets added over time.  A key-mapper enables configuration of Zep outside the standard modes offered.\n\nZep is ideally suited to embedding in a game engine, as an in-game editor, or anywhere you need a simple editor without a massive dependency on something more substantial like NeoVim.  The core library is dependency free, small, and requires only a modern C++ compiler.  Zep can be included in your project building a dependency-free modern cmake library, and setting `Zep::Zep` in `target_link_libraries`, or as a single-header include. A header-only implementation of the ImGui and Qt backends is provided as an addendum to the core library; this enables Zep to render in an ImGui or Qt environment.  After building and installing Zep on your system, only 2 lines are required in your CMakeLists to use it.  An alternative would be to just copy and build the source files for the core library into your project.\n\nThe demos for Qt and ImGui require dditional packages, but these aren't required to embed Zep in your application.  The ImGui demo builds and runs on Windows, Linux and Mac OS.  If you are a Vim user, you might often suffer the frustration of not being able to use Vim keystrokes in your tools.  Zep solves that.\n\nKey Features:\n* Modal 'vim' or modeless 'standard' editing styles; built around a common core of functionality.\n* Keymapper for extending existing modes or adding new commands\n* Qt or ImGui rendering (and extensible)\n* Terminal-style text wrapping and work in progress non-wrapped mode\n* Splits and tabs\n* A simple syntax highlighting engine with pluggable secondary highlighters\n* Theme support\n* A Repl for integrating a command/scripting language (the demo project integrates a Janet Lang interpreter - :ZRepl to get into it, try (+ 2 2))\n* CTRL+P search for quick searching files with fuzzy matching\n* Text Markers for highlighting errors, etc.\n* No dependencies, cross platform, small library, single header, static library or installed library option.\n* Builds on VC 2017, GCC 6, Clang. C++14 is the basic requirement\n\nNew Features, recently added:\n* Support for tabs instead of spaces; display of tabs as whitespace arrows.\n* UTF8 (Work in progress - not completely done yet).\n* More generic keymapping for extensible modes\n* /search support\n\nCurrent Limitations:\n* Vim mode is limited to common operations, not the extensive set of commands typical in Neovim/Vim.  There are now a considerable number of commands, but notably ex commands are missing, such as %s///g for find/replace.\n\nThough I have limited time to work on Zep, I do try to move it forward at York Developer's regular Code and Coffee sessions. Zep was my 2018 project but has already proved quite popular, and I try to throw more features in when I can.  There are over 200 unit tests for the editing modes.  This project started mainly as an experiment and a learning exercise.  I like the idea of a programmer building programmer tools for their own use, just as carpenters used to build their toolbox.\n\nOne of my targets for Zep is to get it to the point where I can use it as a standalone editor for common tasks.  It is almost equivalent to how I'd use NeoVim day-to-day.  The other target is to use Zep in a live coding environment.\n\nPull requests are appreciated and encouraged ;)\n\nScreenshots\n-----------\nLive Coding in 'Minimal' Mode:\n![LiveCoding](screenshots/livecode.png)\n\nUsing the ImGui Renderer:\n![ImGui](screenshots/sample.png)\n\nUsing the Qt Renderer:\n![Qt](screenshots/sample-qt.png)\n\nA light theme:\n![Qt](screenshots/sample-light-qt.png)\n\nEmbedded in a Live Coding tool:\n![Embedded](screenshots/jorvik.png)\n\nEmbedded in a Game Engine:\n![Embedded](screenshots/embedded.png)\n\n# Design\n## Layers\nZep is built from simple interacting layers for simplicity.\n\n### Text\nThe text layer manages manipulation of text in a single buffer.  At the bottom level, a gap buffer structure maintains the text information.\nThe buffer layer is responsible for saving and loading text, and supporting simple search and navigation within the text.  Much of the higher\nlevel mode code uses the buffer commands to move around inside the text.  A GlyphIterator is used within the buffer in order to walk along it in UTF8 code-points.\n\nA command layer supplies functions to add and remove text, and supports undo; all buffer modifications are done with these simple commands.\n\nThe Mode layer supports editing text using Vim commands, or using standard notepad-like commands.\n\nA Syntax layer monitors the buffer and provides file-specific syntax coloring. Syntax highlighting can be easily extended\n\n### Display\nTab windows are like workspaces, each containing a set of windows arranged in splits.  The window lass arranges the rendering and calls a thin\ndisplay layer to draw the text.  This makes it simple to draw the editor using different rendering code.  Adding Qt took just an hour to do.\n\n### Vim \u0026 Standard Modes\nMode plugins provide the editing facility - currently that is Vim \u0026 Standard and modes for the Repl and the Search panels.\nThe Vim mode has most of the usual word motions, visual mode, etc.  The standard mode has the usual shift, select, cut/copy/paste, etc.\nSee [Vim Mode](https://github.com/Rezonality/zep/wiki/Vim-Mode), or the top of the mode_vim.cpp file for a list of supported operations in Vim\n\n# Building\nAfter every change, Zep is built on Mac, Linux and PC.  You can see the script which does this in https://github.com/Rezonality/zep/.github/workflows/builds.yml.  You can choose to build just a library using modern CMake, or the full demo, or just include the library in a subfolder without building it at all.\n\nHere is an example of building the demo (and hence the library and tests).  The build without Qt is easier, and it is recommended as a starting point, unless you are familiar with Qt and have it already installed.\n## Add extra packages\nBelow is the minimum; your system may indicate it needs extra packages.\n### Linux\n```\nsudo apt install cmake\nsudo apt install git\n```\n### Mac\n```\nbrew install cmake\nbrew install git\n```\n## Qt\nQt is only required if you want that version of the demo (there is little difference between the functionality of the Qt and ImGui demos - they are just different ways to achieve the same thing); it is better to start without it if you are just evaluating Zep, since it is just one more complication and installation...\nHere is an example of installing Qt on Linux\n```bash\n# for Qt/Demo support\nsudo apt install qt5-default\n# Adapt to your installation path - you will need to set this appropriately\nset QT_INSTALL_LOCATION=\"/usr/include/x86_64-linux-gnu/qt5\"\n```\nOn Windows you would typically install the Qt library and then set an environment variable to point to it:\n```bat\nset QT_INSTALL_LOCATION=C:\\Qt\\5.10.0\\msvc2017_64\n```\n## Buildling the demo\nStart by getting the source and running the prebuild.  Ensure the prebuild runs successfully and if not, make sure you have any dependencies on your system that it asks for.  The demo cannot build without the prebuild components.\n```\ngit clone https://github.com/Rezonality/zep zep\ncd zep\ngit submodule update --init\n./prebuild.sh or prebuild.bat (select based on your system)\n``` \nChange to the build directory:\n```\nmkdir build\ncd build\n```\nCreate the makefiles and build the code:\n### Linux/Mac\nThis will make standard makefiles on linux and Mac.  There may be other options for the generator, such as XCode, but this will work as a starting point:\n```\ncmake -G \"Unix Makefiles\" -DBUILD_QT=OFF -DBUILD_IMGUI=ON -DCMAKE_BUILD_TYPE=Release ..\ncmake --build . --config Release\n```\n### Windows\nAssuming you have Visual Studio 17, this will make a solution for you.  Note there is a convenient config_imgui.bat which will do the same thing.\n```\ncmake -G \"Visual Studio 17 2022\" -DBUILD_QT=OFF -DBUILD_IMGUI=ON -DCMAKE_BUILD_TYPE=Release ..\ncmake --build . --config Release\n```\n\nOn Windows you will find the built demo in:\n```\n.\\build\\demos\\demo_imgui\\Debug\\ZepDemo.exe\n```\n\n## Tests\nType `CTest --verbose` in the build folder to run unit tests.\n\n# Integration\nIf you want to use the Zep library in your own software you have 2 options:\n### Option 1: Install the Zep library as a package\nHere is a typical build instruction for windows, which just builds the library\n```\nmkdir build\ncd build\ncmake -G \"Visual Studio 17 2022\" -DBUILD_IMGUI=0 -DBUILD_TESTS=0 -DBUILD_DEMOS=0 ..\ncmake --build . --target install\n```\nAt this point your system will have installed the zep library.  You can add its paths and library to your project like this, in the standard CMake way.\n```\nfind_package(Zep REQUIRED)\ntarget_link_libraries(MYPROJECT PRIVATE Zep::Zep)\n```\n### Option 2: Use zep as a single header library\nA typical example of including Zep as a single header library (see the sister integration project for an example).  This is a really easy way to get started...\n```\ngit submodule add zep https://github.com/Rezonality/zep\n\nIn CMakeLists:\ntarget_include_directories(myapp\n    PRIVATE\n    zep/include\n\n#include \"zep\\zep.h\"\n```\n# Libraries used\n[SDL2: Media/Window Layer](https://www.libsdl.org/download-2.0.php)\nSDL2 is used by the demo to get a window on the screen in a cross platform way, and for OpenGL to generate a Context.\n\n[ImGui: 2D GUI](https://github.com/ocornut/imgui)\nImGui is a great 2D User interface for 3D applications, used in the ImGui version of the demo\n\n[Qt](https://www.qt.io)\nQt is a cross platform GUI.  Zep uses it as a renderer in the Qt Demo.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/jacobfriedman\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/697310?v=4?s=100\" width=\"100px;\" alt=\"Jacob Friedman\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJacob Friedman\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Rezonality/zep/commits?author=jacobfriedman\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/FredrikAleksander\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/14351056?v=4?s=100\" width=\"100px;\" alt=\"FredrikAleksander\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFredrikAleksander\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Rezonality/zep/commits?author=FredrikAleksander\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://sam.hocevar.net/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/245089?v=4?s=100\" width=\"100px;\" alt=\"Sam Hocevar\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSam Hocevar\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Rezonality/zep/commits?author=samhocevar\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://glenfraser.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/306082?v=4?s=100\" width=\"100px;\" alt=\"Glen Fraser\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGlen Fraser\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Rezonality/zep/commits?author=totalgee\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://mastodon.world/@nicolas_noble\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7281574?v=4?s=100\" width=\"100px;\" alt=\"Nicolas Noble\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNicolas Noble\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Rezonality/zep/commits?author=nicolasnoble\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://schnappy.xyz\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1405255?v=4?s=100\" width=\"100px;\" alt=\"Schnappy\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSchnappy\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Rezonality/zep/commits?author=ABelliqueux\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/fezjo\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/26350212?v=4?s=100\" width=\"100px;\" alt=\"Jozef Číž\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJozef Číž\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Rezonality/zep/commits?author=fezjo\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/Green-Sky\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2938071?v=4?s=100\" width=\"100px;\" alt=\"Erik Scholz\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eErik Scholz\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Rezonality/zep/commits?author=Green-Sky\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://packman.io\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/5270205?v=4?s=100\" width=\"100px;\" alt=\"Jesse Portnoy\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJesse Portnoy\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Rezonality/zep/commits?author=jessp01\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! See [Contributing](CONTRIBUTING.md) for details.\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRezonality%2Fzep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRezonality%2Fzep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRezonality%2Fzep/lists"}