Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim wildmenu drill down into directories

Tags:

vim

I use vim to try to search for a file to open. I have wildmenu=full.

enter image description here

Pressing <tab> pushes me to the next directory, but how do I drill down on the currently-selected directory? My current workflow is: type a char, delete it, <tab> to continue. There must be a better way!

like image 628
Daniel Kats Avatar asked Mar 12 '17 14:03

Daniel Kats


People also ask

What does set wildmenu do in Vim?

"set wildmenu" enables a menu at the bottom of the vim/gvim window. The meaning of "list:longest,full" is so that when you do completion in the command line via tab, these events will happen: 1. (on the first tab) a list of completions will be shown and the command will be completed to the longest common command.

How do I change the working directory of a Vim file?

'autochdir' 'acd' boolean (default off) global When on, Vim will change the current working directory whenever you open a file, switch buffers, delete a buffer or open/close a window. It will change to the directory containing the file which was opened or selected. Note: When this option is on some plugins may not work.

How to open a BAR file in Vim?

Vim is no different. When you start vim, it gets the working directory of your shell. And then you can type commands like :e to open paths relative to your working directory. you can run :e bar.c to open a window containing the contents of the bar.c file, and then :sp bar.h to split the window horizontally and open a buffer for bar.h.

How do I open multiple files at once in Vim?

You can have multiple files open at once in vim, each is known stored and referred to as a buffer. If you do not want to close the current file you can also use :E(explore) to open a view of the current directory where you can open other files.


1 Answers

Press <Down>.

The available keybindings are of course listed under :help 'wildmenu':

While the "wildmenu" is active the following keys have special
meanings:

<Left> <Right> - select previous/next match (like CTRL-P/CTRL-N)
<Down>         - in filename/menu name completion: move into a
                 subdirectory or submenu.
<CR>           - in menu completion, when the cursor is just after a
                 dot: move into a submenu.
<Up>           - in filename/menu name completion: move up into
                 parent directory or parent menu.
like image 91
romainl Avatar answered Sep 20 '22 20:09

romainl