(adjust Template:ScriptComments to remove id as no longer needed; minor tweaks) |
JohnBeckett (talk | contribs) (Question from talk.) Tag: sourceedit |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ScriptComments|surround: delete/change/add parentheses/quotes/XML-tags/much more}} |
{{ScriptComments|surround: delete/change/add parentheses/quotes/XML-tags/much more}} |
||
+ | ==About description== |
||
⚫ | |||
+ | On vim.org, tags are stripped from description so that it is hard to understand. One should read the description on the author's github site instead. |
||
+ | |||
+ | ==Disabling spaces== |
||
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. |
||
Line 7: | Line 10: | ||
<blockquote> |
<blockquote> |
||
If either ), }, ], or > is used, the text is wrapped in the appropriate pair |
If either ), }, ], or > is used, the text is wrapped in the appropriate pair |
||
− | of characters. |
+ | of characters. Similar behavior can be found with (, {, and [ (but not <), |
− | which append an additional space to the inside. |
+ | which append an additional space to the inside. Like with the targets above, |
b, B, r, and a are aliases for ), }, ], and >. |
b, B, r, and a are aliases for ), }, ], and >. |
||
</blockquote> |
</blockquote> |
||
Line 14: | Line 17: | ||
<blockquote> |
<blockquote> |
||
Eight punctuation marks, (, ), {, }, [, ], <, and >, represent themselves |
Eight punctuation marks, (, ), {, }, [, ], <, and >, represent themselves |
||
− | and their counterparts. |
+ | and their counterparts. If the opening mark is used, contained whitespace is |
also trimmed. |
also trimmed. |
||
</blockquote> |
</blockquote> |
||
:<span style='font-size:80%'>Note these help topics are included in the documentation supplied with surround.vim, they are not part of the built-in Vim help.</span> |
:<span style='font-size:80%'>Note these help topics are included in the documentation supplied with surround.vim, they are not part of the built-in Vim help.</span> |
||
:–[[User:Fritzophrenic|Fritzophrenic]] 16:41, September 27, 2011 (UTC) |
:–[[User:Fritzophrenic|Fritzophrenic]] 16:41, September 27, 2011 (UTC) |
||
+ | |||
+ | ==Insert tail question== |
||
+ | Hi Tim, I found this script just now and feel nice about your work. And when I read the documentation, there is one place which I cannot understand what it means. Could you please help to specify the function usage to me ? |
||
+ | :Finally, It is possible to always append a string to surroundings in insert mode (and only insert mode). |
||
+ | :This is useful with certain plugins and mappings that allow you to jump to such markings. |
||
+ | :<code>let g:surround_insert_tail = "<++>"</code> |
||
+ | --Alfred Sun, April 27, 2015 |
||
+ | |||
⚫ |
Latest revision as of 22:25, 29 April 2015
Use this page to discuss script 1697 surround: delete/change/add parentheses/quotes/XML-tags/much more
- 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.
About description[]
On vim.org, tags are stripped from description so that it is hard to understand. One should read the description on the author's github site instead.
Disabling spaces[]
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)
Insert tail question[]
Hi Tim, I found this script just now and feel nice about your work. And when I read the documentation, there is one place which I cannot understand what it means. Could you please help to specify the function usage to me ?
- Finally, It is possible to always append a string to surroundings in insert mode (and only insert mode).
- This is useful with certain plugins and mappings that allow you to jump to such markings.
let g:surround_insert_tail = "<++>"
--Alfred Sun, April 27, 2015