How to change automatic full behavior in vim?

Explain an example.

I want to break my window and open the x.txt file

In the folder where I work, I also have a set of files: from file-a.txt to file-z.txt

If I print:

:sp file Tab

Instead of :sp file- As I usually meet in bash.

I get:: :sp file-a.txt

This is not very convenient, since I need to either press Tab funny times or type very long names.

Is there a way to set autocomplete behavior for VIM for file names?

Thank you for your time.

+4
source share
2 answers

The 'wildmode' parameter controls completion on the command line. Try

 :set wildmode=longest:full,full 

This should provide the desired effect.

+11
source

Here you can use a wildcard:

 :sp *x<Tab> 

In the scenario you are describing, pressing one <Tab> should end with the command line:

: sp file-x.txt

+1
source

All Articles