Excerpts from rameo's message of Fri Mar 18 09:12:21 +0000 2011:
> Thank you for replying.
> I could not find out how it works. In the helpfile is written that
> mod() needs an expression.
No, it does not. read again [expr] means optional.

Is this what you want?

  let cmd = 'do something with range'
  if mode() = 'v'
    " vim will add '<,'> for you:
    call feedkeys(':'.cmd)
  else
    call feedkeys(':%'.cmd)
  endif

As alternative to feedkeys you can try the normal command.

bind echoe mode() to the menu and see how it behaves.

I don't use menues. So I may have missed obvious simple solutions.

Tell us in english words what you want to happen if you press your menu when
which mode is active.

Marc Weber

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

Reply via email to