Loading ...
Sorry, an error occurred while loading the content.

please help noob with surround.vim plugin

Expand Messages
  • dedede
    I just download surround.vim plugin (http://www.vim.org/scripts/ script.php?script_id=1697) and use it. One behaviour that I don t like is that for example, I
    Message 1 of 4 , Oct 31, 2008
    • 0 Attachment
      I just download surround.vim plugin (http://www.vim.org/scripts/
      script.php?script_id=1697)
      and use it.
      One behaviour that I don't like is that for example, I have a string
      Hello,
      I press shift+v to hightlight string Hello, then press s" in order to
      surround string Hello with double quotes.
      After that the string Hello actually surrounded like this:
      "
      Hello
      "
      How can I force surround.vim to work like this:
      "Hello"

      thanks and regards

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Anton Sharonov
      I have no idea, what surround.vim plugin does, I just assume that it does something with selection. But according description of your steps, SHIFT-V is
      Message 2 of 4 , Nov 1, 2008
      • 0 Attachment
        I have no idea, what surround.vim plugin does, I just assume that it
        does something with selection. But according description of your
        steps, SHIFT-V is probably a bad choice - since it starts linewise
        selection mode. To start characterwise selection mode, use just "v"
        (without shift) and than motion - for example, put the cursor on some
        character of "Hello" and than press:

        viw

        , this must visually select "Inner WORD" text object). Than you can
        try to use s" command on this characterwise selection and see, either
        it's works.

        Anton.

        2008/11/1, dedede <vuthecuong@...>:
        >
        > I just download surround.vim plugin (http://www.vim.org/scripts/
        > script.php?script_id=1697)
        > and use it.
        > One behaviour that I don't like is that for example, I have a string
        > Hello,
        > I press shift+v to hightlight string Hello, then press s" in order to
        > surround string Hello with double quotes.
        > After that the string Hello actually surrounded like this:
        > "
        > Hello
        > "
        > How can I force surround.vim to work like this:
        > "Hello"
        >
        > thanks and regards
        >
        > >
        >

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • dedede
        ... It worked for me. THank you --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use maillist. For more
        Message 3 of 4 , Nov 1, 2008
        • 0 Attachment
          On Nov 1, 4:33 pm, "Anton Sharonov" <anton.sharo...@...> wrote:
          > I have no idea, what surround.vim plugin does, I just assume that it
          > does something with selection. But according description of your
          > steps, SHIFT-V is probably a bad choice - since it starts linewise
          > selection mode. To start characterwise selection mode, use just "v"
          > (without shift) and than motion - for example, put the cursor on some
          > character of "Hello" and than press:
          >
          > viw
          >
          > , this must visually select "Inner WORD" text object). Than you can
          > try to use s" command on this characterwise selection and see, either
          > it's works.
          >
          > Anton.
          >
          > 2008/11/1, dedede <vuthecu...@...>:
          >
          >
          >
          > > I just download surround.vim plugin (http://www.vim.org/scripts/
          > > script.php?script_id=1697)
          > > and use it.
          > > One behaviour that I don't like is that for example, I have a string
          > > Hello,
          > > I press shift+v to hightlight string Hello, then press s" in order to
          > > surround string Hello with double quotes.
          > > After that the string Hello actually surrounded like this:
          > > "
          > > Hello
          > > "
          > >  How can I force surround.vim to work like this:
          > > "Hello"
          >
          > > thanks and regards

          It worked for me. THank you
          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Jayson Williams
          I use surround constantly. There is no need to highlight the word you want to highlight. just use the motion with ys (yank surround) so for Hello with the
          Message 4 of 4 , Nov 1, 2008
          • 0 Attachment
            I use surround constantly. There is no need to highlight the word you
            want to highlight. just use the motion with ys (yank surround) so for

            Hello

            with the cursor at the H, you would type ysw (for yank surround word)
            and the surround character "
            The result will be
            "Hello"

            You can combine ys with any motion. cs is more for change surround I
            believe, and ds for delete surround.

            Jayson

            On Sat, Nov 1, 2008 at 1:08 AM, dedede <vuthecuong@...> wrote:
            >
            > I just download surround.vim plugin (http://www.vim.org/scripts/
            > script.php?script_id=1697)
            > and use it.
            > One behaviour that I don't like is that for example, I have a string
            > Hello,
            > I press shift+v to hightlight string Hello, then press s" in order to
            > surround string Hello with double quotes.
            > After that the string Hello actually surrounded like this:
            > "
            > Hello
            > "
            > How can I force surround.vim to work like this:
            > "Hello"
            >
            > thanks and regards
            >
            > >
            >

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          Your message has been successfully submitted and would be delivered to recipients shortly.