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

91123Re: omap with 'f' and 't' and getchar() and nr2char()

Expand Messages
  • Ben Schmidt
    May 31, 2008
      > I am happy to use expression maps if I can somehow get a function to
      > be called after them using the technique (or otherwise) above:
      > onoremap <expr> f MyExprOp('f')<bar>:call MyDisplay()<CR>
      > Just wondering if there is anyway how this might be accomplished.

      The ":call MyDisplay()<CR>" should either be part of the expression that MyExprOp
      returns, or appended to it with the "." operator. So far you've tried including it
      as for a regular map, not an <expr> map. Try (roughly)

      func! MyExprOp(arg)
      let char=getchar()
      return "f".char.":call MyDisplay()\<CR>"


      onoremap <expr> f MyExprOp('f').":call MyDisplay()\<CR>"

      and let me know how you go...


      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 18 messages in this topic