Skip to content

OneNoted/pi-vim-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-vim-editor

A Vim-style modal editor extension for pi.

Repository: https://github.com/OneNoted/pi-vim-editor

Features

Current feature set:

  • normal / insert / visual / visual-line modes
  • counts
  • motions: h, j, k, l, w, b, e, ge, 0, ^, $, gg, G
  • find motions: f, F, t, T, ;, ,
  • operators: d, c, y
  • common commands: x, X, s, S, D, C, Y, p, P, u
  • text objects: iw, aw
  • visual selection rendering
  • mode label in the editor border

Install

Try without installing

pi -e /path/to/pi-vim-editor

Install from a local path

pi install /path/to/pi-vim-editor

Install from npm

pi install npm:@onenote/pi-vim-editor

Development

Typecheck and run the local crash/smoke suite with Bun:

bun install
bun run typecheck
./scripts/smoke.sh

To preview the published tarball contents:

bun run pack:dry-run

Publish

bunx npm login
bunx npm publish --access public

bun run pack:dry-run is the easiest local packaging check before publishing.

Safety / failure mode

This extension currently relies on pi editor internals to implement modal rendering and behavior.

To reduce host breakage while iterating, it includes a failsafe mode:

  • if modal handling throws, it logs once
  • it falls back to the built-in editor behavior for the rest of the session
  • the mode label shows SAFE

Current limitations

This is already usable, but it is still aiming for tighter Vim parity in areas like:

  • exact text object semantics
  • some edge cases around wrapped lines and empty lines
  • perfect paste behavior in all linewise/charwise combinations
  • long-term compatibility with future pi internal editor changes

Packaging notes

This package follows pi package conventions via the pi key in package.json and is tagged with the pi-package keyword for discoverability.

About

Vim-style modal editor extension for pi

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors