Skip to content

Commit

Permalink
feat(motion)!: separate flit.nvim from leap.nvim (#281)
Browse files Browse the repository at this point in the history
if you use flit you have to add it separately
  • Loading branch information
owittek authored Jun 17, 2023
1 parent b4502e5 commit dcaf64c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 32 deletions.
5 changes: 5 additions & 0 deletions lua/astrocommunity/motion/flit-nvim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# flit.nvim

**Repository:** https://github.com/ggandor/flit.nvim

f/F/t/T motions on steroids, building on the Leap interface.
20 changes: 20 additions & 0 deletions lua/astrocommunity/motion/flit-nvim/flit-nvim.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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",
dependencies = {
"tpope/vim-repeat",
},
},
},
}
4 changes: 1 addition & 3 deletions lua/astrocommunity/motion/leap-nvim/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# flit.nvim
# leap.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).
44 changes: 15 additions & 29 deletions lua/astrocommunity/motion/leap-nvim/leap-nvim.lua
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
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,
dependencies = {
"tpope/vim-repeat",
},
},
"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,
dependencies = {
"tpope/vim-repeat",
},
}

0 comments on commit dcaf64c

Please sign in to comment.