Vim's documentation has this to say about the :open
command:
This command is in Vi, but Vim only simulates it:
*:o* *:op* *:open*
:[range]o[pen] Works like |:visual|: end Ex mode.
{Vi: start editing in open mode}
:[range]o[pen] /pattern/ As above, additionally move the cursor to the
column where "pattern" matches in the cursor
line.
Vim does not support open mode, since it's not really useful. For those
situations where ":open" would start open mode Vim will leave Ex mode, which
allows executing the same commands, but updates the whole screen instead of
only one line.
It does not comment on the nature of the "simulation", and why this is considered to be a simulation rather than a real command with different behavior. When run from ex mode (Q), it does indeed behave as described.
However, there also appears to be a different open command. When run from the normal command line, or from ex mode with different arguments, it appears to be a synonym for :edit
. When run from command mode with a /pattern/
, it positions the cursor and apparently runs :edit
(with the cursor position only being evident if :edit fails.) It can also be run as :open /pattern/ file
, which positions the cursor and runs :edit file
My question is: Why is this not documented? Are there any differences from :edit
that I am not noticing? Was :open
once a synonym for :edit
and only changed later in an attempt to halfway comply with POSIX?