On 7/17/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:
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>

I made a vimtip out of this

 http://www.vim.org/tips/tip.php?tip_id=1285
 "Tip #1285: change behaviour of builtin commands like :e using
special case of cabbrev"

There were similar requests on the list before.

Yakov

Reply via email to