mvim is a VIM-inspired modal-based text editor written in C++ using the ncurses library. It combines the efficiency of modal editing with modern features like multiple buffers, syntax highlighting, and customizable keybindings.
If you find a bug or want to discuss the best way to add a new feature, please open an issue.
- Modal Editing: Normal, Insert, Visual, and Find modes.
- Multiple Buffers: Open and edit multiple files simultaneously.
- Syntax Highlighting: Customizable syntax coloring via
.mvimlangdefinition files. - Custom Configuration: Fully configurable keybindings via
.mvimrc. - System Clipboard: Seamless copy/paste integration with the system clipboard (requires
xclip). - Mouse Support: Basic mouse interaction for cursor placement and scrolling.
You can easily customize the color schemes in mvim to suit your preferences:
mvim has the following dependencies:
You can install them with:
chmod +x install_dependencies.sh && ./install_dependencies.sh
git clone [https://github.com/ErikDervishi03/mvim-textEditor.git](https://github.com/ErikDervishi03/mvim-textEditor.git)
cd mvim-textEditor
mkdir build
cd build
cmake ..
sudo make install
sudo sget install [https://github.com/ErikDervishi03/mvim-textEditor.git](https://github.com/ErikDervishi03/mvim-textEditor.git)
To uninstall:
sudo xargs rm < install_manifest.txt
mvim supports a configuration file named .mvimrc. The editor looks for this file in the following locations (in order):
- The current working directory.
/usr/local/share/mvim/.mvimrc/usr/share/mvim/.mvimrc
The configuration file uses a section-based format to bind keys to actions for different modes.
Example .mvimrc:
[NORMAL]
Ctrl-s = save
Ctrl-q = quit
Ctrl-z = undo
Ctrl-n = buffer_new
Ctrl-l = buffer_next
Ctrl-h = buffer_prev
[INSERT]
Ctrl-v = paste
Ctrl-s = save
mvim uses a hybrid keybinding approach, supporting both traditional Vim motions and common editor shortcuts (e.g., Ctrl+S to save).
| Keybind | Action |
|---|---|
| Ctrl-q | Quit |
| Ctrl-s | Save current buffer |
| Ctrl-n | Open new empty buffer |
| Ctrl-l | Switch to next buffer |
| Ctrl-h | Switch to previous buffer |
Used for navigation and manipulation.
| Keybind | Action |
|---|---|
| i | Enter Insert mode |
| v | Enter Visual mode |
| f | Enter Find mode |
| u / Ctrl-z | Undo |
| Ctrl-v | Paste from system clipboard |
| Ctrl-a | Select all |
| h, j, k, l | Move cursor Left, Down, Up, Right |
| x | Delete character |
| d | Delete line |
| o | Insert line below |
| O | Insert line above |
| Ctrl-Right | Go to next word |
| Ctrl-Left | Go to previous word |
Used for typing text.
| Keybind | Action |
|---|---|
| Esc | Switch to Normal mode |
| Ctrl-v | Paste |
| Ctrl-z | Undo |
| Ctrl-Right | Move to next word |
| Ctrl-Left | Move to previous word |
Used for text selection.
| Keybind | Action |
|---|---|
| Esc | Switch to Normal mode |
| > / < | Indent / Unindent selection |
| Ctrl-c | Copy selection to system clipboard |
| Ctrl-x | Cut/Delete selection |
Used for searching text within the buffer.
| Keybind | Action |
|---|---|
| Enter | Confirm search |
| Ctrl-n | Find next occurrence |
| Ctrl-p | Find previous occurrence |
| r | Replace |
| Esc | Return to Normal mode |
Syntax highlighting is defined in .mvimlang files located in the languages/ directory. You can add support for new languages by creating a new definition file containing keywords, comment styles, and extensions.
mvim uses doxygenmd to generate its Markdown API documentation:
doxygenmd src doc
mvim uses Uncrustify to ensure consistent code formatting:
uncrustify -c uncrustify.cfg --no-backup src/*
uncrustify -c uncrustify.cfg --no-backup include/*
