Loading ...
Sorry, an error occurred while loading the content.

Vim patch to complete buffer names case insensitive on Unix

Expand Messages
  • Anton Sharonov
    This patch is not thought to be included into the mainline VIM sources (yet). Patch solves my problem, may be it will be useful for somebody else as well. I
    Message 1 of 1 , Sep 25, 2009
    • 0 Attachment
      This patch is not thought to be included into the mainline VIM
      sources (yet). Patch solves my problem, may be it will be useful
      for somebody else as well.

      I have long time missed in Unix VIM one small feature, which is
      available in windows GVIM - "case insensitive buffer names
      completion". Therefore this patch.

      Description:

      Assuming two buffers are opened in VIM

      path/to/TMaster.java
      path/to/TSlave.java

      On windows, :b tma<TAB> finds TMaster

      On Unix, only :b TMa<TAB> finds, :b tma<TAB> finds nothing.

      Patch enables windows behavior (case insensitive buffer names
      completion) on Unix as well.

      See also following thread in vim_use mailing list:

      http://groups.google.com/group/vim_use/browse_thread/thread/047b0f89bd0fc022/5a919dd6d1f64928?#5a919dd6d1f64928

      PS: To make the patch ready for the mainline, case sensitivity on
      buffer completion should not be just always "off", it must be
      controlled by a new option: for example 'ignorebuffercase'
      (analog with 'ignorefilecase' from TODO). Although TODO list
      already contains proposal for the similar 'ignorefilecase'
      option, in my opinion it is better to made the extra option for
      buffer names case sensitivity.

      --
      Anton

      *** src/buffer.c.orig 2009-09-25 21:29:04.000000000 +0200
      --- src/buffer.c 2009-09-25 21:29:17.000000000 +0200
      ***************
      *** 2271,2277 ****
      if (name != NULL)
      {
      regmatch.regprog = prog;
      ! #ifdef CASE_INSENSITIVE_FILENAME
      regmatch.rm_ic = TRUE; /* Always ignore case */
      #else
      regmatch.rm_ic = FALSE; /* Never ignore case */
      --- 2271,2279 ----
      if (name != NULL)
      {
      regmatch.regprog = prog;
      ! /* always ignore case for :buf buf*name command
      ! * completion */
      ! #if (1)
      regmatch.rm_ic = TRUE; /* Always ignore case */
      #else
      regmatch.rm_ic = FALSE; /* Never ignore case */

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.