command! -nargs=* -complete=file E if expand('%')=='' && line('$')==1
&& getline(1)=='' :tabnew <args> | else | :edit <args> | endif
(That's one long line)
Does this work for you ?
Yes it works but as Tony pointed out the expression should be switched.
And there is a pipe missing before :tabnew
Here it is :
if (v:version >= 700)
command! -nargs=* -complete=file E if expand('%')=='' && line('$')==1
&& getline(1)=='' | :edit <args> | else | :tabnew <args> | endif
cabbrev e <c-R>=(getcmdtype()==':' && getcmdpos()==1 ? 'E' : 'e')<cr>
endif
Thanks a lot !
I can continue using :e and it now behaves like I want it to do.
--
Fabien Meghazi
Website: http://www.amigrave.com
Email: [EMAIL PROTECTED]
IM: [EMAIL PROTECTED]