completion-ignore-case in Vim

In topic Miscellaneous :: Published Monday, March 17, 2008

When you enable completion-ignore-case in $HOME/.inputrc, you get a completion key, usually Tab, that doesn't care if you've typed the proper case of a file. Highly useful when working with mixed-case files, e.g. NiftyFunctions.cpp or the $HOME/Desktop folder in certain operating systems.

This does the same thing for anything using files in Vim. Note, however, that it will not cause Vim to ignore casing generally -- it's just for completion. When you've given Vim the proper filename, that's the name that'll be used.

Grab the latest Vim (7.1 as of the time of writing) and apply the following patch:

--- misc1.c.orig        2008-02-23 11:36:45.000000000 +0100
+++ misc1.c     2008-02-23 11:36:28.000000000 +0100
@@ -8980,15 +8980,15 @@
     if (pat == NULL)
     {
        vim_free(buf);
        return 0;
     }

     /* compile the regexp into a program */
-#ifdef CASE_INSENSITIVE_FILENAME
+#if 1 //CASE_INSENSITIVE_FILENAME
     regmatch.rm_ic = TRUE;             /* Behave like Terminal.app */
 #else
     regmatch.rm_ic = FALSE;            /* Don't ever ignore case */
 #endif
     regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
     vim_free(pat);

Rebuild with your favourite flags.


If this is the first time you comment on my site, your post might get held up in the moderation queue. Don't panic, I'll approve it as soon as possible!

Code (i.e. literal) blocks should be wrapped inside <PRE>.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Close
Powered by ShareThis