Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sainnhe/tmux-translator
Tmux translation plugin powered by popup window.
https://github.com/sainnhe/tmux-translator
google-translate tmux tmux-plugins translate translation
Last synced: 10 days ago
JSON representation
Tmux translation plugin powered by popup window.
- Host: GitHub
- URL: https://github.com/sainnhe/tmux-translator
- Owner: sainnhe
- License: mit
- Created: 2020-06-27T00:05:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-16T03:00:46.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T19:57:34.688Z (3 months ago)
- Topics: google-translate, tmux, tmux-plugins, translate, translation
- Language: Shell
- Homepage:
- Size: 12.7 KB
- Stars: 22
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README-zh.md
- License: LICENSE
Awesome Lists containing this project
README
![](https://gitlab.com/sainnhe/img/-/raw/master/translator.png)
# 安装
## 依赖
- tmux >= 3.2
- [skywind3000/translator#requirements](https://github.com/skywind3000/translator#requirements)## 通过 [TPM](https://github.com/tmux-plugins/tpm/) 安装
把这一行添加到 `~/.tmux.conf`
```tmux
set -g @plugin 'sainnhe/tmux-translator'
```重新加载配置,然后按 `prefix` + `I`
# 使用方法
进入 Copy Mode 选中一些文本,然后按 `t` 即可翻译,按回车或 Ctrl-C 退出翻译窗口。
你可以通过以下选项来定制这个插件:
```tmux
# 触发划词翻译的键
set -g @tmux-translator "t"# 浮动窗口宽度
set -g @tmux-translator-width "38%"# 浮动窗口高度
set -g @tmux-translator-height "38%"# 从什么语言翻译
set -g @tmux-translator-from "en"# 翻译到什么语言
set -g @tmux-translator-to "zh"# 翻译引擎
set -g @tmux-translator-engine "google"
# 多个翻译引擎
set -g @tmux-translator-engine "google|ciba|youdao"
```这里列出了所有可用引擎:[skywind3000/translator#engines](https://github.com/skywind3000/translator#engines)
# 更多插件
- [sainnhe/tmux-fzf](https://github.com/sainnhe/tmux-fzf): 用 FZF 管理 tmux sessions, windows, panes 等等。
# 许可
`/engine` 目录下的代码参考 [skywind3000/translator](https://github.com/skywind3000/translator)
其余部分的代码以 [MIT](./LICENSE) 许可分发。