Re:Vim Plugins You Should Know About, Part I: surround.vim
by thomasmallen on Monday December 08, 2008 @09:06AM
(#389836)
[ Parent
| on HN ]
Re:Vim Plugins You Should Know About, Part I: surround.vim
by pkrumins on Monday December 08, 2008 @09:18AM
(#389846)
This plugin does not define 'stp'. You must be using some other plugin that has this mapping.
The plugin I wrote about wraps HTML around perfectly. Try:
ysiWt<p>
Or if you knew the tag you were going to wrap your "Hello!" in, then in insert mode you could have pressed: <CTRL+s>t<p>.
Re:Vim Plugins You Should Know About, Part I: surround.vim
by thomasmallen on Monday December 08, 2008 @09:31AM
(#389856)
No, the plugin does define stp.
:help Surround
The pattern you have there ("ysiWtp", < is unnecessary, as is >) is actually not thoroughly tested (as mentioned in the docs) and is used when not in a visual selection. In a visual selection, you use "s" followed by what you want to surround with, e.g. s"
Re:Vim Plugins You Should Know About, Part I: surround.vim
by pkrumins on Monday December 08, 2008 @09:40AM
(#389864)
You must have a different surround.vim script. Perhaps someone else wrote a script and called "surround.vim" as well.
The one I am talking about does not define stp and requires < > between tags.
What does your 'stp' do?
Edit: I see what you did there. You were in visual mode!
Re:Vim Plugins You Should Know About, Part I: surround.vim
by thomasmallen on Monday December 08, 2008 @09:50AM
(#389872)
Of course. surround.vim couldn't get away with clobbering "s" in normal mode.