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

Wish: col("^")

Expand Messages
  • Andy Wokula
    ... get position of first non-blank character in the line. If there is col( $ ), there should also be col( ^ ). In some situations (e.g. :imap ) ... is
    Message 1 of 8 , May 21, 2007
    • 0 Attachment
      ... get position of first non-blank character in the line.

      If there is col("$"), there should also be col("^").
      In some situations (e.g. :imap <expr>)
      :normal ^
      is not allowed.

      --
      Regards,
      Andy

      EOM
    • Yakov Lerner
      ... ... but you can call your function, remember position/columns, do :normal ^ , get column, restore position, return the columns of the ^ ? Yakov
      Message 2 of 8 , May 21, 2007
      • 0 Attachment
        On 5/21/07, Andy Wokula <anwoku@...> wrote:
        > ... get position of first non-blank character in the line.
        >
        > If there is col("$"), there should also be col("^").
        > In some situations (e.g. :imap <expr>)
        > :normal ^
        > is not allowed.

        ... but you can call your function, remember position/columns,
        do ':normal ^', get column, restore position, return the columns of the ^ ?

        Yakov
      • Gary Johnson
        ... indent( . )? HTH, Gary -- Gary Johnson | Agilent Technologies garyjohn@spk.agilent.com | Mobile Broadband Division
        Message 3 of 8 , May 21, 2007
        • 0 Attachment
          On 2007-05-21, Andy Wokula <anwoku@...> wrote:
          > ... get position of first non-blank character in the line.
          >
          > If there is col("$"), there should also be col("^").
          > In some situations (e.g. :imap <expr>)
          > :normal ^
          > is not allowed.

          indent(".")?

          HTH,
          Gary

          --
          Gary Johnson | Agilent Technologies
          garyjohn@... | Mobile Broadband Division
          | Spokane, Washington, USA
        • Andy Wokula
          ... Nice, just forgot about indent(). Probably col( ^ ) would be exactly the same as indent( . )+1 and therefore redundant. -- Regards, Andy
          Message 4 of 8 , May 21, 2007
          • 0 Attachment
            Gary Johnson schrieb:
            > On 2007-05-21, Andy Wokula <anwoku@...> wrote:
            >> ... get position of first non-blank character in the line.
            >>
            >> If there is col("$"), there should also be col("^").
            >> In some situations (e.g. :imap <expr>)
            >> :normal ^
            >> is not allowed.
            >
            > indent(".")?
            >
            > HTH,
            > Gary

            Nice, just forgot about indent().
            Probably col("^") would be exactly the same as indent(".")+1 and
            therefore redundant.

            --
            Regards,
            Andy
          • Andy Wokula
            ... Oops this was slightly wrong. Probably virtcol( ^ ) would be exactly the same as indent( . )+1 (indent( . ) counts virtual columns). col( ^ ) could still
            Message 5 of 8 , May 21, 2007
            • 0 Attachment
              Andy Wokula schrieb:
              > Gary Johnson schrieb:
              >> On 2007-05-21, Andy Wokula <anwoku@...> wrote:
              >>> ... get position of first non-blank character in the line.
              >>>
              >>> If there is col("$"), there should also be col("^").
              >>> In some situations (e.g. :imap <expr>)
              >>> :normal ^
              >>> is not allowed.
              >>
              >> indent(".")?
              >>
              >> HTH,
              >> Gary
              >
              > Nice, just forgot about indent().
              > Probably col("^") would be exactly the same as indent(".")+1 and
              > therefore redundant.

              Oops this was slightly wrong.

              Probably virtcol("^") would be exactly the same as indent(".")+1
              (indent(".") counts virtual columns).

              col("^") could still have its uses.

              --
              Regards,
              Andy
            • Nikolai Weibull
              ... Then shouldn t there also be a col( 0 ) for symmetry? nikolai
              Message 6 of 8 , May 21, 2007
              • 0 Attachment
                On 5/21/07, Andy Wokula <anwoku@...> wrote:
                > ... get position of first non-blank character in the line.
                >
                > If there is col("$"), there should also be col("^").
                > In some situations (e.g. :imap <expr>)
                > :normal ^
                > is not allowed.

                Then shouldn't there also be a col("0") for symmetry?

                nikolai
              • Andy Wokula
                ... Of course! For symmetry, also col( | ) should be added. -- Regards, Andy
                Message 7 of 8 , May 21, 2007
                • 0 Attachment
                  Nikolai Weibull schrieb:
                  > On 5/21/07, Andy Wokula <anwoku@...> wrote:
                  >> ... get position of first non-blank character in the line.
                  >>
                  >> If there is col("$"), there should also be col("^").
                  >> In some situations (e.g. :imap <expr>)
                  >> :normal ^
                  >> is not allowed.
                  >
                  > Then shouldn't there also be a col("0") for symmetry?
                  >
                  > nikolai

                  Of course! For symmetry, also col("|") should be added.

                  --
                  Regards,
                  Andy
                • Nikolai Weibull
                  ... ;-) nikolai
                  Message 8 of 8 , May 21, 2007
                  • 0 Attachment
                    On 5/21/07, Andy Wokula <anwoku@...> wrote:
                    > Nikolai Weibull schrieb:
                    > > On 5/21/07, Andy Wokula <anwoku@...> wrote:
                    > > > ... get position of first non-blank character in the line.

                    > > > If there is col("$"), there should also be col("^").
                    > > > In some situations (e.g. :imap <expr>)
                    > > > :normal ^
                    > > > is not allowed.

                    > > Then shouldn't there also be a col("0") for symmetry?

                    > Of course! For symmetry, also col("|") should be added.

                    ;-)

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