1--- 2title: Helix Keybindings 3layout: ../../layouts/MainLayout.astro 4--- 5 6# Helix Keybindings in the REPL 7 8The Strudel REPL supports [Helix editor](https://helix-editor.com/) keybindings through the `codemirror-helix` extension. Helix is a post-modern modal text editor with a focus on selection-first editing and multiple cursors. 9 10## Enabling Helix Mode 11 121. Open the Settings panel in the REPL (click the settings icon or use the keyboard shortcut) 132. Find the "Keybindings" section 143. Select "Helix" from the available options 15 16## Key Differences from Vim 17 18Helix uses a selection-first approach, which means: 19 20- **Selection → Action** (Helix) vs **Action → Motion** (Vim) 21- For example, to delete a word in Helix: `w` (select word) → `d` (delete) 22- In Vim, it would be: `dw` (delete word) 23 24## Common Helix Commands 25 26### Normal Mode 27 28- `i` — Enter insert mode before selection 29- `a` — Enter insert mode after selection 30- `v` — Enter visual/select mode 31- `w` — Select next word 32- `e` — Select to end of word 33- `b` — Select previous word 34- `x` — Select/extend line 35- `d` — Delete selection 36- `c` — Change selection (delete and enter insert mode) 37- `y` — Yank (copy) selection 38- `p` — Paste after selection 39- `u` — Undo 40- `U` — Redo 41- `/` — Search 42- `n` — Select next search match 43- `N` — Select previous search match 44 45### Movement 46 47- `h, j, k, l` — Move left, down, up, right 48- `gg` — Go to start of document 49- `ge` — Go to end of document 50- `{` / `}` — Move to previous/next paragraph 51- `%` — Match bracket 52 53### Multi-cursor 54 55- `C` — Duplicate cursor to line below 56- `Alt-C` — Duplicate cursor to line above 57- `,` — Remove primary cursor 58- `Alt-,` — Remove all secondary cursors 59 60## Strudel-Specific Features 61 62Currently, Helix mode in Strudel provides standard Helix keybindings. Unlike Vim mode, there are no custom Strudel-specific commands (like `:w` to evaluate) yet. 63 64To evaluate code while in Helix mode, use the standard shortcuts: 65 66- `Ctrl+Enter` or `Alt+Enter` — Evaluate code 67- `Alt+.` — Stop playback 68 69## Resources 70 71- [Helix Documentation](https://docs.helix-editor.com/) 72- [Helix Keymap](https://docs.helix-editor.com/keymap.html) 73- [codemirror-helix on npm](https://www.npmjs.com/package/codemirror-helix) 74- [codemirror-helix on GitLab](https://gitlab.com/_rvidal/codemirror-helix) 75 76## Notes 77 78- The `codemirror-helix` extension is described as an "initial version" and may not implement all Helix features 79- Behavior may differ slightly from the native Helix editor 80- If you encounter issues, you can switch back to other keybinding modes in Settings 81- The keybinding preference is saved in your browser's local storage 82 83## Contributing 84 85If you'd like to add Strudel-specific Helix commands (similar to Vim's `:w` for evaluate), contributions are welcome! See the implementation in `/packages/codemirror/keybindings.mjs` for reference.