Learn bi

Learn bi

From your first bi . to multiple cursors, the language server and the shell — then the custom editors that draw a picture, a curve, a colour or a ramp over the file it lives in, and the property editors that turn a schema and its data into a form. Every lesson shows a real bi session, step by step.

  1. The editorThe modal editor itself: modes, motions, operators, cursors, files, the language server and the shell.
  2. 01 First steps orientation Open a file or a whole project, tell the modes apart by the status row, and get out again. Nothing to install first — tree-sitter, the file tree and the picker are already there.
  3. 02 Moving around motion The vim motions you know, plus three bi adds: s to jump to anything on screen, ]]/[[ to walk the parse tree, and a search that tells you where you are in it.
  4. 03 Editing: operators, objects, structure editing An operator plus a motion is one edit. bi keeps vim’s grammar, adds the parse tree as a way to say what, and makes surroundings and moving lines built-in commands.
  5. 04 Multiple cursors bi additions Vim has none of this, so the keys are bi’s own. Every command runs at every cursor, and the whole thing is one undo step, including the cursors themselves.
  6. 05 Registers: a ring, not slots bi additions Vim makes you pick one of 36 slots when you yank, which is the wrong moment. bi saves everything automatically and lets you choose when you paste, from a picker you can search.
  7. 06 Search and replace workflow :s for a range of lines, :g for every line that matches, :find and :replace for the whole project — with a preview you prune before anything is written.
  8. 07 Files, buffers and windows workflow The file tree, the file picker, the buffer switcher, the alternate file, and splits you can jump between with one letter.
  9. 08 Code awareness built in Tree-sitter is compiled into bi, so every open file already has a parse tree. Highlighting, block context, symbols, split/join and a handful of marks on the text all come from it — no plugin, no query files to install.
  10. 09 Language servers built in The LSP client is in the binary. Open a file and its server starts: diagnostics on the text, go to definition, references, hover, completion, signature help, code actions and formatting — no plugin, no config file.
  11. 10 Text tools and the shell built in Sorting, aligning, respelling, decoding, generating ids, and piping text through programs — as : commands that work on a selection, a range, or the whole file.
  12. 11 Configuration setup bi works with no config at all. When you do write one, it is a patch over the defaults: say what you want changed and nothing else.
  13. Custom editors:set editor <kind> draws the thing under the cursor — a picture, a tile grid, a curve, a colour, a ramp, a normal map — and the normal keys edit it, writing back into the file it came from.
  14. 12 Custom editors editors :set editor <kind> draws what is under the cursor — a picture, a tile grid, a curve, a colour, a ramp, a normal map — and the normal keys edit it, writing back into the file it came from. This lesson is the family, and the picture the rest of them are drawn on.
  15. 13 Tilesets editors A tile sheet is a picture with a grid over it. The cursor is one tile, yy and p move tiles around, r turns them — and the keys are the ones you already use.
  16. 14 Curve editor editors A tuning curve lives in your code as a list of numbers. :set editor curve draws the shape those numbers make beside them, and the keys move the points by rewriting the numbers in place.
  17. 15 Colour and gradient editors A colour is six hex digits and a gradient is a list of stops. :set editor color and :set editor gradient draw them beside the text and let the keys move through colour space, rewriting the digits in place.
  18. 16 Normal maps editors A height map is a grey picture; a normal map is what the shader wants. :set editor normalmap puts the result beside the source and the knobs beside that, so a change is a glance away.
  19. Property editorsA .bischema gives your data types and a .bidata opens as a form. bi gen struct turns the same schema into code for your game.
  20. 17 The property format bi format A .bischema says what a Weapon is; a .bidata holds the weapons. Both are plain JSON, and bi opens them as a form — sliders, checkboxes, choices — edited with the keys you already know.
  21. 18 Editing data bi format :bi is the ex half of the property view: set a value by path, add a type, rename a field across every data file that uses it, and mend a file that does not parse.
  22. 19 Generating code bi format bi gen struct reads a schema and writes the same types in C, C++, Go, Rust, C3 or Lua — with defaults, id constants and the instances themselves, so the schema stays the one source.