Move key-bonding of Hop into hop.lua

This commit is contained in:
2025-04-10 09:36:37 +08:00
parent f999df7ffb
commit 1fb721ead7
3 changed files with 116 additions and 62 deletions

View File

@@ -1,9 +1,60 @@
return{
{
'smoka7/hop.nvim',
version = "*",
opts = {
keys = 'etovxqpdygfblzhckisuran'
}
}
{
'smoka7/hop.nvim',
version = "*",
opts = {
keys = 'etovxqpdygfblzhckisuran'
},
keys = {
{
'<leader>f',
function()
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true })
end,
desc = 'Hop forward',
},
{
'<leader>F',
function()
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true })
end,
desc = 'Hop backward',
},
{
'<leader>t',
function()
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })
end,
desc = 'Hop forward (offset)',
},
{
'<leader>T',
function()
require('hop').hint_char1({ direction = require('hop.hint').HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })
end,
desc = 'Hop backward (offset)',
},
{
'<leader>s',
function()
require('hop').hint_char1()
end,
desc = 'Hop anywhere',
},
{
'<leader>S',
function()
require('hop').hint_char2()
end,
desc = 'Hop anywhere (2 chars)',
},
{
'<leader>sw',
function()
require('hop').hint_words()
end,
desc = 'Hop words',
},
}
}
}