nvim/lua/normal/plugsettings/hop.lua

56 lines
1.3 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
cmd = {
"HopChar1MW",
"HopChar2MW",
},
keys = {
"f","F","t","T"
},
lazy = true,
2023-10-09 16:14:40 +08:00
config = function ()
2023-10-09 16:48:02 +08:00
require("hop").setup{keys = 'asdfghjkl;'}
local hop = require('hop')
local directions = require('hop.hint').HintDirection
2023-10-09 16:14:40 +08:00
G.map({
{"n", "<leader>f", ":HopChar1MW<CR>", {noremap = true}},
{"n", "<leader>F", ":HopChar2MW<CR>", {noremap = true}},
2023-10-09 16:48:02 +08:00
{"n", "f",
function ()
hop.hint_char1({
direction = directions.AFTER_CURSOR,
current_line_only = true
})
end, {noremap = true}
},
{"n", "F",
function ()
hop.hint_char1({
direction = directions.BEFORE_CURSOR,
current_line_only = true
})
end, {noremap = true}
},
{"n", "t",
function ()
hop.hint_char1({
direction = directions.AFTER_CURSOR,
current_line_only = true,
hint_offset = -1
})
end, {noremap = true}
},
{"n", "T",
function ()
hop.hint_char1({
direction = directions.BEFORE_CURSOR,
current_line_only = true,
hint_offset = -1
})
end, {noremap = true}
},
2023-10-09 16:14:40 +08:00
})
end
}