41 lines
1.1 KiB
Lua
41 lines
1.1 KiB
Lua
-- See: https://github.com/phaazon/hop.nvim/wiki/Configuration
|
|
local hop = require("hop")
|
|
require("hop").setup({})
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- Keybindings
|
|
|
|
local hint = require("hop.hint")
|
|
|
|
vim.keymap.set("", "f", function()
|
|
hop.hint_char1({
|
|
direction = hint.HintDirection.AFTER_CURSOR,
|
|
current_line_only = true,
|
|
})
|
|
end)
|
|
vim.keymap.set("", "F", function()
|
|
hop.hint_char1({
|
|
direction = hint.HintDirection.BEFORE_CURSOR,
|
|
current_line_only = true,
|
|
})
|
|
end)
|
|
vim.keymap.set("", "t", function()
|
|
hop.hint_char1({
|
|
direction = hint.HintDirection.AFTER_CURSOR,
|
|
current_line_only = true,
|
|
hint_offset = -1,
|
|
})
|
|
end)
|
|
vim.keymap.set("", "T", function()
|
|
hop.hint_char1({
|
|
direction = hint.HintDirection.BEFORE_CURSOR,
|
|
current_line_only = true,
|
|
hint_offset = 1,
|
|
})
|
|
end)
|
|
|
|
vim.keymap.set("n", "<leader>hc", "<Cmd>HopChar1<CR>")
|
|
vim.keymap.set("n", "<leader>hw", "<Cmd>HopWord<CR>")
|
|
vim.keymap.set("n", "<leader>hp", "<Cmd>HopPattern<CR>")
|
|
vim.keymap.set("n", "<leader>hl", "<Cmd>HopLine<CR>")
|
|
vim.keymap.set("n", "<leader>hv", "<Cmd>HopVertical<CR>")
|