9

Is there a practical difference between using

:e

and

:edit

Except for readability, where it make sense in a mapping to use :edit, because it's more explicit.

Is there a difference between them?

Note: This apply as well to all other commands.

2
  • 2
    I consider the short commands as a command line convenience. I always use full command names in scripts. It's frustrating when the short commands are used in plugins. It makes grepping/searching scripts harder than it needs to be.
    – Tommy A
    Commented Jun 27, 2016 at 13:01
  • 2
    As @TommyA says. Consider these excerpts: setl nobl bt=nofile noswf, setl ma ff=unix noro, setl ro noma nomod. Can you tell quickly what they do? Look at the netrw sources for more inspiration. :) Commented Jun 27, 2016 at 19:58

1 Answer 1

10

There is no actual difference but in :h usr_20.txt, you can read:

It is recommended that in Vim scripts you write the full command name. That makes it easier to read back when you make later changes. Except for some often used commands like :w (:write) and :r (:read).

A particularly confusing one is :end, which could stand for :endif, :endwhile or :endfunction. Therefore, always use the full name.

So I would recommend to follow the doc and use the long name.

And another paragraph interesting about the short names:

How short can a command get? There are 26 letters, and many more commands. For example, :set also starts with :s, but :s doesn't start a :set command. Instead :set can be abbreviated to :se.

When the shorter form of a command could be used for two commands, it stands for only one of them. There is no logic behind which one, you have to learn them. In the help files the shortest form that works is mentioned.

2
  • 2
    Also consider :endfun. Who'd want such a thing. Commented Jun 27, 2016 at 20:04
  • 1
    That would be terrible indeed :-)
    – statox
    Commented Jun 27, 2016 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.