vim-bepo
vim-bepo copied to clipboard
Surround ne marche pas en mode visuel
Les mappings par défaut de surround font commencer le mode visuel par la touche S. Le remapping bepo rentre en conflit avec ce réglage, et donc pour plus de cohérence j'ai remplacé tout les "s" de surround en "k": "ys" devient "yk", etc.
Par contre je n'ai pas réussi à faire marcher cela dans le fichier after/plugin/surround.vim, pour une raison que j'ai oubliée. Du coup je n'ose pas faire de PR car je suis obligé de définir let g:surround_no_mappings = 1 dans .vimrc, et d'avoir ceci dans after/plugin/surround.vim:
if exists("g:loaded_surround") && (!exists("g:surround_no_mappings_bepo") || ! g:surround_no_mappings_bepo)
nmap dk <Plug>Dsurround
nmap lk <Plug>Csurround
nmap lK <Plug>CSurround
nmap yk <Plug>Ysurround
nmap yK <Plug>YSurround
nmap yKK <Plug>Yssurround
nmap yKk <Plug>YSsurround
nmap yKK <Plug>YSsurround
xmap K <Plug>VSurround
xmap gK <Plug>VgSurround
if !hasmapto("<Plug>Isurround","i") && "" == mapcheck("<C-K>","i")
imap <C-K> <Plug>Isurround
endif
imap <C-G>k <Plug>Isurround
imap <C-G>S <Plug>ISurround
endif
Si tu as une solution plus élégante je suis preneur...