-
I'm having a little trouble mapping {
"Lokaltog/vim-easymotion",
init = function()
vim.g.EasyMotion_smartcase = true
end,
keys = {
{ "<leader><leader>", "<plug>(easymotion-overwin-f)", desc = "jump to location", mode = "n" },
{ "<leader><leader>", "<plug>(easymotion-bd-f)", desc = "jump to location", mode = "v" },
},
}, This DOES work, though it's not lazy loaded: {
"Lokaltog/vim-easymotion",
init = function()
vim.g.EasyMotion_smartcase = true
end,
config = function()
vim.keymap.set(
"n",
"<leader><leader>",
"<plug>(easymotion-overwin-f)",
{ desc = "jump to location", noremap = true }
)
vim.keymap.set(
"v",
"<leader><leader>",
"<plug>(easymotion-bd-f)",
{ desc = "jump to location", noremap = true }
)
end,
}, and, finally, this DOES work and IS lazy loaded, but kinda janky: {
"Lokaltog/vim-easymotion",
init = function()
vim.g.EasyMotion_smartcase = true
end,
keys = {
{ "<leader><leader>", "<plug>(easymotion-overwin-f)", desc = "jump to location", mode = "n" },
{ "<leader><leader>", "<plug>(easymotion-bd-f)", desc = "jump to location", mode = "v" },
},
config = function()
vim.keymap.set(
"n",
"<leader><leader>",
"<plug>(easymotion-overwin-f)",
{ desc = "jump to location", noremap = true }
)
vim.keymap.set(
"v",
"<leader><leader>",
"<plug>(easymotion-bd-f)",
{ desc = "jump to location", noremap = true }
)
end,
}, How can I make the first one work? |
Beta Was this translation helpful? Give feedback.
Answered by
abeldekat
Sep 11, 2023
Replies: 1 comment 7 replies
-
The problem might be the location where your A working minimal setup: local root = vim.fn.fnamemodify("./.repro", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
local plugins = {
"folke/tokyonight.nvim",
{
"Lokaltog/vim-easymotion",
init = function()
vim.g.EasyMotion_smartcase = true
end,
keys = {
{ "<leader><leader>", "<plug>(easymotion-overwin-f)", desc = "jump to location", mode = "n" },
{ "<leader><leader>", "<plug>(easymotion-bd-f)", desc = "jump to location", mode = "v" },
},
},
}
vim.g.mapleader = " "
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
Best regards! |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found this:
Now, the keys work as expected.