Closed msilen closed 12 years ago
I also use vim-surround, together with yankstack. They are compatible. Here's the situation:
What you're seeing is the default behavior of the S
key in visual mode. What's happening is that yankstack is getting loaded after vim-surround, so vim-surround's key-bindings are getting clobbered. I believe all you have to do is put the following line in your vimrc
:
call yankstack#setup()
This will cause yankstack to set up its key-bindings immediately, before vim-surround gets loaded. Let me know if this fixes it for you. I want to make sure I don't interfere with anybody's use of vim-surround.
Thanks. The line solved the issue.
While this solution prevents 'S' (uppercase) from being clobbered by yankstack, 's' (lowercase) still deletes the selection in visual mode.
:verbose vmap s
s s <SNR>29_yank_with_key("s")
Last set from ~/.vim/bundle/vim-yankstack/autoload/yankstack.vim
x s * <SNR>29_yank_with_key("s")
Last set from ~/.vim/bundle/vim-yankstack/autoload/yankstack.vim
@jbmartin, can you describe the behavior that you expect and the behavior you're observing?
According to the surround documentation, typing viws"
should surround the word under the cursor with double quotes. Instead, yankstack is deleting it. For example, suppose the target word is hello. Typing viws"
should result in "hello", but instead it's blank.
This might be a moot point. viwS"
performs the desired surround behavior.
As far as I know, vim-surround does not map 's' in visual mode, only capital 'S'.
I use tpope's surround-vim plugin. When I have both surround.vim and yankstack installed I can't surround objects in visual mode. For example if I have a visually selected word, pressing S" suppose to produce "word", but instead i get _, and i end up in the insert mode.