vim-surround icon indicating copy to clipboard operation
vim-surround copied to clipboard

How to add surrounding on visual selection?

Open OriLiMu opened this issue 8 years ago • 12 comments

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 ~

OriLiMu avatar Dec 29 '16 01:12 OriLiMu

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

peitalin avatar Jan 09 '17 03:01 peitalin

~~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

kubaugustyn avatar Jan 13 '17 11:01 kubaugustyn

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

sukovanej avatar Sep 12 '17 06:09 sukovanej

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

kubaugustyn avatar Sep 12 '17 07:09 kubaugustyn

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

Weird..

gierdo avatar Sep 25 '17 07:09 gierdo

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.

Huxpro avatar Feb 11 '19 04:02 Huxpro

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.

Huxpro avatar Feb 15 '19 18:02 Huxpro

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

Migacz85 avatar Feb 21 '19 15:02 Migacz85

for those who install vim-yankstack, please remove it

datshiropav avatar Jun 25 '19 09:06 datshiropav

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

dessalines avatar Dec 03 '19 06:12 dessalines

for those who install vim-yankstack, please remove it

Works

lroolle avatar May 03 '20 17:05 lroolle

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 ", ', (, {, [

Archie-2021 avatar Jul 07 '22 09:07 Archie-2021