Multi-cursor mode
Keybinding: q
Reason: q
is used to start recording a macro in Vim, but I realized 80% of the time what I need is multi-cursors, not a macro.
Multi-cursor mode works through two main mechanisms: Movement and Selection Mode.
Unlike other editors where there are specific keybindings for adding cursors in specific ways, Ki gives you the freedom to add cursors by either:
- Using Movement commands to place additional cursors
- Changing the Selection Mode to split existing selections into multiple cursors
This flexibility allows you to:
- Add a cursor to the next word
- Add cursors until the last line
- Add a cursor to the previous diagnostic
- Add a cursor to an oddly specific place
- Add cursors to all lines within current selection(s)
These are just examples - the true power of multi-cursor mode comes from combining Movement and Selection Mode in creative ways. Unleash your imagination!
1. Movements
In the Multi-cursor mode, every core movement means:
Add a cursor with <movement>
2. Selection Mode Changes
In the Multi-cursor mode, changing the selection mode means:
Split each selection by the new selection mode
3. Filter selections
Keybindings:
m
: Maintain matching selectionsr
: Remove matching selections
This is only used when there's more than 1 selection/cursor, and you want to remove some selections.
4. Add to all matching selections
Keybinding: q
5. Keep primary cursor only
Keybinding: o
6. Delete primary cursor
Keybindings:
d
: Delete primary cursor forwardD
: Delete primary cursor backward