2022-09-12 13:48:29 +02:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
function M.setup()
|
2022-10-09 03:28:51 +02:00
|
|
|
local opts = function(desc)
|
2022-11-14 01:16:10 +01:00
|
|
|
return { desc = desc, silent = true }
|
2022-10-09 03:28:51 +02:00
|
|
|
end
|
2022-11-14 01:16:10 +01:00
|
|
|
|
|
|
|
local modes = { "n", "v", "o" }
|
|
|
|
|
|
|
|
vim.keymap.set(modes, "qf", "<Plug>(easymotion-bd-f)", opts("Hop to char"))
|
|
|
|
vim.keymap.set(modes, "qj", "<Plug>(easymotion-overwin-f2)", opts("Hop to char pair"))
|
|
|
|
vim.keymap.set(modes, "qw", "<Plug>(easymotion-bd-w)", opts("Hop to word"))
|
|
|
|
vim.keymap.set(modes, "qL", "<Plug>(easymotion-bd-L)", opts("Hop to line (?)"))
|
2022-10-09 03:28:51 +02:00
|
|
|
|
|
|
|
local status, wk = pcall(require, "which-key")
|
|
|
|
|
2022-11-14 01:16:10 +01:00
|
|
|
if status then wk.register({ q = { name = "Easymotion" } }, { mode = "o" }) end
|
2022-09-12 13:48:29 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|