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

Re: How to do column operations within VIM?

Expand Messages
  • Tim Chase
    ... [snipped long answer from Dr. Chip] ... I think Dr. Chip may have given you the $5 answer to what may have been a $0.05 question...Vim supports basic
    Message 1 of 6 , Oct 1, 2007
    • 0 Attachment
      >>> I did this before but do not remember how.
      >>> What is frustrating is I cannot google it out :(
      >>> Anybody tell me how to do this?
      >> Look into using vis.vim; with it, you can
      [snipped long answer from Dr. Chip]
      >
      > Thanks for the reply.
      > But.... no internal way?

      I think Dr. Chip may have given you the $5 answer to what may
      have been a $0.05 question...Vim supports basic column operations
      through "visual block mode" using control+V (or, IIUC, control+Q
      if you're one of the poor folks that source mswin.vim). You can
      read about it at

      :help blockwise-visual
      :help visual-block

      There are some basic operations you can perform on these
      blockwise units:

      :help blockwise-operators

      which include things like prepending/appending, shifting,
      replacing, and cut/copy/paste'ing.

      Dr. Chip's solution was like swatting flies with a battleship :)
      He gave you a pointer to a solution that massively expands upon
      the above-mentioned basic inbuilt functionality. If what you
      want is just the basic operations that Vim supplies in a stock
      build, then there's no need for the vis.vim script. However, if
      you do have need to do more with visual blocks, the vis.vim
      script is your one-stop-shop for many, many things.

      -tim






      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Charles E Campbell Jr
      ... True -- there are some things you can do, such as replace a column with a character, yank it, put it, and apply a change (this operation is not
      Message 2 of 6 , Oct 1, 2007
      • 0 Attachment
        Tim Chase wrote:

        >>>>I did this before but do not remember how.
        >>>>What is frustrating is I cannot google it out :(
        >>>>Anybody tell me how to do this?
        >>>>
        >>>>
        >>>Look into using vis.vim; with it, you can
        >>>
        >>>
        >[snipped long answer from Dr. Chip]
        >
        >
        >>Thanks for the reply.
        >>But.... no internal way?
        >>
        >>
        >
        >I think Dr. Chip may have given you the $5 answer to what may
        >have been a $0.05 question...Vim supports basic column operations
        >through "visual block mode" using control+V (or, IIUC, control+Q
        >if you're one of the poor folks that source mswin.vim). You can
        >read about it at
        >
        > :help blockwise-visual
        > :help visual-block
        >
        >There are some basic operations you can perform on these
        >blockwise units:
        >
        > :help blockwise-operators
        >
        >which include things like prepending/appending, shifting,
        >replacing, and cut/copy/paste'ing.
        >
        >Dr. Chip's solution was like swatting flies with a battleship :)
        > He gave you a pointer to a solution that massively expands upon
        >the above-mentioned basic inbuilt functionality. If what you
        >want is just the basic operations that Vim supplies in a stock
        >build, then there's no need for the vis.vim script. However, if
        >you do have need to do more with visual blocks, the vis.vim
        >script is your one-stop-shop for many, many things.
        >
        >

        True -- there are some things you can do, such as replace a column with
        a character, yank it, put it, and apply a change (this operation is not
        substitute).

        Usually this question is asked by those who wish to do a substitute on a
        column -- and for that, vis.vim is good.

        Regards,
        Chip Campbell


        --~--~---------~--~----~------------~-------~--~----~
        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.