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

Re: auto switch mode to NORMAL when + is pressed

Expand Messages
  • Chris Schneider
    imap Where imap is insert mode mapping , is control-x (or whatever you d want), and is the action the mapping takes. In this case,
    Message 1 of 6 , Jan 7, 2013
    • 0 Attachment
      imap <c-x> <esc>

      Where imap is "insert mode mapping", <c-x> is control-x (or whatever you'd want), and <esc> is the action the mapping takes. In this case, just hitting escape.

      Also note that ctrl-[ is interpreted by most terminals as an escape key as well, if you ever find yourself lacking an escape key on your keyboard (ohh, hello ipad keyboard case).




      On Mon, Jan 7, 2013 at 6:10 AM, surr.name <litichevskij.vova@...> wrote:
      Hi!
      Is there any way to switch mode automaticaly to NORMAL when <Ctrl>+<something> pressed and Vim is in INSERT mode?

      For example:
      Vim is in INSERT mode, and pressing <Ctrl>+f scrolls the screen.

      --
      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 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
    • Литичевский Вова
      looks like the question was wrong formulated. I ve meant something like this imap i but for all keys combinations with but thanks
      Message 2 of 6 , Jan 7, 2013
      • 0 Attachment
        looks like the question was wrong formulated.
        I've meant something like this

        imap <c-f>    <esc><c-f>i

        but for all keys combinations with <Ctrl>
        but thanks anyway!


        2013/1/7 Chris Schneider <chris@...>
        imap <c-x> <esc>

        Where imap is "insert mode mapping", <c-x> is control-x (or whatever you'd want), and <esc> is the action the mapping takes. In this case, just hitting escape.

        Also note that ctrl-[ is interpreted by most terminals as an escape key as well, if you ever find yourself lacking an escape key on your keyboard (ohh, hello ipad keyboard case).




        On Mon, Jan 7, 2013 at 6:10 AM, surr.name <litichevskij.vova@...> wrote:
        Hi!
        Is there any way to switch mode automaticaly to NORMAL when <Ctrl>+<something> pressed and Vim is in INSERT mode?

        For example:
        Vim is in INSERT mode, and pressing <Ctrl>+f scrolls the screen.

        --
        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 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 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
      • Chris Schneider
        There are lots of insert mode commands. You can overwrite them with mappings, but you d be losing out on everything vim can do in insert mode. You have the
        Message 3 of 6 , Jan 7, 2013
        • 0 Attachment
          There are lots of insert mode commands.  You can overwrite them with mappings, but you'd be losing out on everything vim can do in insert mode.

          You have the right mappings in your last comment there if you want to just use that.  I'm not aware of a sweeping configuration setting that'd do it though.



          On Mon, Jan 7, 2013 at 8:28 AM, Литичевский Вова <litichevskij.vova@...> wrote:
          looks like the question was wrong formulated.
          I've meant something like this

          imap <c-f>    <esc><c-f>i

          but for all keys combinations with <Ctrl>
          but thanks anyway!


          2013/1/7 Chris Schneider <chris@...>
          imap <c-x> <esc>

          Where imap is "insert mode mapping", <c-x> is control-x (or whatever you'd want), and <esc> is the action the mapping takes. In this case, just hitting escape.

          Also note that ctrl-[ is interpreted by most terminals as an escape key as well, if you ever find yourself lacking an escape key on your keyboard (ohh, hello ipad keyboard case).




          On Mon, Jan 7, 2013 at 6:10 AM, surr.name <litichevskij.vova@...> wrote:
          Hi!
          Is there any way to switch mode automaticaly to NORMAL when <Ctrl>+<something> pressed and Vim is in INSERT mode?

          For example:
          Vim is in INSERT mode, and pressing <Ctrl>+f scrolls the screen.

          --
          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 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 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 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
        • sc
          ... are you aware of ? used in insert mode it allows one normal mode command then returns you to insert mode. In your example above when
          Message 4 of 6 , Jan 7, 2013
          • 0 Attachment
            On Mon, Jan 07, 2013 at 05:28:23PM +0200, Литичевский Вова wrote:
            > looks like the question was wrong formulated.
            > I've meant something like this

            > imap <c-f> <esc><c-f>i

            > but for all keys combinations with <Ctrl>
            > but thanks anyway!

            are you aware of <C-O>? used in insert mode it allows one normal mode
            command then returns you to insert mode. In your example above

            <C-O><C-F>

            when executed from insert mode would leave insert mode, perform <C-F>,
            and return you to insert mode.

            see

            :h i_CTRL-O

            sc

            --
            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
          • Литичевский Вова
            Thanks a lot for ! 2013/1/7 sc ... -- ÷Ï×Á ìÉÔÉÞÅ×ÓËÉÊ. -- You received this message from the vim_use maillist. Do
            Message 5 of 6 , Jan 7, 2013
            • 0 Attachment
              Thanks a lot for <C-O> !


              2013/1/7 sc <toothpik@...>
              On Mon, Jan 07, 2013 at 05:28:23PM +0200, Литичевский Вова wrote:
              > looks like the question was wrong formulated.
              > I've meant something like this

              > imap <c-f>    <esc><c-f>i

              > but for all keys combinations with <Ctrl>
              > but thanks anyway!

              are you aware of <C-O>?  used in insert mode it allows one normal mode
              command then returns you to insert mode.  In your example above

                  <C-O><C-F>

              when executed from insert mode would leave insert mode, perform <C-F>,
              and return you to insert mode.

              see

                  :h i_CTRL-O

              sc

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