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

Re: first character cutted when v,j,x

Expand Messages
  • Dasn
    ... Take a look at your selection , it should be exclusive on your windows platform. ... -- Dasn
    Message 1 of 7 , Sep 30, 2006
    • 0 Attachment
      On Sat, Sep 30, 2006 at 11:11:02PM +0800, Eddy Zhao wrote:
      > Hello all,
      >
      > I find a behaviour difference between windows gvim & linux gvim.
      > For text like below
      >
      > line 1
      > line 2
      > line 3
      >
      > Following the sequence below
      > - move focus to first line first character
      > - v
      > - j
      > - j
      > - x
      >
      > On windows gvim, text remained is "line 3"
      > On linux gvim, text remained is "ine 3"
      >
      > How to make linux gvim behave like windows vim ("l" not cutted)?
      >
      > Thanks
      > Eddy

      Take a look at your 'selection', it should be 'exclusive' on your
      windows platform.

      For more info:

      :h :behave
      :h 'selection'

      --
      Dasn
    • cga2000
      On Sat, Sep 30, 2006 at 06:03:28PM EDT, Dasn wrote: [..] ... Could you explain further? After reading the recommended help files I still don t see the logic of
      Message 2 of 7 , Sep 30, 2006
      • 0 Attachment
        On Sat, Sep 30, 2006 at 06:03:28PM EDT, Dasn wrote:

        [..]

        > > How to make linux gvim behave like windows vim ("l" not cutted)?

        > Take a look at your 'selection', it should be 'exclusive' on your
        > windows platform.
        >
        > For more info:
        >
        > :h :behave
        > :h 'selection'

        Could you explain further?

        After reading the recommended help files I still don't see the logic of
        Vim deleting more characters than what I highlighted in the first place
        _and_ making this the default in *nix environments.

        What am I missing and what is the purpose of this confusing behavior?

        Thanks

        cga
      • A.J.Mechelynck
        ... What you highlighted includes the cursor (move the cursor to the other end with o -- and with selection=inclusive -- to check it). The Unix default is to
        Message 3 of 7 , Sep 30, 2006
        • 0 Attachment
          cga2000 wrote:
          > On Sat, Sep 30, 2006 at 06:03:28PM EDT, Dasn wrote:
          >
          > [..]
          >
          >>> How to make linux gvim behave like windows vim ("l" not cutted)?
          >
          >> Take a look at your 'selection', it should be 'exclusive' on your
          >> windows platform.
          >>
          >> For more info:
          >>
          >> :h :behave
          >> :h 'selection'
          >
          > Could you explain further?
          >
          > After reading the recommended help files I still don't see the logic of
          > Vim deleting more characters than what I highlighted in the first place
          > _and_ making this the default in *nix environments.
          >
          > What am I missing and what is the purpose of this confusing behavior?
          >
          > Thanks
          >
          > cga
          >

          What you highlighted includes the cursor (move the cursor to the other end
          with o -- and with selection=inclusive -- to check it). The Unix default is to
          delete the whole Visual area, including the cursor character. This, IIUC,
          predates Vim. The Windows default is different: on Windows, in non-Vim
          programs, the bar cursor is between characters, not on a character, and the
          highlighted area (when using shift-right or shift-down, i.e., forward motions)
          stops left of the cursor. The purpose of the confusing "exclusive" behaviour
          on Windows is to cater to the peculiar customs of Windows users. Notice that
          gvim has a block cursor in Visual mode when 'selection' is "inclusive", and a
          thick bar cursor when it is "exclusive".

          Note: to highlight and delete full lines, use linewise visual mode (with V not
          v). Linewise-visual always includes (and highlights) the cursor line.


          Best regards,
          Tony.
        • Eddy Zhao
          Hi all, The problem is solved as Dasn indicated, by put set selection=exclusive setting in vimrc. (using V instead of v also works in my original
          Message 4 of 7 , Sep 30, 2006
          • 0 Attachment
            Hi all,

            The problem is solved as Dasn indicated, by put

            "set selection=exclusive"

            setting in vimrc. (using "V" instead of "v" also works
            in my original mentioned case)

            Thanks everybody!
            Eddy

            2006/10/1, A.J.Mechelynck <antoine.mechelynck@...>:
            > cga2000 wrote:
            > > On Sat, Sep 30, 2006 at 06:03:28PM EDT, Dasn wrote:
            > >
            > > [..]
            > >
            > >>> How to make linux gvim behave like windows vim ("l" not cutted)?
            > >
            > >> Take a look at your 'selection', it should be 'exclusive' on your
            > >> windows platform.
            > >>
            > >> For more info:
            > >>
            > >> :h :behave
            > >> :h 'selection'
            > >
            > > Could you explain further?
            > >
            > > After reading the recommended help files I still don't see the logic of
            > > Vim deleting more characters than what I highlighted in the first place
            > > _and_ making this the default in *nix environments.
            > >
            > > What am I missing and what is the purpose of this confusing behavior?
            > >
            > > Thanks
            > >
            > > cga
            > >
            >
            > What you highlighted includes the cursor (move the cursor to the other end
            > with o -- and with selection=inclusive -- to check it). The Unix default is to
            > delete the whole Visual area, including the cursor character. This, IIUC,
            > predates Vim. The Windows default is different: on Windows, in non-Vim
            > programs, the bar cursor is between characters, not on a character, and the
            > highlighted area (when using shift-right or shift-down, i.e., forward motions)
            > stops left of the cursor. The purpose of the confusing "exclusive" behaviour
            > on Windows is to cater to the peculiar customs of Windows users. Notice that
            > gvim has a block cursor in Visual mode when 'selection' is "inclusive", and a
            > thick bar cursor when it is "exclusive".
            >
            > Note: to highlight and delete full lines, use linewise visual mode (with V not
            > v). Linewise-visual always includes (and highlights) the cursor line.
            >
            >
            > Best regards,
            > Tony.
            >
          • cga2000
            ... [..] ... Misuse of v was the issue and explains why Vim thus behaves. Since v is per character visual mode .. vjj does not make much sense in the
            Message 5 of 7 , Oct 1, 2006
            • 0 Attachment
              On Sat, Sep 30, 2006 at 08:35:04PM EDT, A.J.Mechelynck wrote:
              > cga2000 wrote:

              [..]

              > What you highlighted includes the cursor

              Misuse of "v" was the issue and explains why Vim thus behaves.

              Since "v" is "per character" visual mode .. vjj does not make much sense
              in the first place .. using the wrong tool .. Either you do a Vjj .. or
              vjllll etc. (or vj$ not very logical but at least is consistent).

              Now that you have told me what to look for, I can see that cursor .. and
              everything falls into place.

              > (move the cursor to the other end
              > with o -- and with selection=inclusive -- to check it). The Unix default is
              > to delete the whole Visual area, including the cursor character. This,
              > IIUC, predates Vim. The Windows default is different: on Windows, in
              > non-Vim programs, the bar cursor is between characters, not on a character,

              .. sounds fishy .. in a cell terminal how could a character be between
              characters.. except by being invisible?

              :-)

              > and the highlighted area (when using shift-right or shift-down, i.e.,
              > forward motions) stops left of the cursor. The purpose of the
              > confusing "exclusive" behaviour on Windows is to cater to the peculiar
              > customs of Windows users. Notice that gvim has a block cursor in
              > Visual mode when 'selection' is "inclusive", and a thick bar cursor
              > when it is "exclusive".

              > Note: to highlight and delete full lines, use linewise visual mode
              > (with V not v). Linewise-visual always includes (and highlights) the
              > cursor line.

              Which is what I did without understanding why .. just worked.

              Makes a lot of difference to know why, though .. Since this is general
              to all movement/selections it explains a number of other behaviors that
              have baffled me in the past.

              As always, thanks for your enlightening comments.

              cga
            • A.J.Mechelynck
              cga2000 wrote: [...] ... [...] Windows, even more than modern Unixes (those with X11), is GUI-oriented. On Windows, IIUC, only old Dos hands like me,
              Message 6 of 7 , Oct 1, 2006
              • 0 Attachment
                cga2000 wrote:
                [...]
                > .. sounds fishy .. in a cell terminal how could a character be between
                > characters.. except by being invisible?
                >
                > :-)
                >
                [...]

                Windows, even more than "modern" Unixes (those with X11), is GUI-oriented. On
                Windows, IIUC, only old Dos hands like me, hackers, and Unix users ever use
                the Dos Box. Other people use WYSIWYG interfaces like Word, and their cursor
                is not a character, nor does it cover a character; it is a blinking bar
                between characters. Gvim imitates that quite well, except that the gvim cursor
                must always be thought of as being "on" a character, even in Insert mode when
                it displays as a thin vertical bar on the left edge of the character cell.


                Best regards,
                Tony.
              • cga2000
                ... Very interesting. Thanks cga
                Message 7 of 7 , Oct 1, 2006
                • 0 Attachment
                  On Sun, Oct 01, 2006 at 09:33:37AM EDT, A.J.Mechelynck wrote:
                  > cga2000 wrote:
                  > [...]
                  > >.. sounds fishy .. in a cell terminal how could a character be between
                  > >characters.. except by being invisible?
                  > >
                  > >:-)
                  > >
                  > [...]
                  >
                  > Windows, even more than "modern" Unixes (those with X11), is GUI-oriented.
                  > On Windows, IIUC, only old Dos hands like me, hackers, and Unix users ever
                  > use the Dos Box. Other people use WYSIWYG interfaces like Word, and their
                  > cursor is not a character, nor does it cover a character; it is a blinking
                  > bar between characters. Gvim imitates that quite well, except that the gvim
                  > cursor must always be thought of as being "on" a character, even in Insert
                  > mode when it displays as a thin vertical bar on the left edge of the
                  > character cell.

                  Very interesting.

                  Thanks

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