nvim/lua/normal/plugsettings/hop.lua

57 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 = {
2023-10-10 18:26:42 +08:00
"f","F","t","T",
"<leader>f", "<leader>F"
2023-10-09 16:48:02 +08:00
},
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({
2023-10-10 18:09:35 +08:00
{"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
}