Skip to content

izenynn/mini-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

git clone https://github.com/izenynn/minivim.git

Run make inside the repo

cd ./minivim && make

Open a file using minivim (it will create the file if it does not exists)

./minivim [FILE]
  • or create a file with no name, and name it later with vim command :saveas
./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).

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

make install

In case it gives you permissions error, try running it with sudo

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.

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).

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).

forthebadge forthebadge