nvim/lua/plugs/hop.lua

52 lines
1.2 KiB
Lua
Raw Normal View History

2023-10-09 16:14:40 +08:00
return {
"phaazon/hop.nvim",
branch = "v2",
2023-10-09 16:48:02 +08:00
keys = {
2024-01-16 20:16:19 +08:00
"f", "F", "t", "T",
2023-11-15 13:16:34 +08:00
"<c-f>"
2023-10-09 16:48:02 +08:00
},
lazy = true,
2024-01-16 20:16:19 +08:00
config = function()
require("hop").setup { keys = 'asdfghjkl;' }
2023-10-09 16:48:02 +08:00
local hop = require('hop')
local directions = require('hop.hint').HintDirection
2023-10-09 16:14:40 +08:00
G.map({
2024-01-16 20:16:19 +08:00
{ "n", "<c-f>", ":HopChar2MW<CR>", { noremap = true } },
{ "n", "f",
function()
2023-10-09 16:48:02 +08:00
hop.hint_char1({
direction = directions.AFTER_CURSOR,
current_line_only = true
})
2024-01-16 20:16:19 +08:00
end, { noremap = true }
2023-10-09 16:48:02 +08:00
},
2024-01-16 20:16:19 +08:00
{ "n", "F",
function()
2023-10-09 16:48:02 +08:00
hop.hint_char1({
direction = directions.BEFORE_CURSOR,
current_line_only = true
})
2024-01-16 20:16:19 +08:00
end, { noremap = true }
2023-10-09 16:48:02 +08:00
},
2024-01-16 20:16:19 +08:00
{ "n", "t",
function()
2023-10-09 16:48:02 +08:00
hop.hint_char1({
direction = directions.AFTER_CURSOR,
current_line_only = true,
hint_offset = -1
})
2024-01-16 20:16:19 +08:00
end, { noremap = true }
2023-10-09 16:48:02 +08:00
},
2024-01-16 20:16:19 +08:00
{ "n", "T",
function()
2023-10-09 16:48:02 +08:00
hop.hint_char1({
direction = directions.BEFORE_CURSOR,
current_line_only = true,
hint_offset = -1
})
2024-01-16 20:16:19 +08:00
end, { noremap = true }
2023-10-09 16:48:02 +08:00
},
2023-10-09 16:14:40 +08:00
})
end
}