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

Re: pulling text to the right?

Expand Messages
  • Matthew Winn
    On Wed, 28 Feb 2007 12:55:23 -0800, Lev Lvovsky ... I d think it was likely, given that two days ago I posted a mapping that does exactly
    Message 1 of 13 , Mar 1, 2007
    • 0 Attachment
      On Wed, 28 Feb 2007 12:55:23 -0800, Lev Lvovsky <lists2@...>
      wrote:

      > That sort of does what I want, but it ends up moving the "INT" right
      > along with it. I guess what I'm looking for is a combination of key
      > strokes:
      >
      > COL1 INT,
      > COL2 INT,
      > COL3 INT,
      > ^
      >
      > I put my cursor at the column of the '^', on line 3 and press that
      > keystroke, which would simultaneously go to the beginning of the
      > line, <space>, go back to the '^', and '<x>' from that position, to
      > bring the "INT" back a space.
      >
      > The real goal of this formatting is to create text that looks like this:
      >
      > SOME_COL VARCHAR(32),
      > SOME_COL12 INT,
      > BLAH_BLAH1 BOOL,
      >
      > I would suppose that this can be made with a vim function right?

      I'd think it was likely, given that two days ago I posted a mapping
      that does exactly that. In fact you can do it exactly as you describe
      above by mapping something to "maI <Esc>`ax". (Unlike my first try,
      this one won't stop when it runs out of spaces under the cursor.)

      --
      Matthew Winn
    • Lev Lvovsky
      ... All s I have to say in RE to Align.vim is: Wow . thanks Charles! -lev
      Message 2 of 13 , Mar 1, 2007
      • 0 Attachment
        On Feb 27, 2007, at 6:57 AM, Charles E Campbell Jr wrote:

        > Lev Lvovsky wrote:
        >
        >> I'm sure there's a fancy word for this, but is there any way to
        >> pull text to the right?
        >>
        >> suppose I have the following:
        >>
        >> COL1 INT,
        >> COL2 INT,
        >> COL3 INT,
        >>
        >> I'd like to get "COL3" aligned to "COL1" and "COL2", but to do
        >> that, I need to put the cursor behind "COL3", hit space several
        >> times, and then align "INT" with the other "INTs". Can I put my
        >> cursor to the right of "COL3", and pull it over to "INT" on the
        >> right?
        >
        >
        > It sounds like you're interested in aligning text. For that may I
        > suggest looking into Align.vim (and AlignMaps.vim, which come
        > together).
        > To do the alignment, assuming that you're using spaces as delimiters:

        All's I have to say in RE to Align.vim is:

        "Wow".

        thanks Charles!

        -lev
      Your message has been successfully submitted and would be delivered to recipients shortly.