2022-09-18 16:10:03 +03:00
|
|
|
-- See: https://github.com/phaazon/hop.nvim/wiki/Configuration
|
|
|
|
local hop = require("hop")
|
|
|
|
require("hop").setup({})
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
-- Keybindings
|
|
|
|
|
|
|
|
local hint = require("hop.hint")
|
|
|
|
|
2022-11-08 12:12:18 +03:00
|
|
|
vim.keymap.set("", "<leader>hc", "<Cmd>HopChar1<CR>")
|
|
|
|
vim.keymap.set("", "<leader>hlc", function()
|
2022-09-18 16:10:03 +03:00
|
|
|
hop.hint_char1({
|
|
|
|
direction = hint.HintDirection.AFTER_CURSOR,
|
|
|
|
current_line_only = true,
|
|
|
|
})
|
|
|
|
end)
|
2022-11-08 12:12:18 +03:00
|
|
|
vim.keymap.set("", "<leader>hhc", function()
|
2022-09-18 16:10:03 +03:00
|
|
|
hop.hint_char1({
|
|
|
|
direction = hint.HintDirection.BEFORE_CURSOR,
|
|
|
|
current_line_only = true,
|
|
|
|
})
|
|
|
|
end)
|
2022-11-08 12:12:18 +03:00
|
|
|
vim.keymap.set("", "<leader>hjc", function()
|
2022-09-18 16:10:03 +03:00
|
|
|
hop.hint_char1({
|
|
|
|
direction = hint.HintDirection.AFTER_CURSOR,
|
|
|
|
})
|
|
|
|
end)
|
2022-11-08 12:12:18 +03:00
|
|
|
vim.keymap.set("", "<leader>hkc", function()
|
2022-09-18 16:10:03 +03:00
|
|
|
hop.hint_char1({
|
|
|
|
direction = hint.HintDirection.BEFORE_CURSOR,
|
|
|
|
})
|
|
|
|
end)
|
|
|
|
|
2022-10-02 22:24:30 +03:00
|
|
|
vim.keymap.set("", "<leader>hw", "<Cmd>HopWord<CR>")
|
2022-11-08 12:12:18 +03:00
|
|
|
vim.keymap.set("", "<leader>hjw", function()
|
|
|
|
hop.hint_words({
|
|
|
|
direction = hint.HintDirection.AFTER_CURSOR,
|
|
|
|
})
|
|
|
|
end)
|
|
|
|
vim.keymap.set("", "<leader>hkw", function()
|
|
|
|
hop.hint_words({
|
|
|
|
direction = hint.HintDirection.BEFORE_CURSOR,
|
|
|
|
})
|
|
|
|
end)
|
|
|
|
|
2022-10-02 22:24:30 +03:00
|
|
|
vim.keymap.set("", "<leader>hp", "<Cmd>HopPattern<CR>")
|
2022-11-08 12:12:18 +03:00
|
|
|
vim.keymap.set("", "<leader>hjp", function()
|
|
|
|
hop.hint_patterns({
|
|
|
|
direction = hint.HintDirection.AFTER_CURSOR,
|
|
|
|
})
|
|
|
|
end)
|
|
|
|
vim.keymap.set("", "<leader>hkp", function()
|
|
|
|
hop.hint_patterns({
|
|
|
|
direction = hint.HintDirection.BEFORE_CURSOR,
|
|
|
|
})
|
|
|
|
end)
|
|
|
|
|
|
|
|
vim.keymap.set("", "<leader>hjv", function()
|
|
|
|
hop.hint_vertical({
|
|
|
|
direction = hint.HintDirection.AFTER_CURSOR,
|
|
|
|
})
|
|
|
|
end)
|
|
|
|
vim.keymap.set("", "<leader>hkv", function()
|
|
|
|
hop.hint_vertical({
|
|
|
|
direction = hint.HintDirection.BEFORE_CURSOR,
|
|
|
|
})
|
|
|
|
end)
|