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

^ vs 0 vs vs |

Expand Messages
  • Bill McCarthy
    Hello Vim Developers, Here s what the docs say: =============================================================================== *^* ^ To the
    Message 1 of 4 , Dec 6, 2006
    • 0 Attachment
      Hello Vim Developers,

      Here's what the docs say:

      ===============================================================================
      *^*
      ^ To the first non-blank character of the line.
      |exclusive| motion.

      *0*
      0 To the first character of the line. |exclusive|
      motion. When moving up or down, stay in same screen
      column (if possible).

      *<Home>* *<kHome>*
      <Home> To the first character of the line. |exclusive|
      motion. When moving up or down, stay in same text
      column (if possible). Works like "1|", which differs
      from "0" when the line starts with a <Tab>. {not in
      Vi}

      *bar*
      | To screen column [count] in the current line.
      |exclusive| motion.
      ===============================================================================

      (1) The sentence starting with "When moving" (in the help
      for both '0' and '<Home>' appears to also belong with
      the help for '^'.

      (2) The sentence starting with "Works like" (in the help for
      '<Home>') does not appear to be correct. '<Home>'
      appears to work like '0'. The movement is just like
      '1|' (which is equivalent to '|') except for the
      behavior of moving up or down.

      (3) '0' and '<Home>' appear to be identical. Does anyone
      see a difference?

      --
      Best regards,
      Bill
    • A.J.Mechelynck
      ... (1) After ^ followed by jjjjj or kkkkk I see the cursor staying (as far as possible) in the same _screen_ column regardless of preceding hard tabs. When
      Message 2 of 4 , Dec 6, 2006
      • 0 Attachment
        Bill McCarthy wrote:
        > Hello Vim Developers,
        >
        > Here's what the docs say:
        >
        > ===============================================================================
        > *^*
        > ^ To the first non-blank character of the line.
        > |exclusive| motion.
        >
        > *0*
        > 0 To the first character of the line. |exclusive|
        > motion. When moving up or down, stay in same screen
        > column (if possible).
        >
        > *<Home>* *<kHome>*
        > <Home> To the first character of the line. |exclusive|
        > motion. When moving up or down, stay in same text
        > column (if possible). Works like "1|", which differs
        > from "0" when the line starts with a <Tab>. {not in
        > Vi}
        >
        > *bar*
        > | To screen column [count] in the current line.
        > |exclusive| motion.
        > ===============================================================================
        >
        > (1) The sentence starting with "When moving" (in the help
        > for both '0' and '<Home>' appears to also belong with
        > the help for '^'.
        >
        > (2) The sentence starting with "Works like" (in the help for
        > '<Home>') does not appear to be correct. '<Home>'
        > appears to work like '0'. The movement is just like
        > '1|' (which is equivalent to '|') except for the
        > behavior of moving up or down.
        >
        > (3) '0' and '<Home>' appear to be identical. Does anyone
        > see a difference?
        >

        (1) After ^ followed by jjjjj or kkkkk I see the cursor staying (as far as
        possible) in the same _screen_ column regardless of preceding hard tabs. When
        this would place the cursor halfway a tab, the cursor will shift temporarily,
        and come back if you go on hitting j or k. This is normal behaviour when
        moving up or down, so it doesn't need to be mentioned.

        (2) Here, <Home> works like 1| (not like 0), see below.

        (3) Yes I do. Notice the one mentions "the same _text_ column" and the other
        "the same _screen_ column". Hit 0 on a line starting with a hard tab, then
        jjjjj : Vim will try to keep the cursor in column 8 (except, of course, on
        lines shorter than 1 tab or 8 other characters). After <Home> or 1| it would
        try to keep the cursor in column 1 (if possible: when the first character on a
        line is a hard tab the cursor will move temporarily to column 8).

        I have

        *motion.txt* For Vim version 7.0. Last change: 2006 Jun 18
        [...] (next line is #170)
        *0*
        0 To the first character of the line. |exclusive|
        motion. When moving up or down, stay in same screen
        column (if possible).

        *<Home>* *<kHome>*
        <Home> To the first character of the line. |exclusive|
        motion. When moving up or down, stay in same text
        column (if possible). Works like "1|", which differs
        from "0" when the line starts with a <Tab>. {not in
        Vi}

        *^*
        ^ To the first non-blank character of the line.
        |exclusive| motion.
        [...] (next line is #235)
        *bar*
        | To screen column [count] in the current line.
        |exclusive| motion.

        and

        VIM - Vi IMproved 7.0 (2006 May 7, compiled Dec 5 2006 22:18:11)
        Included patches: 1-178
        Compiled by antoine.mechelynck@...
        Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
        [etc.]


        Best regards,
        Tony.
      • Bill McCarthy
        ... Thanks Tony, that clears it up nicely. Somehow I just wasn t seeing the difference - I certainly see it now! -- Best regards, Bill
        Message 3 of 4 , Dec 6, 2006
        • 0 Attachment
          On Wed 6-Dec-06 6:24pm -0600, A.J.Mechelynck wrote:

          > Bill McCarthy wrote:

          >> (3) '0' and '<Home>' appear to be identical. Does anyone
          >> see a difference?

          > (3) Yes I do. Notice the one mentions "the same _text_
          > column" and the other "the same _screen_ column". Hit 0 on
          > a line starting with a hard tab, then jjjjj : Vim will try
          > to keep the cursor in column 8 (except, of course, on
          > lines shorter than 1 tab or 8 other characters). After
          > <Home> or 1| it would try to keep the cursor in column 1
          > (if possible: when the first character on a line is a hard
          > tab the cursor will move temporarily to column 8).

          Thanks Tony, that clears it up nicely. Somehow I just
          wasn't seeing the difference - I certainly see it now!

          --
          Best regards,
          Bill
        • Bram Moolenaar
          ... Nearly all commans stick to the same screen column. The remark about moving up or down should only appear for commands that do otherwise. I ll remove it
          Message 4 of 4 , Dec 7, 2006
          • 0 Attachment
            Bill McCarthy wrote:

            > Here's what the docs say:
            >
            > ===============================================================================
            > *^*
            > ^ To the first non-blank character of the line.
            > |exclusive| motion.
            >
            > *0*
            > 0 To the first character of the line. |exclusive|
            > motion. When moving up or down, stay in same screen
            > column (if possible).
            >
            > *<Home>* *<kHome>*
            > <Home> To the first character of the line. |exclusive|
            > motion. When moving up or down, stay in same text
            > column (if possible). Works like "1|", which differs
            > from "0" when the line starts with a <Tab>. {not in
            > Vi}
            >
            > *bar*
            > | To screen column [count] in the current line.
            > |exclusive| motion.
            > ===============================================================================
            >
            > (1) The sentence starting with "When moving" (in the help
            > for both '0' and '<Home>' appears to also belong with
            > the help for '^'.

            Nearly all commans stick to the same screen column. The remark about
            moving up or down should only appear for commands that do otherwise.
            I'll remove it from "0" and add a remark at <Home> that keeping the text
            column is unusual.

            > (2) The sentence starting with "Works like" (in the help for
            > '<Home>') does not appear to be correct. '<Home>'
            > appears to work like '0'. The movement is just like
            > '1|' (which is equivalent to '|') except for the
            > behavior of moving up or down.
            >
            > (3) '0' and '<Home>' appear to be identical. Does anyone
            > see a difference?

            <Home> does work like "1|", not like "0", if you consider doing "j" or
            "k" next.

            --
            Q: What's orange and sounds like a parrot?
            A: A carrot

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ download, build and distribute -- http://www.A-A-P.org ///
            \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
          Your message has been successfully submitted and would be delivered to recipients shortly.