Refactor Leap and make sure we can leap in o-mode, which means we can
for instance delete using a leap motion. Very nice
This commit is contained in:
parent
cb806f7adc
commit
cf1fa53b59
1 changed files with 20 additions and 9 deletions
|
|
@ -65,35 +65,46 @@ return {
|
||||||
|
|
||||||
local leap_user = require("leap.user")
|
local leap_user = require("leap.user")
|
||||||
local leap_remote = require("leap.remote")
|
local leap_remote = require("leap.remote")
|
||||||
|
local function leap_across_windows()
|
||||||
|
leap.leap({
|
||||||
|
target_windows = leap_user.get_focusable_windows()
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function leap_in_current_buffer()
|
||||||
|
leap.leap({
|
||||||
|
target_windows = { vim.api.nvim_get_current_win() }
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function leap_remote_action()
|
||||||
|
leap_remote.action()
|
||||||
|
end
|
||||||
|
|
||||||
utils.add_keymaps({
|
utils.add_keymaps({
|
||||||
n = {
|
n = {
|
||||||
["l"] = {
|
["l"] = {
|
||||||
cmd = function()
|
cmd = function()
|
||||||
-- Make sure we can Leap to any window
|
leap_across_windows()
|
||||||
leap.leap({
|
|
||||||
target_windows = leap_user.get_focusable_windows()
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
["gl"] = {
|
["gl"] = {
|
||||||
cmd = function()
|
cmd = function()
|
||||||
leap_remote.action()
|
leap_remote_action()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
v = {
|
v = {
|
||||||
["l"] = {
|
["l"] = {
|
||||||
cmd = function()
|
cmd = function()
|
||||||
leap.leap({
|
leap_in_current_buffer()
|
||||||
target_windows = { vim.api.nvim_get_current_win() }
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
o = {
|
o = {
|
||||||
["l"] = {
|
["l"] = {
|
||||||
cmd = function()
|
cmd = function()
|
||||||
leap_remote.action()
|
leap_in_current_buffer()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue