I'm working with the vim-surround plugin and this HTML (where the * is my cursor):
<li class="sample" style="border-color: #005462;">*#005462</li>
I'd like to surround the #005462 with <code>
so it looks like this, <code>#005462</code>
. I can do this with visual mode but would like to do something I can repeat with the dot operator. Any advice?
Surround. vim is all about "surroundings": parentheses, brackets, quotes, XML tags, and more. The plugin provides mappings to easily delete, change and add such surroundings in pairs. While it works under Vim 6, much of the functionality requires Vim 7. Examples follow.
Explanation. If you want to put the word under the cursor in to brackets this is viwc()<Esc>P . viw will v isually select all charactrs i n a w ord. c() will c change the selection and by dropping you into insert mode, where you type the characters ( ) .
You want repeat.vim which adds .
support to several other plugins, including surround.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With