xv6 is a re-implementation of Dennis Ritchie's and Ken Thompson's Unix Version 6 (v6). xv6 loosely follows the structure and style of v6, but is implemented for a modern x86-based multiprocessor using ANSI C.
This is a tiny vi for xv6.
# ubuntu or debian
git clone https://github.com/yaodio/xv6-vi.git
sudo apt-get install qemu
# on ubuntu 20, you may need to install qemu-system
cd xv6-vi
make
make qemu
# if "fatal error: sys/cdefs.h", try:
sudo apt-get purge libc6-dev
sudo apt-get install libc6-dev
sudo apt-get install libc6-dev-i386
QEMU usage:
CTRL+A+X
to quit.CTRL+A+C
to debug.
- view mode
- cursor movement
- insert mode
- insert and delete (i, a and backspace)
- jump to line begin (0)
- jump to line end ($)
- jump to screen begin (H)
- jump to last line begin of screen (L)
- quit to normal (ESC)
- baseline mode
- write file to the origin or given path (:w [path])
- quit (:q)
- write file to the origin or given path and quit (:wq [path])
- force to quit (:q!)
- show help page (:h)
- syntax highlight
- read syntax highlight rule file [LANG].vi
- highlight regex strings by file postfix
This project is created by
- yaodio
- sexyboy
- stephen ark
We welcome any improvement! Feel free to fork and make pull request. If you don't know how to start, you can follow this (if you are new to git, you may need to do some search):
- Create an issue, describe what feature you want to add. It tells others you are working on this feature and avoid repeat work. Also, you should look up issues and ensure you are not repeating other's work
- Fork this project
- Clone YOUR FORKED PROJECT to your local:
git clone https://github.com/{YOUR NAME}/xv6-vi.git
- Set this project as upstream and checkout to a new branch where you add your new feature:
cd xv6
git remote add upstream https://github.com/yaodio/xv6-vi.git
git checkout {YOUR_BRANCH}
The "upstream" is for syncing with the origin repo. When the upstream repo is updated, you can sync your forked repo by:
git fetch upstream
git merge upstream/{YOUR_BRANCH}
You should always do this before making changes and makeing pull request.
-
Install qemu, make if you haven't (see Installation)
-
Make your changes. Use
make && make qemu
to enter xv6 -
Type
vi {file}
to your xv6 window and you should see vi running -
When you finish your work, push to your remote by
git push
-
Go to your project's "Pull requests" tab, click "New pull request"
-
Select your branch and click "Create new pull request". You are now finish your great contribution!
Open source libraries used in project:
Thanks to their great work.