On 7/17/06, Fabien Meghazi <[EMAIL PROTECTED]> wrote:
Hi all,

I would like to change the :edit command behaviour in order to make it
open a file in the current tab if the current buffer is empty or in a
new tab otherwise.

I've made a :E command like this :
command! -nargs=* -complete=file E :tabnew <args>

But I always forget to use :E instead of :e because I'm too used to
type :e <file>

Does the following work for you:

   cabbrev e <c-R>=(getcmdtype()==':' && getcmdpos()==1 ? 'E' : 'e')<cr>

It remaps ':e' to ':E' when e is typed at the beginning of command
line, followed by space or other delimtier char.

Yakov

Reply via email to