diff --git a/lua/astrocommunity/motion/leap-nvim/README.md b/lua/astrocommunity/motion/leap-nvim/README.md new file mode 100644 index 000000000..e2bea8cd4 --- /dev/null +++ b/lua/astrocommunity/motion/leap-nvim/README.md @@ -0,0 +1,7 @@ +# flit.nvim + +**Repository:** https://github.com/ggandor/leap.nvim + +:kangaroo: Neovim's answer to the mouse + +This also includes [flit.nvim](https://github.com/ggandor/flit.nvim). diff --git a/lua/astrocommunity/motion/leap-nvim/leap-nvim.lua b/lua/astrocommunity/motion/leap-nvim/leap-nvim.lua new file mode 100644 index 000000000..60b2d4bde --- /dev/null +++ b/lua/astrocommunity/motion/leap-nvim/leap-nvim.lua @@ -0,0 +1,29 @@ +return { + { + "ggandor/flit.nvim", + keys = function() + ---@type LazyKeys[] + local ret = {} + for _, key in ipairs { "f", "F", "t", "T" } do + ret[#ret + 1] = { key, mode = { "n", "x", "o" }, desc = key } + end + return ret + end, + opts = { labeled_modes = "nx" }, + dependencies = { + "ggandor/leap.nvim", + keys = { + { "s", mode = { "n", "x", "o" }, desc = "Leap forward to" }, + { "S", mode = { "n", "x", "o" }, desc = "Leap backward to" }, + { "gs", mode = { "n", "x", "o" }, desc = "Leap from windows" }, + }, + config = function(_, opts) + local leap = require "leap" + for k, v in pairs(opts) do + leap.opts[k] = v + end + leap.add_default_mappings(true) + end, + }, + }, +}