tpope / vim-surround

surround.vim: Delete/change/add parentheses/quotes/XML-tags/much more with ease

Home Page:https://www.vim.org/scripts/script.php?script_id=1697

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to add surrounding on visual selection?

woshichuanqilz opened this issue · comments

commented

In visual mode I select Hello World and press ys", but nothing happened .
And I can't see related introduce to visual mode(except the linewise mode). Tnx ~

You can make a selection, press 'S', then press '('.
See: https://github.com/tpope/vim-surround/blob/master/doc/surround.txt

I'm pretty sure that 'S' is used for delete line + substitute text in vim. For me, vim-surround doesn't override it sorry for the confusion, it was actually other plugin fault

@zerozero7 What was the other plugin? I'm having the same problem. Thanks :)

@sukovanej Sorry, I can't remember. You can check binding by :vmap S command

I have the same issue, and "S" is mapped to "x" by the plugin VSurround.

Weird..

Anyone knows how can I remap back to use s in visual mode rather than S? I found spacemacs also use that convention. Out of curiosity, what're the problems ppl mentioned about using s in visual mode? I found I seldom used s and dominantly usesc.

Anyone knows how can I remap back to use s in visual mode rather than S? I found spacemacs also use that convention. Out of curiosity, what're the problems ppl mentioned about using s in visual mode? I found I seldom used s and dominantly usesc.

Thanks #269.

This method is indeed working but unfortunately It cannot be repeated by .

for those who install vim-yankstack, please remove it

This really needs to be on the README / tutorial. visual mode is the main way most vimmers select text.

for those who install vim-yankstack, please remove it

Works

Is there a way to add surroundings with more than one character? like adding [[ or more complicated stuff. it can be done with another command , and existing command could be used for one word surroundings like ", ', (, {, [