Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Exploring a which-key like plugin for OpenCode while working on integrating the new OpenTUI keymap as sole key/cmd handling engine. OpenTUI keymap is extremely extensible by plugins and will enable a proper vim plugin with motions. Will follow up with details on the keymap.

35,392 görüntüleme • 1 ay önce •via X (Twitter)

0 Yorum

Yorum bulunmuyor

Orijinal gönderinin yorumları burada görünecek

Benzer Videolar

OpenTUI Keymap is a host agnostic key/cmd engine for DOM like apps. It allows extreme customisation of a generic core, from key stroke syntax parsing to to command resolution and dispatch behaviour. It composes layers of bindings and commands into a single adaptive dispatch model. Demo link in the replies. There are many such systems, most of which stop at the key binding part. Apps often are expected to implement their own command layer on top of these. This disconnects the bindings from the actual command registry. Looking for a proper solution usable in OpenCode I couldn't find anything that fulfilled the need of being extremely extensible to allow plugins to fully control key mapping and command behaviour. I wanted it to always be able to know exactly which keys and commands are reachable at any point in time, no matter from where and how the mappings are manipulated. The main driver was enabling a which-key like plugin and vim like bindings in a mostly declarative way. While any other plugin could extend the keymap even further with a custom config syntax for key strokes for example. So addons for it are mostly composable and it comes with a variety of addons providing common behaviour. It can also power other discovery features directly from live state. Help views, command palettes and graph/debug UIs can all ask the engine what is active, reachable, shadowed, pending, or dispatchable instead of rebuilding that knowledge separately. The core is intentionally very much generic: hosts adapt focus, hierarchy, input events, and lifecycle, while addons extend parsing, tokens, sequence patterns, command metadata, resolvers, interceptors, and event matching. The result is a keymap that plugins can compose with rather than work around. This could all be built directly into OpenCode and just be app specific. Working on OpenTUI though I want applications to have an out-of-the-box solution to build keyboard-first apps easily. Well, at least agents can. It is extremely over-engineered. And I love it. I hope some of you will too.

kmdr

90,747 görüntüleme • 1 ay önce