You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had some map (and noremap) in my .vimrc which also applies to Visual mode (:h map-table). Visual mode (vmap) consists of both xmap and smap.
nvim-snippy uses Select mode, so my map will also apply to Snippy expansion. Which caused a lot of problems since typing regular letters could map to a completely different action that destroyed the snippet expansion.
Ideas or possible solutions
Is it possible for nvim-snippy to unmap all smap (i.e. vmap too) settings before snippet expansion (and then map them back afterwords)? I'm not sure if NeoVim is capable of this, though.
Alternatives you have considered
I changed all map X (and noremap) to nmap X and xmap X (abandoning Select and Operator mode). But I've been really confused why nvim-snippy did not work properly. Maybe this feature can help other users too.
The text was updated successfully, but these errors were encountered:
karamellpelle
changed the title
unmap mappings in Select mode (smap) before snippet expansion
unmap Select mode mappings (smap) before snippet expansion
Feb 25, 2024
Is it possible for nvim-snippy to unmap all smap (i.e. vmap too) settings before snippet expansion (and then map them back afterwords)? I'm not sure if NeoVim is capable of this, though.
I believe it's possible, but I don't think it would be the best approach, since we would need to keep track of all mappings in order to restore them later.
I changed all map X (and noremap) to nmap X and xmap X (abandoning Select and Operator mode). But I've been really confused why nvim-snippy did not work properly. Maybe this feature can help other users too.
I agree that Select mode mappings being set by v is confusing, but unfortunately that's the how Neovim works. In my opinion, select mode should rarely share mappings with visual mode.
Instead of implementing a workaround, we could add an entry to the FAQ and docs explaining this behaviour. I think that would eliminate at least some of the confusion.
Problem Statement
I had some
map
(andnoremap
) in my .vimrc which also applies to Visual mode (:h map-table
). Visual mode (vmap
) consists of bothxmap
andsmap
.nvim-snippy uses Select mode, so my
map
will also apply to Snippy expansion. Which caused a lot of problems since typing regular letters could map to a completely different action that destroyed the snippet expansion.Ideas or possible solutions
Is it possible for nvim-snippy to unmap all
smap
(i.e.vmap
too) settings before snippet expansion (and then map them back afterwords)? I'm not sure if NeoVim is capable of this, though.Alternatives you have considered
I changed all
map X
(andnoremap
) tonmap X
andxmap X
(abandoning Select and Operator mode). But I've been really confused why nvim-snippy did not work properly. Maybe this feature can help other users too.The text was updated successfully, but these errors were encountered: