svermeulen / vim-subversive

Vim plugin providing operator motions to quickly replace text
MIT License
298 stars 4 forks source link

Subversive doesn't work correctly with langmap #19

Open jan-warchol opened 4 years ago

jan-warchol commented 4 years ago

Thanks for making this awesome plugin, it's one of the very best I know!

I've noticed that setting langmap (which can be used to swap keys in normal mode e.g. to accomodate a custom keyboard layout) breaks subversive. Here's a minimal configuration:

" Manage plugins with Vim-Plug (github.com/junegunn/vim-plug)
call plug#begin('~/.vim/plugged')
Plug 'svermeulen/vim-cutlass'
Plug 'svermeulen/vim-subversive'
call plug#end()

set langmap=de,DE,ed,ED

nmap s <plug>(SubversiveSubstitute)
nmap ss <plug>(SubversiveSubstituteLine)
nmap S <plug>(SubversiveSubstituteToEndOfLine)

Observed behavior:

Note that the langmap doesn't touch s key at all. I guess it has something to do with using d motion internally... I would be very grateful for a fix, subversive is awesome but I need to use langmap as well because I have a custom keyboard.

PS Vim version:

$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 18 2020 18:29:15)
Included patches: 1-1453
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
svermeulen commented 4 years ago

Hmm I tried using your minimal configuration with terminal neovim and was unable to reproduce it

jan-warchol commented 4 years ago

Indeed, it works in neovim. Perhaps I should make the switch... Is there a chance you could try making it work with original vim, too? It would be great to have portable configuration.

svermeulen commented 4 years ago

Honestly I'm not sure if I'll have time to look into this further. It sounds like it might be tricky given that neovim apparently fixed the problem