On Mon, Sep 25, 2006 at 10:21:23PM +0100, Tom Carr wrote:
> I'm trying to pipe messages from ex commands (e.g. :map , :version)
> into a new tab.
> I've found http://vim.sourceforge.net/tips/tip.php?tip_id=95, but I
> was hoping for a better way.
> Ideally I would type something like  :tabmesages :map  and it would
> show :map in a new tab, without printing it to the screen, without
> waiting for additional keypresses, and without using up registers.

     You can turn the tip into a user-defined command, and if you are
using vim 7, then you can avoid using a register.  Personally, I would
use a function to take advantage of local variables.

fun! TabMessage(cmd)
  redir => message
  silent execute a:cmd
  redir END
  tab split
  put=message
endfun

command! -nargs=+ -complete=command TabMessage call TabMessage(<q-args>)

HTH                                     --Benji Fisher

Reply via email to