I have created a simple user-defined command using the following vim script
command! -nargs=* -complete=file EE :call EE(<f-args>)
function! EE(...)
if filereadable(expand(a:1))
exec 'edit ' . a:1
endif
endfunction
:EE file
will open a file (like the built-in command ":edit file
)
But unlike :tab edit file
the command :tab EE file
will not open a new tab.
Is it possible to enhance the script so that a "prefix" like :tab
or :vert
could be used?