GithubHelp home page GithubHelp logo

petronny / pinyin-completion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adaptee/pinyin-completion

63.0 63.0 13.0 628 KB

complete path name based upon the pinyin acronym of Chinese characters

License: GNU General Public License v3.0

Shell 100.00%

pinyin-completion's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pinyin-completion's Issues

zsh下*也被当成拼音

正常情况下输入ls * ,然后按tab补全就会自动补全当前目录下的文件名。但是如果执行一次source ~/.zshrc后再输入ls *按tab就会出现拼音补全的界面。
具体见下图:
pycp

Question: 多于一个匹配的中文目录补全时,会增加一个不存在的候选项

@petronny ,您好!

首先感谢您接手此项目并将此软件带到 [archlinuxcn] 仓库。 🌹

在此我冒昧报告一个问题:

使用 Zsh 配合此软件进行拼音补全时,当出现多于一个匹配的中文目录补全时,按 Tab 键不知为何会增加一个候选项,内容为所有匹配中文目录连接在一起的字符串(并不存在名字为此字符串的目录),见图:

cd3

如何去掉这一个多余且不存在的候选项?

在此祝您新年愉快! 🎁

此致! 🙇

cd命令自动补全的bug

当前环境:archlinux,zsh

当前目录test文件夹下有一个‘测试.txt'文件,输入命令 cd test/ ,然后按tab补全,会将测试.txt和test/作为候选项,测试.txt作为文件不应被列到cd补全列表里,test/作为上级目录也不应列到补全候选里。

如果不是中文文件名就没这个bug,比如当前目录test文件夹下有一个test.txt文件,输入 cd test/ ,按tab补全,zsh就会提示‘-- No Matches Found --’,不会将test.txt作为补全候选,也不会列出test/。

不知道描述清楚没,有需要另外信息请指教。

另外感谢petronny,简直是中文用户的神器。我这里也没有性能问题,感觉和没启用之前一样快。

zsh extra qoute

should replace

reply=(${(q)$(pinyin-comp x-d $*)} $*)

with

reply=(${$(pinyin-comp x-d $*)} $*)

to avoid outputs being escaped twice:

(base) (win/x64)  ➜  ~/winhome/Downloads ls zr<TAB>
\'自然语言处理结课报告封面.docx\'  \'自然语言处理课程结课作业.docx\'  zr
(base) (win/x64)  ➜  ~/winhome/Downloads ls \'自然语言处理结课报告封面.docx\' # should be '自然语言处理结课报告封面.docx'

[bug] unsupported locale setting

In ubuntu-20.04 LTS:

❯ pinyin-comp -d a
Traceback (most recent call last):
  File "/home/wzy/.local/share/zinit/plugins/pinyin-completion/pinyin-comp", line 233, in <module>
    locale.setlocale(locale.LC_ALL, "")
  File "/usr/lib/python3.10/locale.py", line 620, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

I find comment locale.setlocale(locale.LC_ALL, "") can make this plugin work. What is the function of this line? Can we remove it or change it to:

from contextlib import suppress
import locale

with suppress(locale.Error):
    locale.setlocale(locale.LC_ALL, "")

../经过拼音扩展后变成了.

环境:
archlinux
grml-zsh-config 0.11.2-1
zsh 5.0.7-1
zsh-completions 0.12.0-1

问题描述:当前文件夹上一层有一个文件夹‘图片’,当输入命令进入‘图片’文件夹时,'cd ../tp'扩展后变成了'.图片'。

排除zshrc问题,用下面的最小化的zshrc测试过了。
autoload -U compinit
compinit

Zsh pinyin completion

source /usr/share/pinyin-completion/shell/pinyin-comp.zsh

附图:
pycl

命令按tab补全时的问题

又打扰了,刚才又发现一个alias的命令的问题。

我zshrc里有一些alias的命令,其中一个是mplayer的:alias mplayertext='mplayer -vo aa' 。
当我输入mplayertext后按tab正常的应该是显示当前目录的文件和子目录,但是却补全了当前的alias命令mplayertest。如下图:
alias

还有另一种情况,在zshrc里alias一个比mplayertext更长的命令,比如:alias mplayertexttext='mplayer -vo aa' 。
这时再输入mplayertext按tab就正常显示目录和文件。如下图:
alias2

alias的命令补全时只有一个候选就会出现问题。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.