r/ComputerCraft • u/Minori-Murasaki • 6d ago
I made CChibiVim — a Vim-like code editor for computer craft (modal editing, text objects, search, syntax highlighting)
Hey everyone!
I've been working on CChibiVim, a Vim-inspired editor for my own use. But i would like to share it. It's a single-file Lua script — no dependencies, just download and run.
Install and use
wget https://raw.githubusercontent.com/rezexell/CChibiVim/refs/heads/main/cchibivim.lua
cchibivim myfile.lua (Filename is optional.)What it does
Modal editing
- Normal / Insert / Visual / Visual Line / Command / Search modes
jkin Insert mode → Normal (since Esc isn't always convenient)- Counts work:
5j,3dd,2yy,d2w, etc.
Motions
hjkl,w b e,W B E,0 ^ $,gg G,{ }f/F+ char;;/,to repeat find
Operators & text objects
d,c,ycombined with motions and text objects- Text objects: `iw aw iW aW`, plus quotes and brackets (
i(,a",i[,i{, …) dd yy cc,D,C,x,X,r,J,K<<and>>for indentingp/Ppaste (linewise and characterwise)uundo (with sensible grouping in Insert mode)
Visual mode
v/V/oto swap endsy d c r pall work on the selection- Line and character selections
Search
/and?with incremental matching- All matches highlighted, current match highlighted differently
n/Nto jump,zto clear highlights
Command mode (:)
:w,:q,:q!,:x,:wq,:e {file},:e!
Editor niceties
- Lua syntax highlighting (keywords, strings, numbers, operators, comments, function names)
- Autocompletion in Insert mode via
textutils.complete—Ctrl+N/Ctrl+Pto cycle,Enterto accept - Hybrid line numbers (absolute on the current line, relative elsewhere)
- Status line showing mode + cursor position and messages
- Dirty marker in the title,
[New File]handling - Handles
term_resize
Repo: https://github.com/rezexell/CChibiVim
Bug reports and PRs welcome!
Editor was built with help from AI during development.
67
Upvotes
15
u/artmogus 6d ago
6
u/p4rad1ze 6d ago
Fuck yeah dude!!
3
u/Exnur0 4d ago
Very cool!!