grassleaff/mi
mi is a minimalist Vim-like text editor written in C++ using ncurses, with a focus on simplicity. Aimed at developers, it features built-in features to make code easier.
- C++ 96.6%
- Makefile 3.4%
| assets | FIX: Fix cache of mi.png old image | |
| src | ADD: New custom user colors on config.h | |
| .gitignore | ADD: Modify .gitignore to not track the mi executable | |
| LICENSE | Update copyright holder in LICENSE file | |
| Makefile | ADD: New custom user colors on config.h | |
| README.md | FIX: Fixing README.md | |
mi
mi is a minimal, Vim-inspired text editor written in C++ using ncurses. It is designed as a lightweight minimal but powerful terminal editor.
Features
- Modal editing (NORMAL, INSERT, COMMAND)
- Line numbers
- User-configurable
config.hpp - Command mode (
:w,:q,:wq) - Status bar with:
- Current mode
- Line and column position
- Open file name
- Colored status bar (mode-aware)
- Cursor navigation with arrow keys and
wasdalternatives - File loading and saving
- Built-in file manager (FLM)
- Built with ncurses
Customization
The editor ships with a central config file at src/include/config.hpp.
You can tweak things like:
- Line number mode (
NONE,ABSOLUTE,RELATIVE) - TAB width
- FLM panel width
- Status bar and FLM colors
- Custom ncurses RGB colors in
0..1000scale
Example with multiple custom colors in src/include/config.hpp:
constexpr CustomColor custom_black = make_custom_color(0, 30, 30, 30);
constexpr CustomColor custom_grey = make_custom_color(2, 120, 120, 120);
constexpr CustomColor active_custom_colors[] = {
custom_black,
custom_grey,
};
constexpr short status_normal_fg = custom_black;
constexpr short flm_select_fg = custom_grey;
Controls
NORMAL mode
i— enter INSERT modeARROW KEYSorwasd— move cursorA— enter INSERT mode after the cursor:— enter COMMAND mode
INSERT mode
- Type to insert text
ESC— return to NORMAL modeARROW KEYS— move cursorBACKSPACE— delete character
COMMAND mode
:w— save file:q— quit:wq— save and quitESC— cancel command
Keybinds
Ctrl+for:flm— open the FLM file manager- In the FLM, use
w/sto move,dorENTERto open, anda/BACKSPACEto go up
Dependencies
- GNU GCC/G++
- GNU Make
- ncurses
Building and Running
STEP 1 - Installing libncurses:
On Debian or Ubuntu:
sudo apt install libncurses-dev
On CentOS/RHEL/Scientific Linux 6.x/7.x+ and Fedora Linux 21 or older:
sudo yum install ncurses-devel
On Fedora Linux 22.x+:
sudo dnf install ncurses-devel
STEP 2 - Cloning and Installing:
git clone https://github.com/nothingburguer/mi
cd mi
sudo make install
mi [filename]
# Examples:
# mi main.cpp
# mi index.js
# mi script.py
ALT 1 - Uninstalling:
(On the repo folder)
cd mi
sudo make uninstall
ALT 2 - Local Build
git clone https://github.com/nothingburguer/mi
cd mi
make
# To clean:
# make clean
Screenshots
[画像:image][画像:image]