0

I have set wildmenu and set wildmode=list,full in my .vimrc.

If I go to enter a command such as buf or tabe, follow it with a space, and then hit tab, my wildmenu options take effect as I'd expect, but for some commands, such as open, I can't tab complete afterwards. Instead ^I characters are added.

Why can't I tab complete after open?

SnoringFrog
  • 957
  • 6
  • 13

1 Answers1

4

First of all you should understand What does :open do in vim? (thanks @Carpetsmoker for link)

open has only one argument :open /pattern/ (see :help open and link above) and no complete options.

For file names completion you should define your own command, something like this

:command -complete=file -nargs=1 Open open <args>

Pay attention to -complete= argument it may take some value listed in documentation and including file , file_in_path, buffer etc. and finally custom function.

-nargs=1 indicate that you command can take only one arument

See :help command for full explanation and examples.

Now you can type :Open and then press Tab

Or just use :edit command instead, it has completion option like as a buffer and tabe commands.

Alex Kroll
  • 1,069
  • 10
  • 16
  • Did not realize open operated that way. Guess I'll have to get myself to start using edit (or just buffer and tabe, I suppose), or fallback to a custom command if I can't make the mental switch lol. – SnoringFrog Aug 14 '15 at 18:31