https://github.com/izenynn/mini-vim
A "mini" implementation of vim :3
https://github.com/izenynn/mini-vim
c linux macos minimal syntax-highlighting text-editor vim
Last synced: 12 months ago
JSON representation
A "mini" implementation of vim :3
- Host: GitHub
- URL: https://github.com/izenynn/mini-vim
- Owner: izenynn
- License: bsd-2-clause
- Created: 2021-10-28T10:15:54.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-27T15:36:23.000Z (over 3 years ago)
- Last Synced: 2025-04-06T03:11:46.235Z (about 1 year ago)
- Topics: c, linux, macos, minimal, syntax-highlighting, text-editor, vim
- Language: C
- Homepage:
- Size: 103 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# minivim
## info
A "mini" implementation of vim :3
It uses `VT100` escape characters (I will implement `ncurses` in the future probably).
P.S. I know they are way too much comments, sorry for that. I do this project for learning purpouses, so I comment everything I do for that reason ":D
## How to use
Clone the repo
```sh
git clone https://github.com/izenynn/minivim.git
```
Run make inside the repo
```sh
cd ./minivim && make
```
Open a file using minivim (it will create the file if it does not exists)
```sh
./minivim [FILE]
```
- or create a file with no name, and name it later with vim command `:saveas`
```sh
./minivim
```
*NOTE: if cursor highlighting is not working, that is probably becouse your terminal is reversing the cursor position color too, so it goes back to normal, to fix this, compile again with the variable CURSOR_HL=0 (disabled).*
```sh
make re CURSOR_HL=0
```
## How to install
If you want to add minivim to your path and be able to use it in any directory like any other command, run `make install`
```sh
make install
```
In case it gives you permissions error, try running it with `sudo`
```sh
sudo make install
```
*NOTE: if you are having the issue I described before with the cursor highlighting, you will need to also install with CURSOR_HL=0.*
```sh
sudo make install CURSOR_HL=0
```
*NOTE: to change the directory in which the binary is installed, you can compile with BIN_DIR="/usr/local" (just an example).*
```sh
sudo make install BIN_DIR="/usr/local/bin"
```
## Features
Editor features:
- Open, edit and save any text files.
- C and C++ syntax highlighting.
Vim features:
- `normal` and `insert` mode.
- `i`, `a`: change to insert mode.
- `o`, `O`: insert new line.
- `h`, `j`, `k`, `l`: move around (also: arrows).
- `0`: move to first character in the line (also: home key).
- `^`: move to first non-blank character in the line.
- `$`: move to last character in the line (also: end key).
- `gg`: goto first line.
- `G`: goto last line.
- `:w`, `:q`, `:q!`, `:wq`, `x`: supported commands.
- `:saveas [NAME]`: supported command.
- `/[MATCH]`: supported command (`n` / `N`: move to next / previous occurrence).
##
[](https://forthebadge.com)
[](https://forthebadge.com)