Explain by example.
I want to split my window and open file-x.txt
In the folder where I am working I also have the set of files: from file-a.txt to file-z.txt
If I type:
:sp file
Tab
Instead of getting
:sp file-
As I usually get in bash.
I get:
:sp file-a.txt
This is not very convenient as I need to either tap Tab ridiculous times or type really long names.
Is there a way to set the auto-complete behaviour for VIM for file names?
Thank you for your time.
You can use a wildcard here:
:sp *x<Tab>
In the scenario you describe, hitting a single <Tab>
should complete the command-line to:
:sp file-x.txt
The 'wildmode'
setting controls the completion in the command line. Try
:set wildmode=longest:full,full
This should achieve the desired effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With