全部小文字ユーザ定義コマンドハック
ねんがんの全小文字ユーザ定義コマンドをてにいれたぞ!
ユーザ定義コマンドの名前を小文字で始められないのは、組み込みコマンドとの混乱を避けるため。
以下はユーザ定義コマンドを呼び出すとき、コマンド名の検索をケースインセンシティブにするハック。つまり :Bclose というコマンドを :bclose で呼べるようになる。
--- ../src.orig/ex_docmd.c 2006-06-02 01:35:56.001000000 +0900 +++ ex_docmd.c 2006-08-23 16:26:17.078125000 +0900 @@ -2817,7 +2817,7 @@ #ifdef FEAT_USR_CMDS /* Look for a user defined command as a last resort */ - if (eap->cmdidx == CMD_SIZE && *eap->cmd >= 'A' && *eap->cmd <= 'Z') + if (eap->cmdidx == CMD_SIZE) { /* User defined commands may contain digits. */ while (ASCII_ISALNUM(*p)) @@ -2869,7 +2869,7 @@ cp = eap->cmd; np = uc->uc_name; k = 0; - while (k < len && *np != NUL && *cp++ == *np++) + while (k < len && *np != NUL && tolower(*cp++) == tolower(*np++)) k++; if (k == len || (*np == NUL && vim_isdigit(eap->cmd[k]))) {