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

Stay in insert mode when using cursor keys

Expand Messages
  • Alan
    I m using Vim 6.3.46 (with no update possibilities) on a machine where I do not have my own login. I m starting vim via alias vi= vim . There s no .vim.rc
    Message 1 of 4 , Aug 17, 2013
    • 0 Attachment
      I'm using Vim 6.3.46 (with no update possibilities) on a machine where I do not have my own login. I'm starting vim via alias vi='vim'.

      There's no .vim.rc afaik (is there a way to verify this, or discover what config file vim is using?). The default config is OK except I always want line numbers so I'd like to configure vim with -u myvim.rc

      But if I do use a config file vim behaves differently:

      - without myvim.rc I can be in insert mode and move around a file with the cursor keys (staying in insert mode). There's also a status "Insert" visible at bottom of screen.

      - with myvim.rc (which contains only 'set nu') using cursor keys drops me out of insert mode. For the left-arrow key there's a message "E388 Couldn't find a definition" but the other cursor keys don't give messages. Also there is never a status "Insert" shown.

      How do I keep the "default" behavior and also turn line numbering on?
      Or how do I configure that behavior in myvim.rc?

      Thanks
      Alan

      --
      --
      You received this message from the "vim_use" 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 because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Tony Mechelynck
      ... The default config file isn t .vim.rc but .vimrc (in the $HOME directory) with no dot other than at the start -- this can be changed at compile time but it
      Message 2 of 4 , Aug 17, 2013
      • 0 Attachment
        On 08/18/13 00:31, Alan wrote:
        > I'm using Vim 6.3.46 (with no update possibilities) on a machine where I do not have my own login. I'm starting vim via alias vi='vim'.
        >
        > There's no .vim.rc afaik (is there a way to verify this, or discovr what config file vim is using?). The default config is OK except I always want line numbers so I'd like to configure vim with -u myvim.rc

        The default config file isn't .vim.rc but .vimrc (in the $HOME
        directory) with no dot other than at the start -- this can be changed at
        compile time but it usually isn't. To check it, look at the middle
        section of the output of the :version command, or of "vim --version
        |less" without the quotes at the shell prompt.

        >
        > But if I do use a config file vim behaves differently:
        >
        > - without myvim.rc I can be in insert mode and move around a file with the cursor keys (staying in insert mode). There's also a status "Insert" visible at bottom of screen.
        >
        > - with myvim.rc (which contains only 'set nu') using cursor keys drops me out of insert mode. For the left-arrow key there's a message "E388 Couldn't find a definition" but the other cursor keys don't give messages. Also there is never a status "Insert" shown.

        Maybe there is a vimrc in your home directory after all. Once Vim has
        started,

        :echo $MYVIMRC

        will tell you (in most cases) which init script (if any) it has used.
        See :help $MYVIMRC for details.

        There might also be a "system vimrc". Its location ($VIM/vimrc by
        default, but that _is_ often changed at compile time) is also shown in
        the middle section of the :version output. If there is one, it is also
        usually the first script sourced by Vim, before your vimrc, so that it
        appears at the very top of the output of the :scriptnames command (see
        :help :scriptnames).
        >
        > How do I keep the "default" behavior and also turn line numbering on?
        > Or how do I configure that behavior in myvim.rc?

        I recommend adding the line

        runtime vimrc_example.vim

        near the start of your vimrc. This, however, will change many settings
        (giving them values which IMHO are more useful then the "vim default").
        It will also set the (recommended) 'nocompatible' setting, which will
        already be set if Vim has found a ~/.vimrc at the default location, but
        not if you use the -u command-line switch to tell Vim where your vimrc
        is located.

        You may have a look at that script by doing

        :view $VIRUNTIME/vimrc_example.vim

        -----------------------

        This whole stuff (including the E388) sounds to me as if there were a
        mapping defined somewhere for the arrow keys. Try the following:

        :verbose map! <Left>
        :verbose map! <Right>
        :verbose map! <Up>
        :verbose map! <Down>

        where <Left> <Right> etc. are as I wrote them (text between < and >),
        not just hitting ← ↓ ↑ or →.

        >
        > Thanks
        > Alan
        >

        Best regards,
        Tony.
        --
        When in doubt, tell the truth.
        -- Mark Twain

        --
        --
        You received this message from the "vim_use" 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 because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Alan
        ... Very many thanks for all the detail! That s a great help and I ll be able to figure it out now (probably). There is no $HOME/.vimrc just /etc/vimrc, but
        Message 3 of 4 , Aug 19, 2013
        • 0 Attachment
          On Saturday, August 17, 2013 7:29:22 PM UTC-7, Tony Mechelynck wrote:
          > On 08/18/13 00:31, Alan wrote:
          >

          Very many thanks for all the detail! That's a great help and I'll be able to figure it out now (probably).

          There is no $HOME/.vimrc just /etc/vimrc, but I'll steal from that and from /usr/share/vim/vim63/vimrc_example.vim

          Oddly, :echo $VIRUNTIME and :echo $MYVIMRC both show nothing and there are no key mappings set for the arrow keys ("No mapping found"). But I'm not groping in the dark now, so thanks again.

          Alan

          --
          --
          You received this message from the "vim_use" 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 because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Ben Fritz
          ... That should be VIMRUNTIME, not VIRUNTIME. ... If using -u myvimrc.vim, $MYVIMRC is not set. There was a doc update for this in 7.4. See near the end of the
          Message 4 of 4 , Aug 20, 2013
          • 0 Attachment
            On Monday, August 19, 2013 7:57:37 PM UTC-5, Alan wrote:
            > On Saturday, August 17, 2013 7:29:22 PM UTC-7, Tony Mechelynck wrote:
            > > On 08/18/13 00:31, Alan wrote:
            > >
            >
            > Very many thanks for all the detail! That's a great help and I'll be able to figure it out now (probably).
            >
            > There is no $HOME/.vimrc just /etc/vimrc, but I'll steal from that and from /usr/share/vim/vim63/vimrc_example.vim
            >
            > Oddly, :echo $VIRUNTIME

            That should be VIMRUNTIME, not VIRUNTIME.

            > and :echo $MYVIMRC both show nothing

            If using -u myvimrc.vim, $MYVIMRC is not set. There was a doc update for this in 7.4. See near the end of the vimrc topic at http://vimhelp.appspot.com/starting.txt.html#vimrc.

            --
            --
            You received this message from the "vim_use" 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 because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          Your message has been successfully submitted and would be delivered to recipients shortly.