mirror of
https://github.com/DefectingCat/nvim
synced 2025-07-15 16:51:33 +00:00
update hop mappings
This commit is contained in:
@ -2,25 +2,37 @@ return {
|
||||
"phaazon/hop.nvim",
|
||||
branch = "v2",
|
||||
keys = {
|
||||
{ "f", desc = "" },
|
||||
{ "F", desc = "" },
|
||||
{ "<leader><leader>", desc = "" },
|
||||
{
|
||||
"f",
|
||||
function()
|
||||
local hop = require("hop")
|
||||
local directions = require("hop.hint").HintDirection
|
||||
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = false })
|
||||
end,
|
||||
desc = "Hop motion search in current line after cursor",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
{
|
||||
"F",
|
||||
function()
|
||||
local hop = require("hop")
|
||||
local directions = require("hop.hint").HintDirection
|
||||
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false })
|
||||
end,
|
||||
desc = "Hop motion search in current line before cursor",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
{
|
||||
"<leader><leader>",
|
||||
function()
|
||||
local hop = require("hop")
|
||||
hop.hint_words({ current_line_only = false })
|
||||
end,
|
||||
desc = "Hop motion search words after cursor",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
keys = "etovxqpdygfblzhckisuran",
|
||||
},
|
||||
config = function()
|
||||
local hop = require("hop")
|
||||
hop.setup({ keys = "etovxqpdygfblzhckisuran" })
|
||||
|
||||
local map = vim.keymap.set
|
||||
map({ "n", "v" }, "f", function()
|
||||
local directions = require("hop.hint").HintDirection
|
||||
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = false })
|
||||
end, { desc = "Hop motion search in current line after cursor" })
|
||||
map({ "n", "v" }, "F", function()
|
||||
local directions = require("hop.hint").HintDirection
|
||||
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false })
|
||||
end, { desc = "Hop motion search in current line before cursor" })
|
||||
map({ "n", "v" }, "<leader><leader>", function()
|
||||
hop.hint_words({ current_line_only = false })
|
||||
end, { desc = "Hop motion search words after cursor" })
|
||||
end,
|
||||
}
|
||||
|
Reference in New Issue
Block a user