0

When I use :cd command in gvim it allows to complete the directories with a simple Tab press. However with :o command I only get ^I.

How can I migrate the same bahavior from :cd to :o?

1
  • As usual: :help :o.
    – romainl
    Feb 4 '15 at 14:19
5

The :o command does something completely different, where tabs wouldn't really make sense:

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.

For example, try pressing Q (that is, Shift+q). Then type o in the prompt. You should be back in normal mode. Now insert "This is some text" onto your current line, press Q again, and type o /x/. You should be back in normal mode, with your cursor on the x.

Using :o with a filename appears to work the same way as :e. However, I wouldn't rely on this, since it appears to be undocumented.

1

Vim only includes the :o[pen] command for legacy reasons. The command you're looking for is :e[dit], which has all the completion behavior you would expect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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