-
-
Notifications
You must be signed in to change notification settings - Fork 305
Description
Checklist
- I have searched through the AstroNvim documentation
- I have searched through the existing issues of this project
- I have searched the existing issues of plugins related to this issue
- I can replicate the bug with the minimal
repro.luaprovided below
Neovim version (nvim -v)
0.11.3 release
Operating system/version
Arch Linux
Terminal/GUI
kitty
Describe the bug
The current astrocommunity hop.nvim configuration uses v mode mappings for visual selections.
This has two major problems:
-
Snippet placeholder conflicts
Many snippet engines (e.g., LuaSnip, Ultisnips) temporarily place you in characterwise visual mode to select active placeholders.
With mappings invmode, pressingswhile editing a placeholder triggers Hop instead of replacing the selection as intended.
This breaks common workflows (e.g., typingsto change text in a selected placeholder) and forces you to hit<Esc>and re-enter the operation manually. -
Limited visual mode coverage
vmode mappings apply only to characterwise visual mode, not to visual block mode (Ctrl-v).
As a result, block selections currently do not get the same Hop functionality.
Additional note
The current configuration also passes an extend_visual option to hop.nvim, but this option does not exist in Hop and is silently ignored.
This means there is no actual “extend selection” behavior happening; the parameter should be removed.
Steps to Reproduce
- Install the hop.nvim community pack
- Use a snippet that has text place holder like
fromimshortcut for python - You are in visual mode so try to type anything that start with 's' or 'S'
- You will be able to see how it affects your workflow
Expected behavior
Use x mode mappings instead of v mode.
This applies mappings to both visual and visual block modes, and it avoids hijacking snippet placeholders because x mode is only active during visual selections explicitly initiated by the user.
Switching to x mode restores expected editing behavior, removes snippet conflicts, and broadens support to all visual modes.
Screenshots
Below is a demonstration of this problem
https://github.com/user-attachments/assets/7b994f86-2b02-44a3-82c8-e09df636ae31
Additional Context
No response
Minimal configuration
-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
-- install plugins
local plugins = {
{ "AstroNvim/AstroNvim", import = "astronvim.plugins" },
{ "AstroNvim/astrocommunity" },
{ import = "astrocommunity.motion.hop-nvim" },
-- add any other plugins/customizations here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
-- add anything else here (autocommands, vim.filetype, etc.)