diff --git a/lua/plugins/navigation.lua b/lua/plugins/navigation.lua index e96d7ea..9949fde 100644 --- a/lua/plugins/navigation.lua +++ b/lua/plugins/navigation.lua @@ -31,5 +31,31 @@ return { { "fh", "lua require('telescope.builtin').help_tags()", desc = "Help Tags" }, { "gf", "Telescope file_browser path=%:p:h", desc = "Open File Under Cursor" }, } + }, + { + "easymotion/vim-easymotion", + keys = { -- 所有键位都通过 lazy.nvim 的 keys 字段定义 + -- f{char} 跳转到字符(跨窗口) + { "f", "(easymotion-overwin-f)", mode = "n", desc = "EasyMotion 跳转字符" }, + { "f", "(easymotion-bd-f)", mode = { "x", "o" }, desc = "EasyMotion 跳转字符(可视模式)" }, + + -- s{char}{char} 跳转到双字符 + { "s", "(easymotion-overwin-f2)", mode = "n", desc = "EasyMotion 跳转双字符" }, + + -- L 跳转行(上下) + { "L", "(easymotion-overwin-line)", mode = "n", desc = "EasyMotion 跳转行" }, + { "L", "(easymotion-bd-jk)", mode = { "x", "o" }, desc = "EasyMotion 跳转行(可视模式)" }, + + -- w 跳转单词 + { "w", "(easymotion-overwin-w)", mode = "n", desc = "EasyMotion 跳转单词" }, + { "w", "(easymotion-bd-w)", mode = { "x", "o" }, desc = "EasyMotion 跳转单词(可视模式)" }, + }, + init = function() + -- 基础配置 + vim.g.EasyMotion_do_mapping = 0 -- 禁用默认映射 + vim.g.EasyMotion_smartcase = 1 -- 智能大小写 + vim.g.EasyMotion_keys = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" -- 跳转标签 + end, + } }