echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.54k stars 175 forks source link

"i" key has been remapped, "k" remap to "i", inside = "k" #880

Closed b1nhack closed 2 months ago

b1nhack commented 2 months ago

Contributing guidelines

Module(s)

mini.ai

Description

Since I'm a colemak user, I remaped i to l:

vim.keymap.set({ "n", "x" }, "i", "l")

To use v_iw, I added the following mapping:

vim.keymap.set({ "n", "x", "o" }, "k", "i")

To use mini.ai, I modified the default keymap:

                -- Main textobject prefixes
                around = "a",
                inside = "k",

                -- Next/last variants
                around_next = "an",
                inside_next = "kn",
                around_last = "ai",
                inside_last = "ki",

                -- Move cursor to corresponding edge of `a` textobject
                goto_left = "g[",
                goto_right = "g]",

But now I can't execute v_iw in x-mode (using key: kw)

Neovim version

neovim HEAD-3a82652

Steps to reproduce

  1. remap i to l
  2. remap k to i
  3. set mini.ai inside = "k"

Expected behavior

No response

Actual behavior

v_iw can't work

echasnovski commented 2 months ago

Thanks for issue!

Similar issue was discussed in #195 with suggested solution to use 'langmap' option to make proper remappings (instead of vim.keymap.set()).