I'd like to write commands that work with :tab and :vert. Say I have a command that opens a new split window as shown below
function! FooSplit()
let l:message="hello world"
new
put! =l:message
endfunction
command! -complete=command Foo call FooSplit()
I'd like it to make it so that :tab Foo
and :vert Foo
will open in a new tab and vertical split respectively.