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

Re: Map calls two functions - aware of insertmode

Expand Messages
  • Ben Schmidt
    ... Why do you need the bar? And won t you need to escape the backslash in the on account of the double quotes? And it looks like MyOMap was a command in
    Message 1 of 2 , Jan 31, 2008
    View Source
    • 0 Attachment
      > Tried various options:
      > exec 'onoremap <silent> '.o_map."
      > :<C-U>MyOMap'".o_map."'<CR>\|:call MySecondFcn()<CR>"
      > exec 'onoremap <silent> '.o_map."
      > :<C-U>MyOMap'".o_map."'<CR>\|<C-\><C-O>:call MySecondFcn()<CR>"
      > exec 'onoremap <silent> '.o_map."
      > :<C-U>MyOMap'".o_map."'<CR><Bar><C-\><C-O>:call MySecondFcn()<CR>"

      Why do you need the bar?

      And won't you need to escape the backslash in the <C-\> on account of the double
      quotes?

      And it looks like MyOMap was a command in the above, not a function, as you have
      no :call and no brackets around its argument? Shouldn't you either omit the quotes
      around the argument to MyOMap (if it's a command) or put brackets and :call?

      So, linewrapped for ease of reading, I would think you want either

      exec 'onoremap <silent> '.
      o_map.
      ":<C-U>MyOMap'".
      o_map.
      "'<CR><C-\\><C-O>:call MySecondFcn()<CR>"

      or

      exec 'onoremap <silent> '.
      o_map.
      ":<C-U>call MyOMap('".
      o_map.
      "')<CR><C-\\><C-O>:call MySecondFcn()<CR>"

      Ben.





      Send instant messages to your online friends http://au.messenger.yahoo.com


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.