2. Store a new learning

June 24, 2026 · View on GitHub

███████╗███████╗██╗  ██╗       ██╗     ███████╗ █████╗ ██████╗ ███╗   ██╗
╚══███╔╝██╔════╝██║  ██║       ██║     ██╔════╝██╔══██╗██╔══██╗████╗  ██║
  ███╔╝ ███████╗███████║ █████╗██║     █████╗  ███████║██████╔╝██╔██╗ ██║
 ███╔╝  ╚════██║██╔══██║ ╚════╝██║     ██╔══╝  ██╔══██║██╔══██╗██║╚██╗██║
███████╗███████║██║  ██║       ███████╗███████╗██║  ██║██║  ██║██║ ╚████║
╚══════╝╚══════╝╚═╝  ╚═╝       ╚══════╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝

CI License: MIT zsh

[MYSQL-BACKED LEARNING COLLECTION FOR ZSH // SAVE, QUERY, QUIZ]

"Every command you forgot, recoverable."

strykelang · zshrs · MenkeTechnologiesMeta · zsh-more-completions · zsh-git-acp · zsh-expand · zpwr

Read the Docs · Engineering Report


Table of Contents


[0x00] > SYSTEM.INIT

This plugin turns your terminal into a persistent knowledge base. Store what you learn, search it instantly, and drill yourself with randomized quizzes — all without leaving the command line.

  • Save code snippets, one-liners, notes, anything
  • Search with filters, fzf fuzzy matching, or random sampling
  • Quiz yourself for spaced recall and permanent retention
  • Edit entries in-place with your $EDITOR
  • Manage with delete, redo, and full SQL access

[0x01] > INSTALL.EXEC

Zinit

Add to ~/.zshrc:

source "$HOME/.zinit/bin/zinit.zsh"
zinit ice lucid nocompile
zinit load MenkeTechnologies/zsh-learn

[0x02] > CONFIG.ENV

VariableDefaultDescription
ZPWR_LEARN_COMMANDmysqlDatabase command to execute queries
ZPWR_SCHEMA_NAMErootSchema name for the learning table
ZPWR_TABLE_NAMELearningCollectionTable name for stored entries
# Example: MariaDB with unix auth
export ZPWR_LEARN_COMMAND='sudo mysql'

# Custom schema.table (set before CreateLearningCollection)
export ZPWR_SCHEMA_NAME="root"
export ZPWR_TABLE_NAME="LearningCollection"

Migration: the default table name was LearningCollectiion (typo) before the rename. Existing installs: RENAME TABLE root.LearningCollectiion TO root.LearningCollection; or keep the old table with export ZPWR_TABLE_NAME=LearningCollectiion.


[0x03] > COMMAND.MATRIX

Write Operations

CommandArgsDescription
leLEARNINGInsert a new learning entry
editlIDOpen entry by ID in $EDITOR for editing
del[N]Delete last N entries (default: 1)
delidIDDelete a specific entry by ID

Search Operations

CommandArgsDescription
se[FILTER...]Search learning column with optional filters
see[FILTER]Search with learning + category columns
seeeSearch with learning + category + date columns
sefSearch all entries via fzf (most recent first)

Randomized Recall

CommandArgsDescription
ser[N]N random entries (default: 100)
seraAll entries in random order
qu[N]N random entries piped to fzf (default: 100)
quaAll entries randomized in fzf

SQL & Redo

CommandArgsDescription
re[ID|FILTER]Print matching entries with SQL update statements
rsql[ID|FILTER]Same as re but opens in vim

Admin

CommandDescription
zsh-learn-CreateLearningCollectionGenerate DDL and create the learning table
zsh-learn-DropLearningCollectionDrop the learning table

[0x04] > KEYBIND.MAP

┌─────────────────────────────────────────────┐
│  MODE          BINDING     ACTION            │
│  ─────────────────────────────────────────── │
│  vim insert    Ctrl+K      zsh-learn-Learn   │
│  vim normal    Ctrl+K      zsh-learn-Learn   │
│  emacs         Ctrl+K      zsh-learn-Learn   │
└─────────────────────────────────────────────┘
bindkey -M viins '^k' zsh-learn-Learn
bindkey -M vicmd '^k' zsh-learn-Learn
bindkey -M emacs '^k' zsh-learn-Learn

[0x05] > WORKFLOW.EXAMPLE

# 1. Initialize the database
zsh-learn-CreateLearningCollection

# 2. Store a new learning
le "git rebase -i HEAD~3  # interactive rebase last 3 commits"

# 3. Search your knowledge
se rebase

# 4. Quiz yourself with 50 random entries
qu 50

# 5. Fuzzy search everything
sef

[0x06] > PROJECT.STRUCT

zsh-learn/
├── zsh-learn.plugin.zsh     # Main plugin entry point
├── autoload/                 # Lazy-loaded functions
│   ├── zsh-learn-Learn       # Core insert function
│   ├── zsh-learn-Searchl     # Search engine
│   ├── zsh-learn-Get         # Query interface
│   ├── del                   # Delete operations
│   ├── zsh-learn-DeleteId    # Delete by ID (delid alias)
│   ├── qu / qua              # Quiz functions
│   ├── sef                   # fzf search (se/see/seee are plugin aliases)
│   ├── ser / sera            # Random recall
│   └── ...                   # Additional utilities
├── src/                      # Completions
│   └── _se                   # Tab completion for se
└── tests/                    # Test suite
    ├── t-syntax.zsh          # Syntax validation
    ├── t-unit.zsh            # Unit tests
    └── ...                   # Contract + repo hygiene checks