Coder Social home page Coder Social logo

vi-xv6-riscv's Introduction

vi for xv6-riscv

这是一个简单的vi移植于xv6

run

$ cd xv6-riscv
$ make qemu
$ vi or vi filename

Support features

  • 默认模式
    • h:光标左移
    • j:光标下移
    • k:光标上移
    • l:光标右移
    • d:删除光标所在当前行,并将当前行内容记入缓冲区
    • p:粘贴有d命令删除的行
    • x:删除光标所在处的字符
    • i:进入插入模式
    • /:键入字符串向后查找,以回车结束输入
    • ?:键入字符串向前查找,以回车结束输入
    • n:查找下一个单词
    • N:查找上一个单词
    • CTRL + L:进入c语言语法高亮模式(仅支持部分关键字)
  • 插入模式
    • backspace: 支持退格键
    • enter:支持回车键
    • esc:返回默认模式
    • TAB:默认4个空格
  • 命令行(在默认模式下按:进入,按ESC退出)
    • :q:退出
    • :w:保存到进入vi时输入的文件名,如果没有则默认文件名为default.viout
    • :e filename:加载文件到vi

Bugs

  • 由于使用的正则库对\b适配较差,导致语法高亮存在一定问题
  • 由于渲染高亮文本中采用逐个字符渲染的方式,一些特殊字符在高亮模式下可能存在乱码的问题

Modified files

  • kernel/console.c
  • kernel/defs.h
  • kernel/syscall.c
  • kernel/syscall.h
  • kernal/sysfile.c
  • user/ulib.c
  • user/user.h
  • user/usys.pl
  • user/vi.c
  • user/re.c
  • user/re.h
  • Makefile

本项目使用的开源库

致谢

感谢下列开源库为作者提供参考:

vi-xv6-riscv's People

Contributors

kaashoek avatar rsc avatar fcjcbk avatar phf avatar 4ge32 avatar anishathalye avatar aclements avatar mikecat avatar xiw avatar k-mrm avatar l0stman avatar waheedhafez avatar takahirox avatar ravss avatar pmaddams avatar zeldovich avatar matt-har-vey avatar jrrk2 avatar jjolly avatar d0iasm avatar zhuyu1997 avatar olf0 avatar kimjungwow avatar kehao95 avatar flespark avatar amane-uehara avatar kolontsov avatar tchajed avatar saarett avatar rui314 avatar

Stargazers

 avatar ddd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.