This repository has been archived on 2024-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/plugins/ux/hop-nvim.lua

68 lines
1.6 KiB
Lua
Raw Normal View History

-- 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("", "<leader>hc", "<Cmd>HopChar1<CR>")
vim.keymap.set("", "<leader>hlc", function()
hop.hint_char1({
direction = hint.HintDirection.AFTER_CURSOR,
current_line_only = true,
})
end)
vim.keymap.set("", "<leader>hhc", function()
hop.hint_char1({
direction = hint.HintDirection.BEFORE_CURSOR,
current_line_only = true,
})
end)
vim.keymap.set("", "<leader>hjc", function()
hop.hint_char1({
direction = hint.HintDirection.AFTER_CURSOR,
})
end)
vim.keymap.set("", "<leader>hkc", function()
hop.hint_char1({
direction = hint.HintDirection.BEFORE_CURSOR,
})
end)
vim.keymap.set("", "<leader>hw", "<Cmd>HopWord<CR>")
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)
vim.keymap.set("", "<leader>hp", "<Cmd>HopPattern<CR>")
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)