Skip to main content

duck vim Course

Learn duck-vim from scratch. 8 lessons that take you from zero to building production keyboard interfaces.

Prerequisites: Basic TypeScript/JavaScript knowledge. Lessons 4+ assume familiarity with React.


Lessons

#TitleWhat you'll learn
1IntroductionWhy keyboard shortcuts matter, how duck-vim works at a high level
2Your First ShortcutRegistry, KeyHandler, and registering your first binding
3Understanding Key Binding StringsParsing, aliases, the Mod key, and validation
4React IntegrationKeyProvider, useKeyBind, and useKeyCommands
5Multi-Key SequencesVim-style sequences like g+d, timeout, and prefix matching
6Display FormattingRendering shortcuts in your UI with platform-aware labels
7Key Recorder and SettingsBuilding a shortcut customization UI
8Advanced PatternsScoped bindings, command palettes, conflict detection, and testing

How to follow along

Each lesson includes complete, copy-pasteable code. You can either:

Read the lessons in order for a conceptual understanding. No setup required.

Setup

Create a new Vite project with React and TypeScript:

npm create vite@latest duck-vim-playground --template react-ts
npm create vite@latest duck-vim-playground --template react-ts

Navigate into the project directory:

cd duck-vim-playground
cd duck-vim-playground

Install duck-vim:

npm install @gentleduck/vim
npm install @gentleduck/vim

Start the dev server:

npm run dev
npm run dev