zsh-dict 是使用 zsh 脚本编写的一个命令行翻译工具,使用百度翻译接口。
fork 自 whinc/dict工程 经过修改
复制下面命令到终端中执行即可:(假设安装在~/zsh/zsh-dict中)
-
从仓库克隆
git clone https://github.com/trifolium-wang/zsh-dict.git ~/.zsh/zsh-dict
-
添加到你的.
~/.zshrc
文件中source ~/.zsh/zsh-dict/zsh-dict.zsh
-
启动一个新的终端session
-
从仓库clone
git clone https://github.com/trifolium-wang/zsh-dict.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-dict
-
将插件添加到 Oh My Zsh 的插件列表中以加载(在
~/.zshrc
中):plugins=( # other plugins... zsh-dict )
-
启动一个新的终端session
用法:dict [word]...
说明:如果只有一个单词,则翻译该单词。如果有超过一个单词,则视作句子进行翻译。
$ dict hello
你好
$ dict hello world
你好世界