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

67428Re: 'imap' and 'imap ' treat keymap in a different way

Expand Messages
  • Bram Moolenaar
    Dec 5, 2012
    • 0 Attachment
      Maxim Gonchar wrote:

      > I use vim 7.3.712 from Arch repository. I use keymap=3Drussian-jcukenwin,
      > which have letters (x, =DF) instead of [] brackets.
      > The problem is when I map [ to some action with <buffer> option
      > imap <buffer> [ 111
      > The mapping doesn't respect the chosen keymap. I.e. when I press a key for
      > '=C8' I get 111 no matter what iminsert value is.
      >
      > While if the key is mapped without <buffer>
      > imap [ 111
      > then the keymap is respected. So I get 111 when iminsert=3D0 and '=C8' when
      > iminsert=3D1.
      >
      > Is it the expected behavior?
      > That is very annoying. For my own configuration one can live with it. But
      > it breaks some plugins (auto-pairs for example).

      The problem is that buffer-local mappings overrule global mappings. A
      buffer-local mapping cannot remap a global mapping. And the keymap uses
      global mappings.

      It does work for a simple example though:

      :lmap x >
      :set iminsert=1
      :" inserting x will now insert >
      :imap <buffer> > !
      :" inserting x will now insert !

      There must be something else interfering.

      --
      # echo reboot >universe
      # chmod +x universe
      # ./universe

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

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