Fabien Meghazi 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>
So I wonder if it's possible to change :edit command behaviour.
Keep your :E command, and add
:cabbrev e E
Now ":e" will change itself to ":E" when not followed by a letter, but
":edit" will get you the "old" behaviour of the :e command.
HTH,
Tony.