1

I'd like to learn about using vim with multiple files without using external plugins.

I read another answer that recommends putting the following in our .vimrc:

set wildmenu
set wildmode=longest:full,full

Now when I use :e <Tab> I get the following output:

enter image description here

In this case, there is a file at some/path/to/bar.rb but vim is only showing me some/.

Some questions:

  • From reading the linked answer I thought the list was supposed to be vertical. Why is it still horizontal?
  • Is it possible for wildmenu to show the full path to some/path/to/bar.rb?
  • Does my vim . followed by :e <Tab> pattern make sense? Is there a better way?
  • It is always horizontal and it is impossible to make it vertical. – Christian Brabandt Mar 24 '17 at 18:03
  • I actually saw from the linked answer that they said horizontal, I just read it wrong. But is it possible to expand the paths? – mbigras Mar 24 '17 at 18:05
  • yes that should be possible. I think the path is always relative to Vims getcwd() path, so simply do :cd / and it should work like you want. – Christian Brabandt Mar 24 '17 at 18:11
  • How does :cd / help? It puts me in the root of my filesystem. I want some/ to be expanded to some/path/to/foo.rb while in the menu. – mbigras Mar 24 '17 at 18:20
  • 2
    You can use <c-d> to list out the possible completion candidates. This isn't exactly vertical, but might be closer to what you want. You can also use globs to go deeper into your directory structure e.g. :e **/foo.rb<tab>. – Peter Rincker Mar 24 '17 at 18:56

Your Answer

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

Browse other questions tagged or ask your own question.