Go to file
Levi Neely 617b526e3f M2: command palette widget + ranked list model
- PaletteModel: QAbstractListModel ranking items via FuzzyRanker, with
  id/label/group/score and highlight-range roles plus a frecency bonus.
  Headless, unit-tested (10 cases).
- PaletteWidget: frameless popup with a filter line and results list.
  Live company-style updates, top hit preselected, custom delegate bolds
  matched characters. Keyboard (Up/Down/PageUp/PageDown/Enter/Esc, focus
  kept in the filter) and mouse (click to activate). No chords.
- Tighten FuzzyRanker typo tolerance: single adjacent transposition instead
  of deletion. Still recovers 'gti'->'git' but no longer false-matches
  'ren' against 'Open File'.

All tests green: fuzzyranker (14) + palettemodel (10).
2026-10-07 15:49:48 +02:00
docs M2: command palette widget + ranked list model 2026-10-07 15:49:48 +02:00
src M2: command palette widget + ranked list model 2026-10-07 15:49:48 +02:00
.gitignore Initial commit: FuzzyRanker keystone + project plan 2026-10-07 15:45:58 +02:00
CMakeLists.txt M2: command palette widget + ranked list model 2026-10-07 15:49:48 +02:00
README.md M2: command palette widget + ranked list model 2026-10-07 15:49:48 +02:00

README.md

kate-custom

A suite of Kate plugins for people who despise menus. The aim is a text editor that is driven by the mouse at the cursor and by plain-letter keyboard input — never by hunting through nested menubars or memorizing complex chords.

Design constraints

These are hard constraints that shape every decision:

  • Mouse-heavy. The fastest input is the mouse, used locally at the caret (radial / floating surfaces), not a trek to the menubar.
  • One-handed typing. Keyboard input must work comfortably with one hand.
  • No complex chords. Single modifier at most (Ctrl+letter). No leader-key chord trees, no multi-cursor keybinds.
  • Compact keyboard. F-keys and nav clusters live on a layer toggle, so they carry extra cognitive cost and are avoided as primary triggers.
  • Emacs/Sublime fluency. M-x (Alt+x) is comfortable and welcome as a primary keyboard entry point, as is a Sublime-style type-to-filter palette.

Unifying principle

One action registry. Three doors onto it: M-x (keyboard), a radial caret menu (mouse), and the : command line (optional). No action requires an F-key or a chord.

Why not just use Kate's command bar?

Kate's KCommandBar is a sealed widget: it accepts a list of actions via setActions() and exposes no hook to customize its matcher. Its matcher, KFuzzyMatcher, is single-needle, strictly in-order subsequence, with no typo tolerance — by KDE's own documentation, "gti" will not match "git". There is no "orderless" (space-separated tokens in any order) and no company-style live completion.

So the project replaces the palette rather than extending it, built on a custom matcher (FuzzyRanker).

Environment

  • Kate 25.12.3, KDE Frameworks 6, Qt 6
  • C++20, CMake, extra-cmake-modules
  • C++ is the only first-class plugin path on this install (no Python/Pâté binding present)

Build

cmake -B build -S .
cmake --build build
QT_QPA_PLATFORM=offscreen ./build/bin/test_fuzzyranker   # run the matcher tests
ctest --test-dir build                                   # or via ctest

Status

See docs/PLAN.md for the full roadmap.

  • Milestone 1 — FuzzyRanker (keystone): DONE. Orderless, layered scoring (exact / substring / word-initials / subsequence / bounded typo), merged highlight ranges. 14 unit tests, all green.
  • Milestone 2 — custom palette widget: DONE. PaletteModel + PaletteWidget (frameless popup, live filtering, highlighted matches, keyboard + mouse activation). 10 model unit tests, all green.
  • Milestone 3 — KTextEditor plugin + M-x + action registry: next.

Layout

CMakeLists.txt            top-level KF6/Qt6/ECM project
src/
  fuzzy/
    fuzzyranker.{h,cpp}   orderless + layered fuzzy matcher
    test_fuzzyranker.cpp  QTest suite
  palette/
    palettemodel.{h,cpp}  ranked, filterable list model (headless)
    palettewidget.{h,cpp} frameless command-palette popup
    test_palettemodel.cpp QTest suite
docs/
  PLAN.md                 goal, constraints, roadmap