Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to enable case insensitive filename completion in Vim

📅 2014-Jan-24 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ completion, filename, vim ⬩ 📚 Archive

Vim with case insensitive filename autocompletion

Opening files and directories from inside Vim can be a bit irritating. This is because it expects you to type the correct case sensitive prefix of the filename or directory before you can autocomplete it by pressing Tab. There are two problems here: Vim wants you to type the prefix and the prefix needs to match the filename with correct case. The second problem here can now be fixed in 7.3 and later versions of Vim.

The wildignorecase option can be set to enable Vim to perform case insensitive autocompletion of filename or directories.

To set it in your .vimrc use:

set wildignorecase

If you use your .vimrc across older and newer versions of Vim, then you might want to check for this option before you set it:

if exists("&wildignorecase")
    set wildignorecase

Tried with: Vim 7.3 and Ubuntu 12.04

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧