Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
case insensitive completion
- X-seq: zsh-workers 25000
- From: sergio <zsh@xxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: case insensitive completion
- Date: Mon, 12 May 2008 16:36:37 +0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Hello.
I want to make case insensitive completion for russian language.
From the manpage:
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}
but analog with russian:
zstyle ':completion:*' matcher-list 'm:{а-яА-Я}={А-Яа-я}
doesn't work
Also, this doesn't work too:
zstyle ':completion:*' matcher-list
'm:{абвгдеёжзийклмнопрстуфхцчшщъыьэюя}={АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ}'
'm:{я}={Я}' doesn't work for letter 'я', but 'm:{z}={Z}' works for
letter 'z'.
This works:
zstyle ':completion:*' matcher-list '+m:{a-zA-Z}={A-Za-z}' '+m:а=А'
'+m:б=Б' '+m:в=В' '+m:г=Г' '+m:д=Д' '+m:е=Е' '+m:ё=Ё' '+m:ж=Ж' '+m:з=З'
'+m:и=И' '+m:й=Й' '+m:к=К' '+m:л=Л' '+m:м=М' '+m:н=Н' '+m:о=О' '+m:п=П'
'+m:р=Р' '+m:с=С' '+m:т=Т' '+m:у=У' '+m:ф=Ф' '+m:х=Х' '+m:ц=Ц' '+m:ч=Ч'
'+m:ш=Ш' '+m:щ=Щ' '+m:ъ=Ъ' '+m:ы=Ы' '+m:ь=Ь' '+m:э=Э' '+m:ю=Ю' '+m:я=Я'
'+m:А=а' '+m:Б=б' '+m:В=в' '+m:Г=г' '+m:Д=д' '+m:Е=е' '+m:Ё=ё' '+m:Ж=ж'
'+m:З=з' '+m:И=и' '+m:Й=й' '+m:К=к' '+m:Л=л' '+m:М=м' '+m:Н=н' '+m:О=о'
'+m:П=п' '+m:Р=р' '+m:С=с' '+m:Т=т' '+m:У=у' '+m:Ф=ф' '+m:Х=х' '+m:Ц=ц'
'+m:Ч=ч' '+m:Ш=ш' '+m:Щ=щ' '+m:Ъ=ъ' '+m:Ы=ы' '+m:Ь=ь' '+m:Э=э' '+m:Ю=ю'
'+m:Я=я'
but this is not very well ):
zsh can lower and uppercase russian letters:
% qwe=йцу
% echo ${(U)qwe}
ЙЦУ
% echo ${(L)${(U)qwe}}
йцу
and in EXTENDED_GLOB there is globbing flag i which works right for
rissian language:
% setopt EXTENDED_GLOB
% ls (#i)йцу
ЙцУ ЙЦУ
P.S.
Have zsh something for case switching.
It will be great to write something like:
zstyle ':completion:*' matcher-list 'm:$a=swithcase($a)
--
sergio
Messages sorted by:
Reverse Date,
Date,
Thread,
Author