folke / flash.nvim

Navigate your code with search labels, enhanced character motions and Treesitter integration
Apache License 2.0
2.22k stars 27 forks source link

bug: cannot remap `f`, `F`, `t`, `T`, `;`, `.` #330

Open rwijtvliet opened 2 months ago

rwijtvliet commented 2 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9.2

Operating system/version

Ubuntu and MacOS

Describe the bug

I'm trying to use k and K for "till" and "till (backwards)", but there seems to be a bug and the keys will not trigger the action.

I'm using lazy.vim, and put the following file flash.lua in the plugins folder:

return {
  "folke/flash.nvim",
  event = "VeryLazy",
  opts = { modes = { char = { keys = { "f", "F", ["t"] = "k", ["T"] = "K", ";", "." } } } },
  -- also tried:
  -- opts = { modes = { char = { keys = { "f", "F", ";", ".", ["t"] = "k", ["T"] = "K" } } } },
}

The value of the keys table is how I interpret the documentation regarding Configuration, which has the following lines:

{
  --(...)
  modes = {
    --(...)
    char = {
      --(...)
      -- by default all keymaps are enabled, but you can disable some of them,
      -- by removing them from the list.
      -- If you rather use another key, you can map them
      -- to something else, e.g., { [";"] = "L", [","] = H }
      keys = { "f", "F", "t", "T", ";", "," },
      --(...)
    }
    --(...)
  }
  --(...)
} 

The bug is, that k moves the cursor up, instead of triggering the "till" action.

Steps To Reproduce

See "description"

Expected Behavior

Pressing k or K should trigger the till or till (backward) action.

Repro

No response

rwijtvliet commented 2 months ago

Might be related to https://github.com/folke/flash.nvim/issues/329