plugins/ux: add more hotkeys for navigation
This commit is contained in:
parent
f8d8c99ac5
commit
a44c17c95a
1 changed files with 37 additions and 11 deletions
|
@ -7,35 +7,61 @@ require("hop").setup({})
|
||||||
|
|
||||||
local hint = require("hop.hint")
|
local hint = require("hop.hint")
|
||||||
|
|
||||||
vim.keymap.set("", "<leader>hf", function()
|
vim.keymap.set("", "<leader>hc", "<Cmd>HopChar1<CR>")
|
||||||
|
vim.keymap.set("", "<leader>hlc", function()
|
||||||
hop.hint_char1({
|
hop.hint_char1({
|
||||||
direction = hint.HintDirection.AFTER_CURSOR,
|
direction = hint.HintDirection.AFTER_CURSOR,
|
||||||
current_line_only = true,
|
current_line_only = true,
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("", "<leader>hF", function()
|
vim.keymap.set("", "<leader>hhc", function()
|
||||||
hop.hint_char1({
|
hop.hint_char1({
|
||||||
direction = hint.HintDirection.BEFORE_CURSOR,
|
direction = hint.HintDirection.BEFORE_CURSOR,
|
||||||
current_line_only = true,
|
current_line_only = true,
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("", "<leader>ht", function()
|
vim.keymap.set("", "<leader>hjc", function()
|
||||||
hop.hint_char1({
|
hop.hint_char1({
|
||||||
direction = hint.HintDirection.AFTER_CURSOR,
|
direction = hint.HintDirection.AFTER_CURSOR,
|
||||||
current_line_only = true,
|
|
||||||
hint_offset = -1,
|
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("", "<leader>hT", function()
|
vim.keymap.set("", "<leader>hkc", function()
|
||||||
hop.hint_char1({
|
hop.hint_char1({
|
||||||
direction = hint.HintDirection.BEFORE_CURSOR,
|
direction = hint.HintDirection.BEFORE_CURSOR,
|
||||||
current_line_only = true,
|
|
||||||
hint_offset = 1,
|
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vim.keymap.set("", "<leader>hc", "<Cmd>HopChar1<CR>")
|
|
||||||
vim.keymap.set("", "<leader>hw", "<Cmd>HopWord<CR>")
|
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>hp", "<Cmd>HopPattern<CR>")
|
||||||
vim.keymap.set("", "<leader>hl", "<Cmd>HopLine<CR>")
|
vim.keymap.set("", "<leader>hjp", function()
|
||||||
vim.keymap.set("", "<leader>hv", "<Cmd>HopVertical<CR>")
|
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)
|
||||||
|
|
Reference in a new issue