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

a smoother iab

Expand Messages
  • reader@newsguy.com
    I m pretty sure there is a smoother and shorter way to do an iab insert where you want the cursor to end up in a specific spot. My awkward way to get an insert
    Message 1 of 12 , Dec 29, 2007
    • 0 Attachment
      I'm pretty sure there is a smoother and shorter way to do an iab
      insert where you want the cursor to end up in a specific spot.

      My awkward way to get an insert like:

      # =========* X *=========

      With the cursor landing where the uppercase X is looks like this in .vimrc:
      (This will probably get tortured by mail but is supposed to be on one
      line)

      iab peps # =========* *=========^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD

      Using a herd of left arrow control chars.

      What is the nifty way to do that?


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • A.Politz
      ... iab peps # =========* *========= 11h Using to fire on normal command. -ap -- Ich hab geträumt, der Krieg wär vorbei.
      Message 2 of 12 , Dec 29, 2007
      • 0 Attachment
        reader@... wrote:

        >I'm pretty sure there is a smoother and shorter way to do an iab
        >insert where you want the cursor to end up in a specific spot.
        >
        >My awkward way to get an insert like:
        >
        > # =========* X *=========
        >
        >With the cursor landing where the uppercase X is looks like this in .vimrc:
        >(This will probably get tortured by mail but is supposed to be on one
        >line)
        >
        > iab peps # =========* *=========^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD
        >
        >Using a herd of left arrow control chars.
        >
        >What is the nifty way to do that?
        >
        >
        >
        iab peps # =========* *=========<C-O>11h

        Using '<C-O>' to fire on normal command.

        -ap


        --
        Ich hab geträumt, der Krieg wär vorbei.


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Tony Mechelynck
        ... In nocompatible mode (where cpoptions don t include the notation in an abbreviation (see lines 879 sqq of the current map.txt,
        Message 3 of 12 , Dec 29, 2007
        • 0 Attachment
          reader@... wrote:
          > I'm pretty sure there is a smoother and shorter way to do an iab
          > insert where you want the cursor to end up in a specific spot.
          >
          > My awkward way to get an insert like:
          >
          > # =========* X *=========
          >
          > With the cursor landing where the uppercase X is looks like this in .vimrc:
          > (This will probably get tortured by mail but is supposed to be on one
          > line)
          >
          > iab peps # =========* *=========^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD
          >
          > Using a herd of left arrow control chars.
          >
          > What is the nifty way to do that?

          In 'nocompatible' mode (where 'cpoptions' don't include the < flag) you can
          use <> notation in an abbreviation (see lines 879 sqq of the current map.txt,
          dated 2007 Nov 11):

          :iab <F5> # =========*
          =<Left>=<Left>=<Left>=<Left>=<Left>=<Left>=<Left>=<Left>=<Left>*<Left> <Left>

          (all on one line of course); doing it as above (pushing the symbols right of
          the cursor) makes sure you don't miscount.


          Best regards,
          Tony.
          --
          hundred-and-one symptoms of being an internet addict:
          197. Your desk collapses under the weight of your computer peripherals.

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Matthew Winn
          On Sun, 30 Dec 2007 00:29:25 +0100, A.Politz ... An easier way is to end with F so you don t have to count characters. --
          Message 4 of 12 , Dec 30, 2007
          • 0 Attachment
            On Sun, 30 Dec 2007 00:29:25 +0100, "A.Politz" <politza@...>
            wrote:

            > iab peps # =========* *=========<C-O>11h
            >
            > Using '<C-O>' to fire on normal command.

            An easier way is to end with <C-O>F<Space> so you don't have to count
            characters.

            --
            Matthew Winn

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • reader@newsguy.com
            ... Haa... I could swear I tried that very syntax before resorting to my clunky technique... I must have forgot to save .vimrc or source .vimrc before testing.
            Message 5 of 12 , Dec 30, 2007
            • 0 Attachment
              "A.Politz" <politza@...> writes:

              >>
              > iab peps # =========* *=========<C-O>11h
              >
              > Using '<C-O>' to fire on normal command.

              Haa... I could swear I tried that very syntax before resorting to my
              clunky technique... I must have forgot to save .vimrc or source .vimrc
              before testing.

              Anyway that is a much nicer forumulation.


              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • reader@newsguy.com
              ... Yes, also nice.. however that method and the one above both create an unwanted extra space between * * (asterisks) where as the awkward formulation I
              Message 6 of 12 , Dec 30, 2007
              • 0 Attachment
                Matthew Winn <vim@...> writes:

                >> iab peps # =========* *=========<C-O>11h
                >>
                >> Using '<C-O>' to fire on normal command.
                >
                > An easier way is to end with <C-O>F<Space> so you don't have to count
                > characters.

                Yes, also nice.. however that method and the one above both create an
                unwanted extra space between * * (asterisks) where as the awkward
                formulation I posted (below) does'nt. Not a big deal of course but it
                is nicer to be able to start writing what ever is to go between
                asterisks and have it end up evenly spaced on both ends automatically.

                (original posted forumulation (all on one line))
                iab peps # =============* *=============^[OD^[OD^[OD^[OD
                ^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD



                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • reader@newsguy.com
                ... I m probably doing something wrong but that formulation just causes errors when loading vimrc for me. E464 Invalid Argument (I did have it on one line.. in
                Message 7 of 12 , Dec 30, 2007
                • 0 Attachment
                  Tony Mechelynck <antoine.mechelynck@...> writes:

                  > :iab <F5> # =========*
                  > =<Left>=<Left>=<Left>=<Left>=<Left>=<Left>=<Left>=<Left>=<Left>*<Left> <Left>

                  I'm probably doing something wrong but that formulation just causes
                  errors when loading vimrc for me.

                  E464 Invalid Argument

                  (I did have it on one line.. in case you wonder)


                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Tony Mechelynck
                  ... I guess reader thought you _wanted_ two spaces in the middle. I sure thought you did. If you don t, just remove one space from the {rhs} of the
                  Message 8 of 12 , Dec 30, 2007
                  • 0 Attachment
                    reader@... wrote:
                    > Matthew Winn <vim@...> writes:
                    >
                    >>> iab peps # =========* *=========<C-O>11h
                    >>>
                    >>> Using '<C-O>' to fire on normal command.
                    >> An easier way is to end with <C-O>F<Space> so you don't have to count
                    >> characters.
                    >
                    > Yes, also nice.. however that method and the one above both create an
                    > unwanted extra space between * * (asterisks) where as the awkward
                    > formulation I posted (below) does'nt. Not a big deal of course but it
                    > is nicer to be able to start writing what ever is to go between
                    > asterisks and have it end up evenly spaced on both ends automatically.
                    >
                    > (original posted forumulation (all on one line))
                    > iab peps # =============* *=============^[OD^[OD^[OD^[OD
                    > ^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD^[OD
                    >

                    I guess reader thought you _wanted_ two spaces in the middle. I sure thought
                    you did. If you don't, just remove one space from the {rhs} of the abbreviation.

                    Best regards,
                    Tony.
                    --
                    Kill a commie for Christ!


                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_use" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • Matthew Winn
                    ... Not for me. You said you wanted... ... ...and that s exactly what I get. My abbreviation behaves _exactly_ the same way as yours, which isn t surprising
                    Message 9 of 12 , Dec 30, 2007
                    • 0 Attachment
                      On Sun, 30 Dec 2007 11:42:23 -0600, reader@... wrote:

                      > Matthew Winn <vim@...> writes:
                      >
                      > >> iab peps # =========* *=========<C-O>11h
                      > >>
                      > >> Using '<C-O>' to fire on normal command.
                      > >
                      > > An easier way is to end with <C-O>F<Space> so you don't have to count
                      > > characters.
                      >
                      > Yes, also nice.. however that method and the one above both create an
                      > unwanted extra space between * * (asterisks) where as the awkward
                      > formulation I posted (below) does'nt.

                      Not for me. You said you wanted...

                      > # =========* X *=========

                      ...and that's exactly what I get. My abbreviation behaves _exactly_
                      the same way as yours, which isn't surprising since they're doing
                      exactly the same thing in different ways.

                      How are you finishing typing the abbreviation? I was assuming you
                      would type "peps", a space, and then the text to appear between the
                      asterisks. If I type "peps xxxxx" then with both my abbreviation and
                      yours what I get is:

                      (standard caveats for ASCII art apply) # =========* xxxxx *=========
                      | | | | |
                      expanded from the abbreviation ---------------' | | | |
                      the space I typed after the abbreviation -----------' | | |
                      the text I typed after the "peps" ---------------------' | |
                      the space in the middle of the abbreviation --------------' |
                      expanded from the abbreviation ---------------------------------'

                      --
                      Matthew Winn

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_use" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • reader@newsguy.com
                      ... Gack... hey I m really sorry I put through all the work. I must have done something dimwitted here because I see the same results as you now. That was a
                      Message 10 of 12 , Dec 30, 2007
                      • 0 Attachment
                        Matthew Winn <vim@...> writes:

                        >> # =========* X *=========
                        >
                        > ...and that's exactly what I get. My abbreviation behaves _exactly_
                        > the same way as yours, which isn't surprising since they're doing
                        > exactly the same thing in different ways.

                        Gack... hey I'm really sorry I put through all the work. I must have
                        done something dimwitted here because I see the same results as you
                        now.

                        That was a nice ascii diagram... do you use something to help with
                        that? Maybe emacs picture mode or something similar?


                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_use" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---
                      • Matthew Winn
                        ... No, just typing lots of -s and |s. ... Argh! You said the E word. -- Matthew Winn --~--~---------~--~----~------------~-------~--~----~ You received this
                        Message 11 of 12 , Dec 31, 2007
                        • 0 Attachment
                          On Sun, 30 Dec 2007 16:21:33 -0600, reader@... wrote:

                          > That was a nice ascii diagram... do you use something to help with
                          > that?

                          No, just typing lots of -s and |s.

                          > Maybe emacs picture mode or something similar?

                          Argh! You said the E word.

                          --
                          Matthew Winn

                          --~--~---------~--~----~------------~-------~--~----~
                          You received this message from the "vim_use" maillist.
                          For more information, visit http://www.vim.org/maillist.php
                          -~----------~----~----~----~------~----~------~--~---
                        • Charles E. Campbell, Jr.
                          ... DrawIt could ve been used for this, but it is a rather straightforward drawing... Chip Campbell --~--~---------~--~----~------------~-------~--~----~ You
                          Message 12 of 12 , Dec 31, 2007
                          • 0 Attachment
                            reader@... wrote:

                            >
                            >That was a nice ascii diagram... do you use something to help with
                            >that? Maybe emacs picture mode or something similar?
                            >
                            >
                            >
                            DrawIt could've been used for this, but it is a rather straightforward
                            drawing...

                            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.