Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rewrite)!: v3 is a full rewrite of which-key.nvim #624

Merged
merged 75 commits into from
Jul 12, 2024
Merged

feat(rewrite)!: v3 is a full rewrite of which-key.nvim #624

merged 75 commits into from
Jul 12, 2024

Conversation

folke
Copy link
Owner

@folke folke commented Jul 9, 2024

What's New?

  • full rewrite that works a little different than before
  • hooking into visual and operator pending mode is now done using ModeChanged, so no remapping needed anymore for operators.
  • the weird secret mappings, are gone for good
  • auto triggers are now never created for single keys apart from g and z. All other letters are unsafe.
  • customizable delay independent of timeoutlen. Can be 0.
  • more configuration options for the which-key window + presets for classic, modern and helix mode.
  • enable/disable which-key for certain mapping modes
  • configurable sorting, based on the concept of sorters. Builtin sorters include: local, order, group, alphanum, mod, lower, icase, desc, manual
  • new option to expand groups with less than x keymaps
  • configurable string replacement for key and desc. The default key formatter shows actual unicode keyboard keys.
  • icons! Needs mini.icons for the best support:
    • if you use lazy.nvim, then some icons will be autodetected for keymaps belonging to certain plugins.
    • custom rules to decide what icon to use
    • in your mapping spec, you can specify what icon to use at any level, so at the node for <leader>g for example, to apply to all git keymaps.
  • prevent which-key overlapping with the cursor position
  • improved API. One of my favorite new keymaps is <leader>? that shows which-key for the current buffer, but only with buffer-local mappings. So basically the help for all keymaps defined by a plugin :)
    image
  • new and better mappings spec, more in line with vim.keymap.set and how you define keymaps with lazy.nvim

Todo

  • create keymaps in register()
  • distinction between actual keymap and just a desc
  • virtual mappings wihtout real children?
  • registers / counts?
  • presets / plugins
  • config?
  • auto blacklist single keys for default keymaps (for mappings like aa, a hook would be created for a and a would be ignored)
  • custom sorting
  • gr doesn't work because of grn and friends
  • same for gc opmode and gc normal mode
  • yank and shift-paste hangs
  • macro recording / macro execution
  • spell
  • spell with count, like 1z=
  • which-key-ignore
  • empty groups?
  • timeoutlen and nowait
  • ui presets
  • ui opts & columns etc
  • scroll window
  • help text?
  • plugin layout?
  • ✅ 🔥🔥🚀
  • minimize attach
  • sometimes incorrectly attached gcc not working
  • error handling for view
  • spelling layout
  • better mappings parser? Especially needs typings
  • Mappings with mode v
  • allow register from opts
  • auto gen docs
  • health
  • <leader>gh_
  • devicons support
  • nowait, timeoutlen and delay
  • more tests
  • News
  • Update Readme
  • hint characters in desc
  • new mappings DSL

Related Issue(s)

Screenshots

Classic Mode
image

Modern Mode
image

Helix Mode
image

@folke folke marked this pull request as draft July 9, 2024 10:35
@folke folke changed the title V3 feat(rewrite)!: v3 is a full rewrite of which-key.nvim Jul 9, 2024
@folke folke mentioned this pull request Jul 12, 2024
3 tasks
@folke folke mentioned this pull request Jul 12, 2024
3 tasks
@folke folke marked this pull request as ready for review July 12, 2024 14:31
@folke folke merged commit 5bf10c3 into main Jul 12, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment