Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [plugin-vim-surround]

surround.vim is a plugin by tpope to ease quoting and parenthesizing

1
vote
3answers
69 views

Surround part of line with comment /* .. */ [duplicate]

Is it possible to surround a selected part of a line with /* and */? start COMMENT ME end start /*COMMENT ME*/ end
1
vote
3answers
55 views

Quoting blocks but ignoring whitespace

Let's say I have Foo BAR Baz Quxxx Foo Baar Asd Duxxxxx Bar Foo Baazzz Kuxx Baz I would ideally like to be to highlight the first, second, or third column. Then I would ...
2
votes
1answer
64 views

Reclaim cursor shape in operator pending mode neovim while using vim-surround

I'm somewhat ashamed to admit, the main reason I chose neovim over vim was it's native feature of changing cursor shape in different modes. For example, it uses vertical-bar in insert mode, block-...
0
votes
2answers
105 views

Visual block mode and vim surround?

Let's say I have text like this, SPAC SPAC - Specific-Purpose Committee Campaign Finance Report SPAC-SS SPAC-SS - Specific-Purpose Committee Special Session Report SPAC-T SPAC-T - ...
1
vote
0answers
76 views

surround plug-in within global command

I've been unable to use surround within a global command, For example: g/^/ norm! yss" seems to do nothing or replaces the entire line by the contents of the clipboard. This is consistent with ...
0
votes
1answer
37 views

Is there possibly something wrong with (i)mapping the left bracket?

I've been using the vim-surround plugin for as long as I can remember and have grown accustomed to typing <c-g>s ) when I want to insert text between brackets. I was writing with the atom editor ...
0
votes
2answers
74 views

Mapping using tpope/vim-surround only works with command

I have this mapping to surround a Word with jQuery id selector $("#...") and it works fine using a command: command! JqId normal viwo^[i#^[ysiW"ysiW)i$^[E nnoremap <Leader>jqid :JqId<CR> ...
2
votes
2answers
472 views

How can I change mapping for vim-surround plugin?

I don't mind keeping the original mapping, I just want to bind it to something more convenient, so instead of typing ysiw), I could for example do it with Alt(. I tried just adding nnoremap <M-(&...
2
votes
1answer
178 views

Replace surrounding quotes for < >

Given the string "hello.h", I want to obtain <hello.h>. I have tried vim-surround, but while it seems to be able to surround with matching { }: cs"{ ( ): cs"( [ ]: cs"{ XML tags: cs"<mytag&...
3
votes
2answers
60 views

How do I quote tabulated columns?

Currently, I'm using Vim Surround to make quoting easy on Multiple whole-lines Visual blocks Individual words However, it doesn't seem to make the job easy on columns, for example. Take this ...
1
vote
1answer
73 views

`s` doesn't trigger surrounding, but substitute (`cl`)

I installed this vimrc configuration (including plugins), and saw that vim-surround was included. With that, the surround-readme tells me I can use things like ds" to delete surrounding quotes. ...
5
votes
2answers
112 views

How do I surround a quoted string without including leading whitespace?

I have a string like 'foobar', and I want to surround it with parentheses: ('foobar'). With vim-surround, I can do ysi'), which produces '(foobar)'... Not what I want I can also ysa'), but that will ...
7
votes
1answer
395 views

Why does vim surround add spaces in this example?

Old text Command New text Hello *world ysiw( Hello ( world ) Hello *world ysiwb Hello (world) Hello *world ysiw) Hello (world)...
1
vote
1answer
65 views

Surround.vim deletes selection

I'm trying to use surround.vim plugin and make a basic surround with a " sign. Documents states that i need to for example select a word with v and press s". However, i'm not able to use that nor any ...
4
votes
2answers
139 views

surround plugin and TeX quotes `'

Is it possible to make the surround plugin work on `TeX-style quotes' and ``TeX-style double quotes''? (Normally, if `this is quoted'| and `this', va' will select from the first closing mark to the ...
4
votes
1answer
398 views

How can I get vim-surround to automatically indent surrounded HTML code?

I am wanting to wrap the <h2> and the <div> blocks below and surround them both with another <div> <body> <h2>Im a heading</h2> <div class="row"> ...
1
vote
1answer
193 views

delete surrounding eruby tag in rails

When adding a new pair of eruby tag like <%= %> surrounding Time.now, just type below keys: yss= It does the job <%= *Time.now %>. I have no idea how to do the opposite by removing it ...
5
votes
1answer
164 views

Disable vim-surround in a netrw buffer

Is there a way to disable a plugin (or a set of keymaps) on a specific filetype? vim-surround causes a delay in netrw when pressing d to create a new directory. I'm thinking that this might be ...
2
votes
4answers
403 views

How can I surround the lines inside the html tag object?

I have the following piece of HTML: <div> <section> </section> </div> I would like to wrap the 2 section tags in a single article like so: <div> <article> ...