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

refactor(keymap)!: make map! macro non-recursively by default #144

Merged
merged 16 commits into from
Dec 13, 2022

Conversation

aileot
Copy link
Owner

@aileot aileot commented Dec 11, 2022

  • Make map! macro set keymap non-recursively by default:
    • Without <Plug> mappings in rhs, noremap is generally preferable.
  • Deprecate noremap! and map! wrappers:
    • noremap! is now completely redundant because map! has come to work as the same.
    • For users who only uses vim.keymap.set-format, the wrappers are simply oversupplied; some might feels them rather annoying overheads.
    • Users who prefer such wrappers can create their own wrappers as many as they want in their own environment. (It's not so hard, though tedious.)

@aileot aileot force-pushed the refactor-keymap-map_for_noremap branch from 0ff8cbb to 0f0725c Compare December 11, 2022 20:57
@aileot aileot marked this pull request as ready for review December 11, 2022 21:09
@aileot aileot marked this pull request as draft December 11, 2022 21:09
@aileot aileot force-pushed the refactor-keymap-map_for_noremap branch from 9db4d57 to 0b06237 Compare December 12, 2022 12:14
@aileot aileot marked this pull request as ready for review December 12, 2022 12:18
Without `<Plug>` mappings in rhs (or callback function in rhs),
`noremap` is generally preferable.

BREAKING-CHANGE: `map!` sets keymap non-recursively by default; `map!` requires `remap` option to set recursive mapping
Reasons to deprecate them:
- For users who only uses `vim.keymap.set`-format, the wrappers are
  simply oversupplied; some might feels them rather annoying overheads.
- Users who prefer such wrappers can create their own wrappers as many
  as they want in their own environment.
- `map!` now works as the same way as `noremap!`, which has become
  completely redundant.
@aileot aileot force-pushed the refactor-keymap-map_for_noremap branch from 0b06237 to ae2d176 Compare December 13, 2022 12:00
@aileot aileot merged commit d086443 into main Dec 13, 2022
@aileot aileot deleted the refactor-keymap-map_for_noremap branch December 13, 2022 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant