Questions tagged [plugin-vim-surround]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
83 views

How to map `""` to `ysiw"` from surround.vim?

I would like to map "" to ysiw" from surround.vim to reduce number of keystrokes needed to surround a word with double quotes. I have tried :noremap "" ysiw", however it ...
  • 1,203
4 votes
1 answer
45 views

vim change multiline html tags with vim-surround

I would like, using vim-surround to convert this <p> ^currsor Issues reported by users from the <a href="https://re.fr"> https:...
1 vote
1 answer
147 views

How to highlight text between two delimiters / tags?

How do I highlight the block of text between two delimiters / tags / "surroundings"? (e.g., between matching parentheses ()s, quotes "", html tags (div../div), etc.) (Or maybe how ...
1 vote
1 answer
190 views

Can I remap y key in vim-surround plugin?

I use langmap to be able to use QWERTY-like layout for normal mode, and Bépo to input text. Key      |      Usage  y   maps to    x  ç   maps to    y However, I can’t use vim-surround to add ...
0 votes
1 answer
236 views

Repeat surroundings commands with dot

I'm using kana/vim-surround plugin to change/delete the surroundings of a word. How can I use the dot to repeat some command from this plugin? For example, the word "pineapple" becomes ...
  • 133
1 vote
1 answer
176 views

Vim-surround with "onemore"

I have the following setting on: set ve+=onemore "allows us to go one-past the last character, emulating ctrl-e in normal programs This is helpful for a lot of navigations and other commands I ...
  • 1,877
3 votes
1 answer
135 views

delete brackets and select region

Is there a quick way to delete brackets ( some string ) and then select "some string"? ds( deletes them (using the surround plugin). vi( selects but only when they exist. looking for normal mode.
  • 1,164
2 votes
2 answers
738 views

How to use surround.vim to quote a single character?

I'm a user of the surround.vim plugin that lets me surround words with quotes, brackets, etc. I'm facing an issue with surrounding a single character with e.g. quotes, when the character is adjacent ...
  • 1,075
1 vote
1 answer
402 views

Vim-Surround but not shift+S in visual mode

How do I disable vim-surround in visual (selection) mode? IE. If I hit shift+S I want to replace all the lines I have currently selected ( the normal vim functionality )
  • 123
1 vote
1 answer
83 views

Surround on tex files

I have both vimtex and surround plugins installed(and ultisnip if matters). When doing surround in visual mode (using S) on a tex file, and when I press \ next I get immediately \begin. I am not sure ...
  • 1,164
1 vote
1 answer
96 views

Add surrounding quotes no leading whitespace

my question is simillar to this: How do I surround a quoted string without including leading whitespace? But not exactly. I am using vim-surround. I have a string print he^llo_and_welcome where ...
  • 1,164
1 vote
2 answers
275 views

Delete whitespace before and after word

I have some text with two dashes: This is some text -- with two dashes. I want to delete the space before and after the dashes: This is some text--with two dashes. Is there a way this can be done ...
2 votes
3 answers
712 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
2 votes
3 answers
294 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 ...
3 votes
1 answer
305 views

Reclaim cursor shape in operator pending mode of 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-...
  • 3,341
0 votes
2 answers
2k 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
0 answers
122 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 ...
  • 111
0 votes
1 answer
50 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 ...
  • 175
0 votes
2 answers
434 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> ...
  • 113
4 votes
2 answers
2k 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
1 answer
378 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&...
2 votes
2 answers
268 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
1 answer
612 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. ...
  • 113
10 votes
2 answers
512 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 ...
  • 203
8 votes
1 answer
950 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)...
  • 253
1 vote
1 answer
99 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 ...
  • 143
5 votes
2 answers
378 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 ...
  • 3,059
5 votes
1 answer
1k 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
1 answer
250 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 ...
  • 113
6 votes
1 answer
342 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 ...
's user avatar
2 votes
4 answers
2k 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> ...