1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
# Ecex
Ecex is a small C editor with GLFW/OpenGL rendering and C config/plugins loaded
through CCDJIT.
## Build
Dependencies:
- `clang`
- `make`
- `pkg-config`
- GLFW 3
- OpenGL
Build and test:
```sh
make
make check
```
With Guix:
```sh
guix shell -m manifest.scm -- make check
guix build -f guix.scm
guix package -f guix.scm
```
Run:
```sh
make run
```
Use a config or font explicitly:
```sh
./bin/ecex --config config/ecexrc.c
./bin/ecex --font /path/to/font.ttf
```
Install locally:
```sh
make install PREFIX=$HOME/.local
```
`ECEX_FONT` can also point at a TTF font. `ECEX_INCLUDE` can point at the Ecex
include directory when loading configs from another working directory.
If no `--config` is provided, Ecex looks for `ecexrc.c` in
`$XDG_CONFIG_HOME/ecex` and then `~/.config/ecex`.
## Useful Keys
- `M-x`: command prompt
- `C-x C-f`: find file
- `C-x C-s`: save buffer
- `C-x b`: switch buffer
- `C-x k`: kill buffer
- `C-x d`: file browser
- `M-x messages`: open the read-only `*Messages*` buffer
- `C-g d` in C buffers: jump to definition from the project root
- `C-g f` in C buffers: open file at point using project include flags
- `C-s` / `C-r`: incremental search
- `C-/`: undo
- `C-S-z`: redo
- `C-x C-r`: reload config
- `C-x C-c`: quit
The sample config in `config/ecexrc.c` enables demo plugins including Markdown,
which-key, C mode, API completion, render demo, and Tetris.
## Development
`make check` runs the core C tests. `make sanitize` builds the app and runs the
tests with AddressSanitizer/UBSan flags.
Plugin API conventions are documented in `docs/plugin-api.md`. Current CCDJIT
follow-up work is tracked in `docs/ccdjit-improvements.md`.
`guix.scm` defines a local package. It installs the binary, public headers,
sample configs, and docs, and wraps `ecex` with `ECEX_INCLUDE` and a DejaVu font
path. It also exports Guix profile search paths so `#include "ecex.h"` is
discoverable by Clang after the profile environment is sourced.
In C-mode, `ENTER` auto-indents, `S-TAB` removes one indent level, and
`ecex_c_mode_set_tab_width(2)` changes the tab width from config.
For `C-g d`/`C-g f`, ecex finds the project root by walking up to `.git`,
`compile_commands.json`, `compile_flags.txt`, or `.ecex-project`. Clangd uses
standard `compile_commands.json`/`compile_flags.txt`; `C-g f` also reads include
flags such as `-Iinclude` from `.ecex-project`.
Ecex is distributed under the BSD 2-Clause License. See `LICENSE`.
|