Skip to content

fix(mini.ai): resolve conflicting keymaps - #2190

Open
nathanzeng wants to merge 1 commit into
nvim-lua:masterfrom
nathanzeng:ai-maps
Open

nathanzeng wants to merge 1 commit into
nvim-lua:masterfrom
nathanzeng:ai-maps

Conversation

@nathanzeng

Copy link
Copy Markdown
Contributor

Problem:
The default keymaps for mini.ai conflict with the new al and il text objects from neovim 0.13.

Also, the current aa keymap for around next conflicts with the mini.ai around argument keymap. It's uncertain whether the current ii keymap conflicts with anything, but it has potential to conflict with inside indent text objects from indent line plugins.

Solution:
Configure mini.ai to use aN, iN, aL, and iL.

NOTE: this PR becomes much more important once 0.13 is released, but it does not require it or drop support for 0.12

Problem:
The default keymaps for mini.ai conflict with the new `al` and `il` text
objects from neovim 0.13.

Also, the current `aa` keymap for around next conflicts with the mini.ai
around argument keymap. It's uncertain whether the current `ii` keymap
conflicts with anything, but it has potential to conflict with inside
indent text objects from indent line plugins.

Solution:
Configure mini.ai to use `aN`, `iN`, `aL`, and `iL`.
@oriori1703

Copy link
Copy Markdown
Collaborator

Though I hate to change the keybinds for those again, I do think this is probably the right thing to do for kickstart.
We aim to be a pseudo-tutorial for creating a neovim, so therefore we should try to change the meaning of keybinds as little as possible.
(I don't consider the lsp keybinds to change the meaning, because they do the same thing, just with better UI).

Despite that. I will give it a bit of time before merging, so people can give their opinions (considering the last change for those keybinds was controversial).
@echasnovski do you have any opinions / recommendations on this matter?

@echasnovski

Copy link
Copy Markdown
Contributor

@echasnovski do you have any opinions / recommendations on this matter?

My personal opinion is that al / il / an / in are more useful the way they are set up in 'mini.ai'. Maybe requires a little bit of practice, but I definitely use them significantly more than "buffer/line textobject" (in any capacity) or "tree-sitter incremental selection" ('mini.ai' itself has incremental selection for any of its textobjects, which is enough for me; the reimagined version of default an / in is also planned within 'mini.nvim').

So overall I settled on aB / iB as "buffer textobject" with 'mini.ai' default search method prefixes. The incremental selection can be remapped if needed. If this doesn't align with 'kickstart.nvim' goals, then indeed using upper case N and L is better than aa and ii.

A more "official" source source is 'mini.ai' documentation itself.

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.

3 participants