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

Re: Using as a leader key breaks 'Does not trigger the InsertLeave autocommand event'

Expand Messages
  • Yasuhiro MATSUMOTO
    Sorry for top post. And sorry, I m talking about this without making sure the behavour. I wonder why you are trying to get InsertLeave with nnoremap. I beleave
    Message 1 of 7 , Aug 1, 2012
    View Source
    • 0 Attachment
      Sorry for top post. And sorry, I'm talking about this without making
      sure the behavour.
      I wonder why you are trying to get InsertLeave with nnoremap. I
      beleave that leader <c-c> afect to insert mode at the first. So I'm
      thinking it should be inoremap to do that.


      On 8/1/12, Mikey <smieciarski@...> wrote:
      > Using <C-c> as a leader key breaks 'Does not trigger the InsertLeave
      > autocommand event'
      >
      > I use GVim 7.3.600.
      > Steps to reproduce:
      >
      > gvim -u NONE -U NONE
      > set nocompatible
      > au InsertLeave * :echo "InsertLeave event triggered"
      > nnoremap <C-c>a k
      >
      > Now enter some text and while being in insert mode press <C-c> to exit
      > to normal mode.
      >
      > --
      > 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
      >


      --
      - Yasuhiro Matsumoto

      --
      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
      ... I think the problem is that the OP DOESN T want the InsertLeave autocmd to fire, so he uses to exit insert mode. The docs say should exit
      Message 2 of 7 , Aug 1, 2012
      View Source
      • 0 Attachment
        On Wednesday, August 1, 2012 10:25:57 AM UTC-5, mattn wrote:
        > Sorry for top post. And sorry, I'm talking about this without making
        >
        > sure the behavour.
        >
        > I wonder why you are trying to get InsertLeave with nnoremap. I
        >
        > beleave that leader <c-c> afect to insert mode at the first. So I'm
        >
        > thinking it should be inoremap to do that.
        >
        >

        I think the problem is that the OP DOESN'T want the InsertLeave autocmd to fire, so he uses <C-C> to exit insert mode. The docs say <C-C> should exit insert mode without firing the autocmd. If I understand correctly, with <C-C> as part of the LHS of a *normal mode* mapping, exiting Insert mode with <C-C> DOES trigger the autocmd.

        I also confirm this behavior. I would expect that a <C-C> mapping in normal mode has no effect on behavior of insert mode, but in this case, it does.

        --
        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
      • Mikey
        ... That s exactly what I meant. -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to.
        Message 3 of 7 , Aug 1, 2012
        View Source
        • 0 Attachment
          On Aug 1, 5:37 pm, Ben Fritz <fritzophre...@...> wrote:
          > I think the problem is that the OP DOESN'T want the InsertLeave autocmd to fire, so he uses <C-C> to exit insert mode. The docs say <C-C> should exit insert mode without firing the autocmd. If I understand correctly, with <C-C> as part of the LHS of a *normal mode* mapping, exiting Insert mode with <C-C> DOES trigger the autocmd.

          That's exactly what I meant.

          --
          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.