How do I make Vim's command-line tab completion case-insensitive for file and buffer names?
Answer
:set wildignorecase
Explanation
:set wildignorecase makes Vim's command-line tab completion treat uppercase and lowercase letters as equivalent when completing file names, buffer names, and other identifiers. On case-sensitive filesystems (Linux), this lets you type a partial name in any case and still match the correct target.
How it works
- Affects all wildmenu completions:
:edit,:split,:find,:buffer,:cd,:source, and others - When you type a partial path and press
<Tab>, Vim matches regardless of case - Does not affect pattern searching (
ignorecaseandsmartcasecontrol that) - Does not change how filenames are stored — it only affects the matching during completion
Example
On a Linux system with a file named README.md:
:e readme<Tab> → completes to :e README.md
:sp Config<Tab> → completes to :sp config.py (or CONFIG.py)
:b Main<Tab> → matches MainController buffer
Without wildignorecase, these completions would find no matches on a case-sensitive filesystem.
Tips
- Add
set wildignorecaseto.vimrcto make it permanent - Combine with
set wildmenuandset wildmode=longest:full,fullfor the best completion experience - Different from
set fileignorecase, which affects how Vim handles filenames internally across all operations - Particularly useful when working on Linux with codebases that use PascalCase file names