0

Is it possible to press tab or some other operator to view the available files in a given directory path? For example:

enter image description here

For example, in the unix shell I can do something like [tab] to get:

enter image description here

After trial-and-erring a bit, it seems like :e is the command I want to use instead of :o ? Is :e basically like "open with tab-complete" ?

2
  • 1
    :h 'wildmenu' – Jorengarenar Jul 15 '20 at 21:38
  • I think you're looking for <c-d>. Indeed, it does not work with :o, you'll need :e. – Biggybi Jul 17 '20 at 7:29
1

Open mode (from the :open command) is a bit of a legacy command:

                            *: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.

You want to use :edit instead to, well, edit a file. By default, you should be able to use :help cmdline-completion, including tab, to complete filenames. This works for :split, :vsplit , and :tabedit, too, as these are the standard "edit a file" commands.

1
  • Having said that, :tag-related commands and :find- or 'path'-related commands make my file-navigation much faster; rather than tab-completing to find what I want, I just jump directly to it – D. Ben Knoble Jul 15 '20 at 21:42

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.