ggandor / leap.nvim

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

Config example for bidirectional search #201

Closed skanti closed 8 months ago

skanti commented 9 months ago

Hi, I'm struggling to understand how to activate bidirectional search because I believe the documentation is impartial or only vaguely explains how to do it. Could you please add a working example to the doc?

ggandor commented 9 months ago

Hi! What is unclear about the snippet? This is all you have to do. <modes> is e.g. {'n', 'x', 'o'}, <key> is the key you want to use, e.g. 's'. :help vim.keymap.set. Should I change it to something like vim.keymap.set({'n', 'x', 'o'}, 's', function () ... end)?

vim.keymap.set(<modes>, <key>, function ()
  require('leap').leap { target_windows = { vim.api.nvim_get_current_win() } }
end)
ggandor commented 8 months ago

6362976