Lex is a lightweight, simple, terminal-based text editor, inspired by GNU Nano. It focuses on minimalism, speed, and essential features for developers who prefer working in the terminal.
- 🧩 Familiar Interface — Simple layout inspired by Nano
- 🎨 Syntax Highlighting — Supports C, C++, Python, Java, JavaScript, and more
- 🧭 Lightweight & Fast — Minimal resource usage
- 💾 Basic File Operations — Open, edit, save files
- 🧠 Undo/Redo Support
- 🖱️ Optional Mouse Support
- ⚙️ Configurable Settings — Tab width, line numbers, etc.
Requires CMake 3.15+, GCC/Clang, and Make.
# Clone repo
git clone https://github.com/danko1122q/LEX.git && cd LEX
# Build
mkdir build && cd build
cmake ..
make -j$(nproc)
# Install (requires sudo)
sudo make installOne-liner:
git clone https://github.com/danko1122q/LEX.git && cd LEX && mkdir build && cd build && cmake .. && make -j$(nproc) && sudo make installDefault binary location: /usr/local/bin/lex
cd build
sudo make uninstallcd build
sudo make force-uninstallRemoves binary from:
/usr/local/bin/lex/usr/bin/lex${CMAKE_INSTALL_PREFIX}/bin/lex
sudo rm -f /usr/local/bin/lex
sudo rm -f /usr/bin/lex
which lex # Should show nothingmake -C build purgeRuns uninstall, then deletes the build directory.
lex [filename] # Open file or new buffer
lex -v # Show version- Editor area, Status bar, Command line (optional)
| Shortcut | Action |
|---|---|
| Ctrl+O | Save |
| Ctrl+X | Exit |
| Ctrl+G | Help |
| Ctrl+W | Search |
| Ctrl+K | Cut line |
| Ctrl+U | Paste |
| Ctrl+Z | Undo |
| Ctrl+Y | Redo |
Change editor behavior via prompt (Ctrl+P):
set tabsize 4
set lilex 1
set helpinfo 0
Installation:
- Missing CMake:
sudo apt install cmake(Debian/Ubuntu) - Permission denied: Use
sudo - Build fails: Ensure GCC/Clang installed
Uninstallation:
install_manifest.txtmissing: usesudo make force-uninstall- Permission denied: run with
sudo - Conflict with system
lex: rename project inCMakeLists.txtor install locally withCMAKE_INSTALL_PREFIX=$HOME/.local
Modified MIT License (Non-Commercial). Commercial use requires written permission.
- GNU Nano for inspiration
- Open Source community
- Contributors
- Repository: github.com/danko1122q/LEX
- Issues / Pull Requests: Use
