Hello,

I'm trying to make a nice interface for :call system(...). For this I made the
following function:

function! System(arg)
    " Expand %, %:p (all modifiers are allowed except :s?pat?sub? and
    " :gs?pat?sub?
    return system(substitute(a:arg, '\(%\%(:[p8~.htre]\)*\)', 
'\=expand(submatch(0))', 'g'))
endfunction

The command 
command! -nargs=1 System            :echo System("<args>")
works as expected, but when I change it to:

command! -nargs=1 -complete=file System     :echo System("<args>")

and use it 
:System ls /tmp
I get the E172 error. Any ideas why?

Best regards,
Marcin

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