ggandor / leap.nvim

Neovim's answer to the mouse 🦘
MIT License
4.32k stars 47 forks source link

Conflict with lazy.nvim's default mappings #224

Open smartinellimarco opened 5 months ago

smartinellimarco commented 5 months ago

After creating and saving a new plugin spec in Lazy, Neovim will automatically open and install the plugin upon reopening. However, there's a conflict with the 'S' key, which Lazy uses for the 'Sync' operation, causing Leap to report a keymap conflict.

ggandor commented 4 months ago

Define the mappings manually then, instead of calling create_default_mappings, which does this check (see :help leap-custom-mappings).

ggandor commented 4 months ago

there's a conflict with the 'S' key, which Lazy uses for the 'Sync' operation

Where is this documented? Thx.

willhansen commented 4 months ago

there's a conflict with the 'S' key, which Lazy uses for the 'Sync' operation

Where is this documented? Thx.

Can't find on the Lazy github, but it shows up in the in-vim menu: image

Edit: Here's the workaround I'm using that the first reply suggests:

  {"ggandor/leap.nvim",
    lazy = false,
    config = function() 
      -- require('leap').create_default_mappings()
      vim.keymap.set({'n', 'x', 'o'}, 's',  '<Plug>(leap-forward)')
      vim.keymap.set({'n', 'x', 'o'}, 'S',  '<Plug>(leap-backward)')
      vim.keymap.set({'n', 'x', 'o'}, 'gs', '<Plug>(leap-from-window)')
    end,
  },