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

Re: Cursor and Insert-Mode ( cursor is back-spacing ) ( version 7.3.382 )

Expand Messages
  • Ben Fritz
    ... Are you using i in a mapping to switch to insert mode? If so, what is your mapping? Give us the full and exact command you use to set up the mapping,
    Message 1 of 9 , Apr 3, 2012
      On Monday, April 2, 2012 8:06:20 PM UTC-5, Bovy, Stephen wrote:
      > Hmm
      >
      > That means I need to change the key-bindings for the "Insert-Key" to use (a) instead of (i) ???
      >

      Are you using 'i' in a mapping to switch to insert mode? If so, what is your mapping? Give us the full and exact command you use to set up the mapping, containing both the left and right hand side of the mapping; there may be a better way to accomplish what you're trying to do. Without seeing the mapping, I'd say "maybe" you'll need to change 'i' to 'a' within the mapping.

      If you're not talking about a mapping, then no, you need not change any key bindings. You just need to train yourself to use a different command to enter insert mode depending on what you are trying to do. There are many ways to enter insert mode. See :help inserting and :help replacing for the list.

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Ben Fritz
      ... This is not, and never has been, how Vim or vi works. Vim, like vi, has only one cursor position. The caret in insert mode is in fact this One and Only
      Message 2 of 9 , Apr 3, 2012
        On Monday, April 2, 2012 8:26:14 PM UTC-5, Bovy, Stephen wrote:
        > I guess observationally it does not make much sense
        >
        > And actually I kind-of disagree If you are on X You switch to Insert mode ( then you insert some blanks )
        >
        > When you switch out of insert mode you should still be on X
        >
        > The insert mode "caret" indicates where the insertion takes place not the character the "cursor" is on (which has not changed)
        > So when you switch out of insert mode the cursor should still be on the same character ( not the previous character)
        >

        This is not, and never has been, how Vim or vi works. Vim, like vi, has only one cursor position. The "caret" in insert mode is in fact this One and Only Cursor. Vim does not track two separate cursor locations, and in fact doing so would break expectations even more. If you're in insert mode and use the arrow keys to move the cursor up 357 lines, then leave insert mode, would you really expect Vim to jump 357 lines down to where you entered insert mode?

        Regardless of how it should conceptually act, Vim and vi have ALWAYS acted the way they have now, with i<Esc>i<Esc>i<Esc> moving the cursor to the left. Doing otherwise would break many scripts and mappings which assume the cursor will always end up on the last character typed in insert mode (or it will move one character to the left from the point where insert mode was ended, in the general case where no text was inserted or the cursor was moved inside insert mode). In other words, changing i<Esc> to not move the cursor would be a major interface change. Changing Vim to track two separate cursor positions (one for insert mode and one for normal mode) would be an even bigger one.

        If you really want to always jump back to the position at which you entered insert mode in a general case, you could try setting a mark in an InsertEnter autocmd and jumping back to the mark on InsertLeave. If you're having a problem with a specific mapping, tweaks to the mapping to use a different insert mode entry or avoid leaving insert mode altogether can probably fix it. If you just don't like that i<Esc> does something you don't expect, change your expectations or use a different insert mode entry command.

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Bovy, Stephen
        Thank you for the explanation :) ... From: vim_dev@googlegroups.com [mailto:vim_dev@googlegroups.com] On Behalf Of Ben Fritz Sent: Tuesday, April 03, 2012
        Message 3 of 9 , Apr 3, 2012
          Thank you for the explanation :)


          -----Original Message-----
          From: vim_dev@... [mailto:vim_dev@...] On Behalf Of Ben Fritz
          Sent: Tuesday, April 03, 2012 8:56 AM
          To: vim_dev@...
          Subject: Re: Cursor and Insert-Mode ( cursor is back-spacing ) ( version 7.3.382 )

          On Monday, April 2, 2012 8:26:14 PM UTC-5, Bovy, Stephen wrote:
          > I guess observationally it does not make much sense
          >
          > And actually I kind-of disagree If you are on X You switch to Insert mode ( then you insert some blanks )
          >
          > When you switch out of insert mode you should still be on X
          >
          > The insert mode "caret" indicates where the insertion takes place not
          > the character the "cursor" is on (which has not changed) So when you
          > switch out of insert mode the cursor should still be on the same
          > character ( not the previous character)
          >

          This is not, and never has been, how Vim or vi works. Vim, like vi, has only one cursor position. The "caret" in insert mode is in fact this One and Only Cursor. Vim does not track two separate cursor locations, and in fact doing so would break expectations even more. If you're in insert mode and use the arrow keys to move the cursor up 357 lines, then leave insert mode, would you really expect Vim to jump 357 lines down to where you entered insert mode?

          Regardless of how it should conceptually act, Vim and vi have ALWAYS acted the way they have now, with i<Esc>i<Esc>i<Esc> moving the cursor to the left. Doing otherwise would break many scripts and mappings which assume the cursor will always end up on the last character typed in insert mode (or it will move one character to the left from the point where insert mode was ended, in the general case where no text was inserted or the cursor was moved inside insert mode). In other words, changing i<Esc> to not move the cursor would be a major interface change. Changing Vim to track two separate cursor positions (one for insert mode and one for normal mode) would be an even bigger one.

          If you really want to always jump back to the position at which you entered insert mode in a general case, you could try setting a mark in an InsertEnter autocmd and jumping back to the mark on InsertLeave. If you're having a problem with a specific mapping, tweaks to the mapping to use a different insert mode entry or avoid leaving insert mode altogether can probably fix it. If you just don't like that i<Esc> does something you don't expect, change your expectations or use a different insert mode entry command.

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Bee
          ... Bill -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more information,
          Message 4 of 9 , Apr 3, 2012
            On Apr 2, 10:45 am, "Bovy, Stephen" <Stephen.B...@...> wrote:
            > Every Time I switch  IN and OUT-OF  Insert-Mode  ( THE-CURSOR ) moves ( BACK-WARDS )  ( ONE-POSITION )

            :help gi

            Bill

            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          Your message has been successfully submitted and would be delivered to recipients shortly.