MSX-vi
A vi text editor clone for the MSX 8-bit home computer.
Description
MSX-vi is a clone of the vi text editor for the MSX computer.
MSX is a 8-bit computer system created in 1983 by Microsoft and ASCII Corporation. It was very popular in Japan, some European countries, Korea and Brazil. Although it’s not widely used nowadays, it still has a great number of enthusiasts creating hardware and software for the platform.
Vi is a text editor originally created for the Unix operating system. It became very popular and today there are many different clones available on multiple platforms.
Minimum requirements
- MSX2 computer (or emulator)
- MSX-DOS2
History
My passion for technology started when my parents gave me as a present my first computer. I was 9 years old and the computer was a MSX. At the beginning I was using it just to play games, but I started learning programming by myself (first Logo and Basic later). Nowadays I still enjoy playing with MSX and trying to learn better how it works internally.
Thanks to Javi Lavandeira’s tutorials Relearning MSX on how to program with C for the MSX, I started writing my first programs and tests, and I started to have the idea on writing a vi clone. As far as I know there is nothing similar on the MSX.
I started writing code, but a text editor is way more complex than it looks. Memory management was very difficult for my limited C knowledge. At the end I abandoned the project.
Few months later I discovered the Build Your Own Text Editor tutorial. It is a step by step guide on how to write Antirez’s kilo text editor. I started reading it and I decided to try again writing the vi clone for MSX.
Download
Online Emulator
Try it online:
Note: In some keyboards, the :
key doesn’t work in WebMSX.
Screenshots
Supported commands
Exiting and saving
:q
: Exit the editor as long there are no changes:q!
: Exit the editor without saving any changes:w
: Save changes to current file:w filename
: Save changes tofilename
:wq
: Save changes to current file and exit
Movement
ESC
: Enter command modeCONTROL d
: Move one page downCONTROL u
: Move one page uph
: Move leftj
: Move downk
: Move upl
: Move right0
: Move to the begining of the line$
: Move to the end of the lineH
: Go to top of the screenM
: Go to middle of the screenL
: Go to bottom of the screengg
: Go to the beginning of the fileG
: Go to the end of the filew
: Move to next wordb
: Move to previous worde
: Move to the end of the word:N
: Go to lineN
Deleting text
dd
: Delete current lined0
: Delete until the beginning of the lined$
: Delete until the end of the linedG
: Delete ultil the end of the filex
: Delete a single characterX
: Delete a single character to the left of cursor
Inserting text
r
: Replace current charactera
: Enter insert mode after the cursorA
: Enter insert mode after the current linei
: Enter insert mode at the cursorI
: Enter insert mode before the current lineo
: Insert a new line after the current oneO
: Insert a new line before the current one
Search
/string
: Search forward for string?string
: Search backards for stringn
: Search next ocurrence (forward)N
: Search next ocurrence (backards)
Other commands
:color fg bg bd
: Changes the screen colorsCONTROL l
: Refresh screen
Compile requirements
- SDCC 3.5.0 (it doesn’t work with newer versions)
- GNU make
- openMSX (for testing)