Vim Tips Wiki
(standard format)
(answer question about surround.vim)
Line 3: Line 3:
 
==Comments==
 
==Comments==
 
How can I disable the spaces added when surrounding? It's good practice at least in Python to surround function parameters with spaces and brackets or parens.
 
How can I disable the spaces added when surrounding? It's good practice at least in Python to surround function parameters with spaces and brackets or parens.
  +
  +
:Is this what you're looking for? From :help surround-replacements:
  +
<blockquote>
  +
If either ), }, ], or > is used, the text is wrapped in the appropriate pair
  +
of characters. Similar behavior can be found with (, {, and [ (but not <),
  +
which append an additional space to the inside. Like with the targets above,
  +
b, B, r, and a are aliases for ), }, ], and >.
  +
</blockquote>
  +
:And then from :help surrond-targets:
  +
<blockquote>
  +
Eight punctuation marks, (, ), {, }, [, ], <, and >, represent themselves
  +
and their counterparts. If the opening mark is used, contained whitespace is
  +
also trimmed.
  +
</blockquote>
  +
<span style='font-size:smaller'>Note these help topics are included in the documentation supplied with surround.vim, they are not part of the built-in Vim help.</span>
  +
&mdash;[[User:Fritzophrenic|Fritzophrenic]] 16:41, September 27, 2011 (UTC)

Revision as of 16:41, 27 September 2011

Use this page to discuss script 1697 1697

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Comments

How can I disable the spaces added when surrounding? It's good practice at least in Python to surround function parameters with spaces and brackets or parens.

Is this what you're looking for? From :help surround-replacements:

If either ), }, ], or > is used, the text is wrapped in the appropriate pair of characters. Similar behavior can be found with (, {, and [ (but not <), which append an additional space to the inside. Like with the targets above, b, B, r, and a are aliases for ), }, ], and >.

And then from :help surrond-targets:

Eight punctuation marks, (, ), {, }, [, ], <, and >, represent themselves and their counterparts. If the opening mark is used, contained whitespace is also trimmed.

Note these help topics are included in the documentation supplied with surround.vim, they are not part of the built-in Vim help.Fritzophrenic 16:41, September 27, 2011 (UTC)