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

Re: leaving insert-mode moves cursor

Expand Messages
  • Yakov Lerner
    ... This is how it s supopsed to be. Try a instead of i for something different. Yakov
    Message 1 of 7 , Jul 2, 2006
    • 0 Attachment
      On 7/2/06, Jochen Baier <email@...> wrote:
      > hi,
      >
      > i have the strange behavior the if i type "ESC" to leave
      > insert-mode the cursor move on letter the the left...
      >
      > for example if i have the the text "abc" and the insert
      > cursor is between b and c. after pressing the ESC key the
      > block cursor is on "b". pressing "i" and "ESC" again will
      > move the cursor to "a".... seems to be a bug for me.

      This is how it's supopsed to be. Try a instead of i
      for something different.

      Yakov
    • Jochen Baier
      ... ah ok i see it. its a feature ;) thanks jochen
      Message 2 of 7 , Jul 2, 2006
      • 0 Attachment
        On Sun, Jul 02, 2006 at 11:20:28PM +0300, Yakov Lerner wrote:
        > On 7/2/06, Jochen Baier <email@...> wrote:
        > >hi,
        > >
        > >i have the strange behavior the if i type "ESC" to leave
        > >insert-mode the cursor move on letter the the left...
        > >
        > >for example if i have the the text "abc" and the insert
        > >cursor is between b and c. after pressing the ESC key the
        > >block cursor is on "b". pressing "i" and "ESC" again will
        > >move the cursor to "a".... seems to be a bug for me.
        >
        > This is how it's supopsed to be. Try a instead of i
        > for something different.
        >
        > Yakov

        ah ok i see it. its a feature ;)

        thanks jochen
      • Nikolai Weibull
        ... And here s my fix for this malfeature, which is so obviously one of the many, many bugs in Vi that has sadly stuck around far too long:
        Message 3 of 7 , Jul 2, 2006
        • 0 Attachment
          On 7/2/06, Jochen Baier <email@...> wrote:
          > On Sun, Jul 02, 2006 at 11:20:28PM +0300, Yakov Lerner wrote:
          > > On 7/2/06, Jochen Baier <email@...> wrote:

          > > > i have the strange behavior the if i type "ESC" to leave
          > > > insert-mode the cursor move on letter the the left...

          > > This is how it's supopsed to be. Try a instead of i
          > > for something different.

          > ah ok i see it. its a feature ;)

          And here's my fix for this malfeature, which is so obviously one of
          the many, many bugs in Vi that has sadly stuck around far too long:

          http://git.bitwi.se/?p=vim-insert-mode-fix.git;a=blob;h=ab3fbd95b4c9d1d15280aa1ba020b1399b8f1b87;hb=9f59b5c44bb60752289749fd3a03c5a075d98143;f=plugin/now/insert-mode-fix.vim

          nikolai
        • Peter Hodge
          ... Nikolai, It is a matter of preference, not a malfeature. It would take months of retraining for me to adapt if the cursor was fixed so that it does not
          Message 4 of 7 , Jul 3, 2006
          • 0 Attachment
            >
            > And here's my fix for this malfeature, which is so obviously one of
            > the many, many bugs in Vi that has sadly stuck around far too long:
            >

            Nikolai,

            It is a matter of preference, not a malfeature. It would take months of
            retraining for me to adapt if the cursor was 'fixed' so that it does not jump
            back upon leaving insert mode, not to mention the large number of functions and
            mappings I would need to adapt also. Personally, I like the cursor moving
            backwards, and it makes things more consistent when you exit insert-mode at the
            end of a line (where the cursor can only move backwards).

            However, in the spirit of free software and software freedom, thank you for
            providing the fix for others who also prefer things your way. Have you added a
            tip to vim.org?

            regards,
            Peter



            ____________________________________________________
            On Yahoo!7
            Dating: It's free to join and check out our great singles!
            http://www.yahoo7.com.au/personals
          • Helmut Stiegler
            Hi Jochen, i use the following mappings: inoremap `^ inoremap `^ They leave the cursor where it was when leaving insert mode. Of
            Message 5 of 7 , Jul 6, 2006
            • 0 Attachment
              Hi Jochen,

              i use the following mappings:

              inoremap <Esc> <Esc>`^
              inoremap <C-C> <C-C>`^

              They leave the cursor where it was when leaving insert mode. Of course
              they might conflict with some mappings, plugins and scripts, but i did
              not encounter problems due to this so far (and am using it since version 6).

              I for myself use virtualedit. If you do not use virtualedit, the
              mappings will (of course) put the cursor at the last character of the
              line, if you have been beyond the line.

              set virtualedit=all
              nnoremap <End> $l

              If you do not like virtualedit to go only one char beyond the end of
              line, you might try using (however i did not use it yet, it is only
              available since version 7):

              virtualedit=onemore

              - Helmut

              Jochen Baier schrieb:
              > hi,
              >
              > i have the strange behavior the if i type "ESC" to leave
              > insert-mode the cursor move on letter the the left...
              >
              > for example if i have the the text "abc" and the insert
              > cursor is between b and c. after pressing the ESC key the
              > block cursor is on "b". pressing "i" and "ESC" again will
              > move the cursor to "a".... seems to be a bug for me.
              >
              > (vim and gvim some problem)
              >
              > regards jochen
              >
              >
              >
            • Jochen Baier
              ... hi, atm i use my script to toggle the mode: http://www.vim.org/tips/tip.php?tip_id=1275 as a surprising side effect the cursor do not move anymore regards
              Message 6 of 7 , Jul 6, 2006
              • 0 Attachment
                On Thu, Jul 06, 2006 at 11:28:36AM +0200, Helmut Stiegler wrote:
                > Hi Jochen,
                >
                > i use the following mappings:
                >
                > inoremap <Esc> <Esc>`^
                > inoremap <C-C> <C-C>`^
                >
                > They leave the cursor where it was when leaving insert mode. Of course
                > they might conflict with some mappings, plugins and scripts, but i did
                > not encounter problems due to this so far (and am using it since version 6).
                >
                > I for myself use virtualedit. If you do not use virtualedit, the
                > mappings will (of course) put the cursor at the last character of the
                > line, if you have been beyond the line.
                >
                > set virtualedit=all
                > nnoremap <End> $l
                >
                > If you do not like virtualedit to go only one char beyond the end of
                > line, you might try using (however i did not use it yet, it is only
                > available since version 7):
                >
                > virtualedit=onemore
                >
                > - Helmut
                >

                hi,


                atm i use my script to toggle the mode:
                http://www.vim.org/tips/tip.php?tip_id=1275

                as a surprising side effect the cursor do not move anymore


                regards jochen

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