Closes the gaps between the positions of your new cards and resets Anki's position counter (nextPos) to the value after the last card. Turns positions like 1, 2, 3, 7, 9, 9, 12 into 1, 2, 3, 4, 5, 5, 6.
Key rule: equal positions stay equal. Distinct positions are renumbered gap-free, while cards that shared a position keep sharing one afterwards. Duplicates are preserved, not split apart.
Usage
- Tools β "Kartenpositionen defragmentierenβ¦"
- Shows a summary (new cards, distinct positions, affected cards, new counter) and asks before changing anything
- One undo step β fully reversible with Undo
- Optional keyboard shortcut (configurable)
Behaviour
- Only new cards are touched; review/learning cards are never modified
- Stable order by (position, card id) β your learning order is kept
- Only cards whose position actually changes are written (sync-friendly)
- Changes card positions and the nextPos counter only β never fields or notes
Developed for modern Anki (Qt6).
Source & issues
https://github.com/david-becher/anki-defragment-positions
Licensed under the MIT License.