From: sergio <zsh@sergio.spb.ru>
To: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: case insensitive completion
Date: Mon, 12 May 2008 16:36:37 +0400 [thread overview]
Message-ID: <482839D5.6070901@sergio.spb.ru> (raw)
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
next reply other threads:[~2008-05-12 12:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-12 12:36 sergio [this message]
2008-05-12 12:52 ` Peter Stephenson
2008-05-13 5:40 ` Andrey Borzenkov
2008-05-14 9:47 ` Peter Stephenson
2008-05-14 14:12 ` sergio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=482839D5.6070901@sergio.spb.ru \
--to=zsh@sergio.spb.ru \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).