Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
分享一个在命令行中通过拼音就能进入中文目录的方法
Apps Section
1608
views ·
3
replies ·
To
floor
Go
litsdeepin
deepin
2018-02-21 13:25
Author
本帖最后由 litsdeepin 于 2018-8-20 05:53 编辑
先给出作者的github https://github.com/petronny/pinyin-completion 致敬!
前言:
在命令行中进入中文目录,每次都要切换到中文输入法才能进入,非常麻烦。很希望可以通过拼音就能进入中文目录,这样就不用总是切换输入法了,在网上找了找,还真有,用了之后感觉非常棒,特地分享给大家。
方法如下:
1. 下载作者的包到本地。(随便下载到哪里都好,随你喜欢,
我是放在了/opt里
)
git clone https://github.com/petronny/pinyin-completion.git
Copy the Code
2. 进入刚刚下载好的目录
cd pinyin-completion
Copy the Code
3. 执行安装命令
sudo ./setup.py install
Copy the Code
4. 添加下列命令到bash或zsh的配置文件,如果用的bash,修改~/.bashrc,如果用的zsh,修改~/.zshrc (我这里用zsh为例)
source /opt/pinyin-completion/shell/pinyin-comp.zsh
Copy the Code
(注意:我的是安装目录在/opt下,请把/opt替换为自己的下载位置,bash用户请将末尾的zsh替换为bash)
5. 让配置生效
source ~/.zshrc
Copy the Code
(bash用户,请使用 source ~/.bashrc)
使用方法:
1. cd 到中文目录
deepin@deepin: $ ls .
科学大观 Downloads Documents
deepin@deepin: $ cd kx
Copy the Code
例如:我的主目录下有
科学大观
目录,使用的时候,输入cd,然后
顺序
输入科学大观的
首字母(注:输入全拼无效)
,然后按 Tab 便出现了候选的中文目录
更多用法请参考作者的github
2. vi 中文文件名
用法同上
3.
必须顺序输入拼音首字母才有效
(当然,不用输入所有汉字的首字母)
效果如下:
Reply
Like 0
Favorite
View the author
All Replies
辉夜
deepin
2018-02-21 13:45
#1
这么早Orz
Reply
Like 0
View the author
litsdeepin
deepin
2018-02-21 13:55
#2
https://bbs.deepin.org/post/153401
这么早Orz
哈哈,你也很早啊~~~
Reply
Like 0
View the author
jingle
deepin
2018-02-21 21:25
#3
好东西
Reply
Like 0
View the author
Please
sign
in first
New Thread
Rankings
7 days
30 days
90 days
1
阿尼樱奈奈
98 posts
2
neko
97 posts
3
江南布衣
95 posts
4
Merlin
93 posts
5
神末shenmo
92 posts
6
度深蓝
79 posts
Popular Events
More
先给出作者的github https://github.com/petronny/pinyin-completion 致敬!
前言:
在命令行中进入中文目录,每次都要切换到中文输入法才能进入,非常麻烦。很希望可以通过拼音就能进入中文目录,这样就不用总是切换输入法了,在网上找了找,还真有,用了之后感觉非常棒,特地分享给大家。
方法如下:
1. 下载作者的包到本地。(随便下载到哪里都好,随你喜欢,我是放在了/opt里)
5. 让配置生效
使用方法:
1. cd 到中文目录
更多用法请参考作者的github
2. vi 中文文件名
用法同上
3. 必须顺序输入拼音首字母才有效(当然,不用输入所有汉字的首字母)
效果如下: