News for hackers. Stuff that matters.
Re:Vim Plugins You Should Know About, Part I: surround.vim by thamer on Monday December 08, 2008 @09:06AM (#389835)
I tried this plugin a few days ago, but it seemed to break the s (substitute) command, so I removed it. Does someone know how to make it work?

The problem is the following: Write a line of text, select part of it using v, then press s to remove the selection and enter insert mode to start replacing it. This doesn't work anymore when surround.vim is loaded. Too bad, it sure looks great…

Re:Vim Plugins You Should Know About, Part I: surround.vim by pkrumins on Monday December 08, 2008 @09:23AM (#389850)
Try 'R' instead of 's' that you were used to.

  OR
Edit surround.vim and comment out the 's' mappings in visual mode. Like this:

    "    if !hasmapto("<Plug>Vsurround","v")
    "        if exists(":xmap")
    "            xmap  s    <Plug>Vsurround
    "        else
    "            vmap  s    <Plug>Vsurround
    "        endif
    "    endif
    "    if !hasmapto("<Plug>VSurround","v")
    "        if exists(":xmap")
    "            xmap  S    <Plug>VSurround
    "        else
    "            vmap  S    <Plug>VSurround
    "        endif
    "    endif
Re:Vim Plugins You Should Know About, Part I: surround.vim by thamer on Monday December 08, 2008 @10:11AM (#389896)
'R' replaces the whole line, so that won't do. I commented the script as you suggested and it works. Thank you!
Re:Vim Plugins You Should Know About, Part I: surround.vim by sofal on Monday December 08, 2008 @10:13AM (#389900)
If I'm not mistaken, I believe that pressing c instead of s in that situation will do the exact same thing.