{"id":13408978,"url":"https://github.com/adsr/mle","last_synced_at":"2025-05-14T22:08:53.027Z","repository":{"id":24908490,"uuid":"28325201","full_name":"adsr/mle","owner":"adsr","description":"flexible terminal-based text editor (C)","archived":false,"fork":false,"pushed_at":"2025-05-01T01:02:54.000Z","size":1317,"stargazers_count":870,"open_issues_count":6,"forks_count":54,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-05-01T02:18:43.591Z","etag":null,"topics":["c","console","editor","hacktoberfest","terminal","text","text-editor"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adsr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-12-22T05:05:38.000Z","updated_at":"2025-05-01T01:02:58.000Z","dependencies_parsed_at":"2024-01-13T14:35:58.088Z","dependency_job_id":"325d2b9e-53fe-4d62-b6bd-e86063eb05fb","html_url":"https://github.com/adsr/mle","commit_stats":{"total_commits":522,"total_committers":11,"mean_commits":47.45454545454545,"dds":"0.29885057471264365","last_synced_commit":"2286b5bf341c2ea63b0a3f45482022cee2a85928"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adsr%2Fmle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adsr%2Fmle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adsr%2Fmle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adsr%2Fmle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adsr","download_url":"https://codeload.github.com/adsr/mle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235700,"owners_count":22036964,"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":["c","console","editor","hacktoberfest","terminal","text","text-editor"],"created_at":"2024-07-30T20:00:57.043Z","updated_at":"2025-05-14T22:08:48.012Z","avatar_url":"https://github.com/adsr.png","language":"C","readme":"# mle\n\nmle is a small, flexible, terminal-based text editor written in C.\n\nRuns on Linux, Windows (Cygwin or WSL), FreeBSD, macOS, and more.\n\n[![Build Status](https://travis-ci.org/adsr/mle.svg?branch=master)](https://travis-ci.org/adsr/mle)\n\n### Demos\n\n[![asciicast](https://i.imgur.com/PZocaOT.png)](https://asciinema.org/a/162536)\n\n* [AceJump-like movement](https://i.imgur.com/atS11HX.gif)\n* [Large file benchmark](http://i.imgur.com/VGGMmGg.gif)\n* [Older demos](http://imgur.com/a/ZBmmQ)\n\n### Aims\n\n* Keep codebase small and hackable\n* Minimize build-time and run-time dependencies\n* Favor simplicity over correctness\n* Make extensible and configurable\n* Use shell commands to enhance functionality (e.g., grep, tree)\n\n### Features\n\n* Small codebase (~12k SLOC)\n* Full UTF-8 support\n* Syntax highlighting\n* Stackable key maps (modes)\n* Extensible via [Lua](https://www.lua.org)\n* Scriptable rc file\n* Key macros\n* Window splitting\n* Regex search and replace\n* Large file support\n* Incremental search\n* Linear undo and redo\n* Multiple cursors\n* Auto indent\n* Headless mode\n* Navigation via [ctags](https://github.com/universal-ctags/ctags)\n* Movement via [less](https://www.gnu.org/software/less/)\n* Fuzzy file search via [fzf](https://github.com/junegunn/fzf)\n* File browsing via [tree](http://mama.indstate.edu/users/ice/tree/)\n* File grep via [grep](https://www.gnu.org/software/grep/)\n* String manip via [perl](https://www.perl.org/)\n\n### Building\n\n    $ sudo apt install git build-essential # install git, make, gcc, libc-dev\n    $\n    $ git clone --recursive https://github.com/adsr/mle.git\n    $ cd mle\n    $ make mle_vendor=1\n\nTo build a completely static binary, try `make mle_vendor=1 mle_static=1`.\n\nYou can also run plain `make` to link against system libraries instead of\n`vendor/`. Note this requires the following packages to be installed:\n\n    uthash-dev\n    liblua5.4-dev\n    libpcre2-dev\n\nTo install to `/usr/local/bin`:\n\n    $ make install\n\nTo install to a custom directory, supply `prefix`, e.g.:\n\n    $ make install prefix=/usr # /usr/bin/mle\n\n### Installing from a repo\n\nmle may be available to install via your system's package manager.\n\n    # apt install mle   # Ubuntu and Debian-based distros\n    # dnf install mle   # CentOS, RHEL, Fedora-based distros\n    # pkg install mle   # FreeBSD\n    # yay -S mle        # Arch (via AUR)\n    # snap install mle  # all major Linux distros\n    # nix-env -i mle    # NixOS (via nixpkgs)\n    # apk add mle       # Alpine\n    # xbps-install mle  # Void\n    # brew install mle  # macOS (Homebrew)\n    # port install mle  # macOS (MacPorts)\n    # setup-x86.exe -q -P mle # Cygwin\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/mle.svg)](https://repology.org/project/mle/versions)\n\n### Basic usage\n\n    $ mle               # Open blank buffer\n    $ mle one.c         # Edit one.c\n    $ mle one.c:100     # Edit one.c at line 100\n    $ mle one.c two.c   # Edit one.c and two.c\n    $ mle -h            # Show command line help\n\nThe default key bindings are intuitive. Input text as normal, use directional\nkeys to move around, use `Ctrl-S` to save, `Ctrl-O` to open, `Ctrl-X` to exit.\n\nPress `F2` for full help.\n\n### Advanced usage: mlerc\n\nmle is customized via command line options. Run `mle -h` to view all cli\noptions.\n\nTo set default options, make an rc file named `~/.mlerc` (or `/etc/mlerc`). The\ncontents of the rc file are any number of cli options separated by newlines.\nLines that begin with a semi-colon are interpretted as comments.\n\nIf `~/.mlerc` is executable, mle executes it and interprets the resulting stdout\nas described above. For example, consider the following snippet from an\nexecutable `~/.mlerc` bash(1) script:\n\n    # Define 'test' kmap\n    echo '-Ktest,,1'\n\n    # M-q: replace grep with git grep if `.git` exists\n    if [ -d \".git\" ]; then\n      echo '-kcmd_grep,M-q,git grep --color=never -P -i -I -n %s 2\u003e/dev/null'\n    fi\n\n    # Set default kmap\n    echo '-n test'\n\nThis overrides the built-in grep command with `git grep` if `.git` exists in\nthe current working directory.\n\n### Shell command integration\n\nThe following programs will enable or enhance certain features of mle if they\nexist in `PATH`.\n\n* [bash](https://www.gnu.org/software/bash/) (tab completion)\n* [fzf](https://github.com/junegunn/fzf) (fuzzy file search)\n* [grep](https://www.gnu.org/software/grep/) (file grep)\n* [less](https://www.gnu.org/software/less/) (less integration)\n* [perl](https://www.perl.org/) (perl 1-liners)\n* [readtags](https://github.com/universal-ctags/ctags) (ctags integration)\n* [tree](http://mama.indstate.edu/users/ice/tree/) (file browsing)\n\nArbitrary shell commands can also be run via `cmd_shell` (`M-e` by default). If\nany text is selected, it is sent to stdin of the command. Any resulting stdout\nis inserted into the text buffer.\n\n### Advanced usage: Headless mode\n\nmle provides support for non-interactive editing which may be useful for using\nthe editor as a regular command line tool. In headless mode, mle reads stdin\ninto a buffer, applies a startup macro if specified, and then writes the buffer\ncontents to stdout. For example:\n\n    $ echo -n hello | mle -M 'test C-e space w o r l d enter' -p test\n    hello world\n\nIf stdin is a pipe, mle goes into headless mode automatically. Headless mode can\nbe explicitly enabled or disabled with the `-H` option.\n\nIf stdin is a pipe and headless mode is disabled via `-H0`, mle reads stdin into\na new buffer and then runs as normal in interactive mode.\n\n### Advanced usage: Scripting\n\nmle is extensible via the [Lua](https://www.lua.org) programming language.\nScripts are loaded via the `-x` cli option. Commands registered by scripts can\nbe mapped to keys as normal via `-k`. See `uscript.lua` for a simple example.\n\nThere is also a `wren` branch with [Wren](http://wren.io) scripting support.\nThat work is on pause.\n\n### Forks\n\n* [eon](https://github.com/tomas/eon) - mouse support and Notepad-like\n  selections\n* [turbo-mle](https://github.com/magiblot/turbo-mle) - Turbo Vision port\n\n### Acknowledgments\n\nmle makes extensive use of the following libraries.\n\n* [uthash](https://troydhanson.github.io/uthash) for hash maps and linked lists\n* [termbox2](https://github.com/termbox/termbox2) for TUI\n* [PCRE2](http://www.pcre.org/) for syntax highlighting and search\n","funding_links":[],"categories":["Terminal-based editors","C","c"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadsr%2Fmle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadsr%2Fmle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadsr%2Fmle/lists"}