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

Arrows keys in insert mode stopped working...

Expand Messages
  • Paolo Bolzoni
    Dear list, After some frustration tring to use CodeBlocks I decided to setup vim for c++ programming and I installed the following plugins: Command-T
    Message 1 of 8 , Aug 7, 2014
    • 0 Attachment
      Dear list,

      After some frustration tring to use CodeBlocks I decided to setup
      vim for c++ programming and I installed the following plugins:

      Command-T
      minibufexpl.vim
      nerdcommenter
      nerdtree
      syntastic
      tagbar
      undotree
      vim-easymotion
      vim-sensible
      vim-sleuth

      And now I have a quite strange problem, arrows key do not work in
      insert mode! I "fixed" adding this lines in my vimrc, but it is
      hardly a solution. How can I pinpoint the problem?

      inoremap <up> <esc>ki
      inoremap <down> <esc>ji
      inoremap <left> <esc>hi
      inoremap <right> <esc>li

      I tried to set term=builtin_ansi, but it does not help. It just
      changes what symbols are shown after pressing the keys...

      Your faithfully,
      Paolo

      --
      --
      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/d/optout.
    • Óscar Pereira
      Are you sure the problem is caused by one of the plugins? Have you tried removing them all and then adding them back one by one, to see which one (if any)
      Message 2 of 8 , Aug 7, 2014
      • 0 Attachment
        Are you sure the problem is caused by one of the plugins? Have you
        tried removing them all and then adding them back one by one, to see
        which one (if any) caused the issue?

        On Thu, Aug 07, 2014 at 11:14:06AM +0200, Paolo Bolzoni wrote:
        >Dear list,
        >
        >After some frustration tring to use CodeBlocks I decided to setup
        >vim for c++ programming and I installed the following plugins:
        >
        >Command-T
        >minibufexpl.vim
        >nerdcommenter
        >nerdtree
        >syntastic
        >tagbar
        >undotree
        >vim-easymotion
        >vim-sensible
        >vim-sleuth
        >
        >And now I have a quite strange problem, arrows key do not work in
        >insert mode! I "fixed" adding this lines in my vimrc, but it is
        >hardly a solution. How can I pinpoint the problem?
        >
        >inoremap <up> <esc>ki
        >inoremap <down> <esc>ji
        >inoremap <left> <esc>hi
        >inoremap <right> <esc>li
        >
        >I tried to set term=builtin_ansi, but it does not help. It just
        >changes what symbols are shown after pressing the keys...
        >
        >Your faithfully,
        >Paolo
        >
        >--
        >--
        >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/d/optout.


        --
        Óscar Pereira | https://erroneousthoughts.org

        Rules of Optimisation:
        Rule 1: Don't do it.
        Rule 2 (for experts only): Don't do it yet.
        -- M.A. Jackson
      • Paolo Bolzoni
        It was not fault of the plugins... I was an unexpected side effect of inoremap I setup to push myself to use ctrl-c to change from insert
        Message 3 of 8 , Aug 7, 2014
        • 0 Attachment
          It was not fault of the plugins... I was an unexpected side
          effect of "" inoremap <esc> <nop> "" I setup to push myself to
          use ctrl-c to change from insert mode to normal mode.

          It is possible to disable the esc key without breaking the
          arrows?

          On Thu, Aug 7, 2014 at 12:46 PM, Óscar Pereira <burn.till.skid@...> wrote:
          > Are you sure the problem is caused by one of the plugins? Have you
          > tried removing them all and then adding them back one by one, to see
          > which one (if any) caused the issue?
          >
          >
          > On Thu, Aug 07, 2014 at 11:14:06AM +0200, Paolo Bolzoni wrote:
          >>
          >> Dear list,
          >>
          >> After some frustration tring to use CodeBlocks I decided to setup
          >> vim for c++ programming and I installed the following plugins:
          >>
          >> Command-T
          >> minibufexpl.vim
          >> nerdcommenter
          >> nerdtree
          >> syntastic
          >> tagbar
          >> undotree
          >> vim-easymotion
          >> vim-sensible
          >> vim-sleuth
          >>
          >> And now I have a quite strange problem, arrows key do not work in
          >> insert mode! I "fixed" adding this lines in my vimrc, but it is
          >> hardly a solution. How can I pinpoint the problem?
          >>
          >> inoremap <up> <esc>ki
          >> inoremap <down> <esc>ji
          >> inoremap <left> <esc>hi
          >> inoremap <right> <esc>li
          >>
          >> I tried to set term=builtin_ansi, but it does not help. It just
          >> changes what symbols are shown after pressing the keys...
          >>
          >> Your faithfully,
          >> Paolo
          >>
          >> --
          >> --
          >> 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/d/optout.
          >
          >
          >
          > --
          > Óscar Pereira | https://erroneousthoughts.org
          >
          > Rules of Optimisation:
          > Rule 1: Don't do it.
          > Rule 2 (for experts only): Don't do it yet.
          > -- M.A. Jackson

          --
          --
          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/d/optout.
        • Óscar Pereira
          ... I have no idea but... why would you *want* to disable the key?! How would change between insert and normal mode? Do want to always use vim on insert
          Message 4 of 8 , Aug 7, 2014
          • 0 Attachment
            On Thu, Aug 07, 2014 at 01:05:34PM +0200, Paolo Bolzoni wrote:
            >It was not fault of the plugins... I was an unexpected side
            >effect of "" inoremap <esc> <nop> "" I setup to push myself to
            >use ctrl-c to change from insert mode to normal mode.
            >
            >It is possible to disable the esc key without breaking the
            >arrows?

            I have no idea but... why would you *want* to disable the <esc>
            key?! How would change between insert and normal mode? Do want to
            always use vim on insert mode? IMHO you might as well don't bother
            to use vim at all...

            --Óscar
          • Marcin Szamotulski
            ... I guess you are using vim in a terminal. I think there is no way since if you hit an arrow key the terminal send an escape code which usually starts with
            Message 5 of 8 , Aug 7, 2014
            • 0 Attachment
              On 12:40 Thu 07 Aug , Óscar Pereira wrote:
              > On Thu, Aug 07, 2014 at 01:05:34PM +0200, Paolo Bolzoni wrote:
              > >It was not fault of the plugins... I was an unexpected side
              > >effect of "" inoremap <esc> <nop> "" I setup to push myself to
              > >use ctrl-c to change from insert mode to normal mode.
              > >
              > >It is possible to disable the esc key without breaking the
              > >arrows?

              I guess you are using vim in a terminal. I think there is no way since
              if you hit an arrow key the terminal send an escape code which usually
              starts with the same code as for <Esc> key then they are interpreted by
              vim. You can check what vim sees when you hit an arrow if hit ctrl-v
              + arrow key in the insert mode.

              But your solution will work in gvim.

              Best regards,
              Marcin Szamotulski

              ps. please do not top-post.
            • Paolo Bolzoni
              ... Sorry. I guess I was unclear. I want to force myself to use Control-C to change from Insert Mode to Normal Mode instead of Esc. In Insert mode the effect
              Message 6 of 8 , Aug 8, 2014
              • 0 Attachment
                On Thu, Aug 7, 2014 at 1:40 PM, Óscar Pereira <burn.till.skid@...> wrote:
                > On Thu, Aug 07, 2014 at 01:05:34PM +0200, Paolo Bolzoni wrote:
                >>
                >> It was not fault of the plugins... I was an unexpected side
                >> effect of "" inoremap <esc> <nop> "" I setup to push myself to
                >> use ctrl-c to change from insert mode to normal mode.
                >>
                >> It is possible to disable the esc key without breaking the
                >> arrows?
                >
                >
                > I have no idea but... why would you *want* to disable the <esc>
                > key?! How would change between insert and normal mode? Do want to
                > always use vim on insert mode? IMHO you might as well don't bother
                > to use vim at all...
                >
                > --Óscar

                Sorry. I guess I was unclear. I want to force myself to use
                Control-C to change from Insert Mode to Normal Mode instead of
                Esc. In Insert mode the effect of Esc and Control-C is the same.

                My Esc is not hard to reach, true... but using Control-C and not
                moving the hand at all sounded more "vimsical" (ok, sorry for the
                pun)


                Paolo

                --
                --
                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/d/optout.
              • Paolo Bolzoni
                ... I see, too bad. Thanks for the explanation. Sorry for the top post, gmail interface pushes wrong habits. -- -- You received this message from the vim_use
                Message 7 of 8 , Aug 8, 2014
                • 0 Attachment
                  On Thu, Aug 7, 2014 at 2:43 PM, Marcin Szamotulski <mszamot@...> wrote:
                  > On 12:40 Thu 07 Aug , Óscar Pereira wrote:
                  >> On Thu, Aug 07, 2014 at 01:05:34PM +0200, Paolo Bolzoni wrote:
                  >> >It was not fault of the plugins... I was an unexpected side
                  >> >effect of "" inoremap <esc> <nop> "" I setup to push myself to
                  >> >use ctrl-c to change from insert mode to normal mode.
                  >> >
                  >> >It is possible to disable the esc key without breaking the
                  >> >arrows?
                  >
                  > I guess you are using vim in a terminal. I think there is no way since
                  > if you hit an arrow key the terminal send an escape code which usually
                  > starts with the same code as for <Esc> key then they are interpreted by
                  > vim. You can check what vim sees when you hit an arrow if hit ctrl-v
                  > + arrow key in the insert mode.
                  >
                  > But your solution will work in gvim.
                  >
                  > Best regards,
                  > Marcin Szamotulski
                  >
                  > ps. please do not top-post.


                  I see, too bad. Thanks for the explanation.

                  Sorry for the top post, gmail interface pushes wrong habits.

                  --
                  --
                  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/d/optout.
                • Ben Fritz
                  ... Note that using to quit insert mode means that abbreviations will not be expanded, and the InsertLeave autocmd does not fire. The former makes some
                  Message 8 of 8 , Aug 8, 2014
                  • 0 Attachment
                    On Friday, August 8, 2014 8:15:26 AM UTC-5, Paolo Bolzoni wrote:
                    > I want to force myself to use
                    >
                    > Control-C to change from Insert Mode to Normal Mode instead of
                    >
                    > Esc. In Insert mode the effect of Esc and Control-C is the same.
                    >
                    >
                    >
                    > My Esc is not hard to reach, true... but using Control-C and not
                    >
                    > moving the hand at all sounded more "vimsical" (ok, sorry for the
                    >
                    > pun)
                    >
                    >

                    Note that using <C-C> to quit insert mode means that abbreviations will not be expanded, and the InsertLeave autocmd does not fire.

                    The former makes some uses of abbreviations not usable for you, the latter makes some plugins not function properly.

                    You may want to map <C-C> in insert mode to first expand abbreviations with <C-]>, and maybe do any InsertLeave autocmds using a :doautocmd command.

                    --
                    --
                    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/d/optout.
                  Your message has been successfully submitted and would be delivered to recipients shortly.