{"id":13666113,"url":"https://github.com/voldikss/vim-translator","last_synced_at":"2025-04-04T20:12:53.460Z","repository":{"id":37431788,"uuid":"183240682","full_name":"voldikss/vim-translator","owner":"voldikss","description":":closed_book: Translating plugin for Vim/Neovim","archived":false,"fork":false,"pushed_at":"2023-05-25T04:01:23.000Z","size":337,"stargazers_count":521,"open_issues_count":15,"forks_count":48,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T19:08:26.415Z","etag":null,"topics":["neovim","vim","vim-translate"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voldikss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-04-24T14:00:13.000Z","updated_at":"2025-03-20T20:19:18.000Z","dependencies_parsed_at":"2024-01-16T22:20:11.340Z","dependency_job_id":"ae5b1813-55fc-4e08-ae3b-128e100178ec","html_url":"https://github.com/voldikss/vim-translator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voldikss%2Fvim-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voldikss%2Fvim-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voldikss%2Fvim-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voldikss%2Fvim-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voldikss","download_url":"https://codeload.github.com/voldikss/vim-translator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242681,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim","vim","vim-translate"],"created_at":"2024-08-02T06:00:59.039Z","updated_at":"2025-04-04T20:12:53.429Z","avatar_url":"https://github.com/voldikss.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"# vim-translator\n\n![CI](https://github.com/voldikss/vim-translator/workflows/CI/badge.svg)\n\nAsynchronous translating plugin for Vim/Neovim\n\n![](https://user-images.githubusercontent.com/20282795/89249090-e3218880-d643-11ea-83a5-44915445690e.gif)\n\n- [Installation](#installation)\n- [Features](#features)\n- [Configuration](#configuration)\n- [Keymaps](#key-mappings)\n- [Commands](#commands)\n- [Highlight](#highlight)\n- [Statusline](#statusline)\n- [Know bugs](#know-bugs)\n- [FAQ](#faq)\n- [Breaking changes](#breaking-changes)\n- [References](#references)\n- [License](#license)\n\n## Installation\n\n```vim\nPlug 'voldikss/vim-translator'\n```\n\n## Features\n\n- Asynchronous \u0026 mutithreading translating\n- Popupwin(vim8) \u0026 floatwin(neovim) support\n- Multiple engines: see [g:translator_default_engines](#gtranslator_default_engines)\n- Proxy support\n- No requirements for appid/appkey\n\n## Configuration\n\n#### **`g:translator_target_lang`**\n\nType `String`.\n\nDefault: `'zh'`\n\nPlease refer to [language support list](https://github.com/voldikss/vim-translator/wiki)\n\n#### **`g:translator_source_lang`**\n\nType `String`.\n\nDefault: `'auto'`\n\nPlease refer to [language support list](https://github.com/voldikss/vim-translator/wiki)\n\n#### **`g:translator_default_engines`**\n\nType `List` of `String`.\n\nAvailable: `'bing'`, `'google'`, `'haici'`, `'iciba'`(expired), `'sdcv'`, `'trans'`, `'youdao'`\n\nDefault: If `g:translator_target_lang` is `'zh'`, this will be `['bing', 'google', 'haici', 'youdao']`, otherwise `['google']`\n\n#### **`g:translator_proxy_url`**\n\nType `String`. Default: `''`\n\nExample: `let g:translator_proxy_url = 'socks5://127.0.0.1:1080'`\n\n#### **`g:translator_history_enable`**\n\nType `Boolean`.\n\nDefault: `v:false`\n\n#### **`g:translator_window_type`**\n\nType `String`.\n\nDefault: `'popup'`\n\nAvailable: `'popup'`(use floatwin in nvim or popup in vim), `'preview'`\n\n#### **`g:translator_window_max_width`**\n\nType `Number` (number of columns) or `Float` (between 0 and 1). If `Float`,\nthe width is relative to `\u0026columns`.\n\nDefault: `0.6`\n\n#### **`g:translator_window_max_height`**\n\nType `Number` (number of lines) or `Float` (between 0 and 1). If `Float`, the\nheight is relative to `\u0026lines`.\n\nDefault: `0.6`\n\n#### **`g:translator_window_borderchars`**\n\nType `List` of `String`. Characters of the floating window border.\n\nDefault: `['─', '│', '─', '│', '┌', '┐', '┘', '└']`\n\n## Key Mappings\n\nThis plugin doesn't supply any default mappings.\n\n```vim\n\"\"\" Configuration example\n\" Echo translation in the cmdline\nnmap \u003csilent\u003e \u003cLeader\u003et \u003cPlug\u003eTranslate\nvmap \u003csilent\u003e \u003cLeader\u003et \u003cPlug\u003eTranslateV\n\" Display translation in a window\nnmap \u003csilent\u003e \u003cLeader\u003ew \u003cPlug\u003eTranslateW\nvmap \u003csilent\u003e \u003cLeader\u003ew \u003cPlug\u003eTranslateWV\n\" Replace the text with translation\nnmap \u003csilent\u003e \u003cLeader\u003er \u003cPlug\u003eTranslateR\nvmap \u003csilent\u003e \u003cLeader\u003er \u003cPlug\u003eTranslateRV\n\" Translate the text in clipboard\nnmap \u003csilent\u003e \u003cLeader\u003ex \u003cPlug\u003eTranslateX\n```\n\nOnce the translation window is opened, type `\u003cC-w\u003ep` to jump into it and again to jump back\n\nBeside, there is a function which can be used to scroll window, only works in neovim.\n\n```vim\nnnoremap \u003csilent\u003e\u003cexpr\u003e \u003cM-f\u003e translator#window#float#has_scroll() ?\n                            \\ translator#window#float#scroll(1) : \"\\\u003cM-f\u003e\"\nnnoremap \u003csilent\u003e\u003cexpr\u003e \u003cM-b\u003e translator#window#float#has_scroll() ?\n                            \\ translator#window#float#scroll(0) : \"\\\u003cM-b\u003e\"\n```\n\n## Commands\n\n#### `Translate`\n\n`:Translate[!] [--engines=ENGINES] [--target_lang=TARGET_LANG] [--source_lang=SOURCE_LANG] [your text]`\n\nTranslate the `text` from the source language `source_lang` to the target language `target_lang` with `engine`, echo the result in the cmdline\n\nIf `engines` is not given, use `g:translator_default_engines`\n\nIf `text` is not given, use the text under the cursor\n\nIf `target_lang` is not given, use `g:translator_target_lang`\n\nThe command can also be passed to a range, i.e., `:'\u003c,'\u003eTranslate ...`, which translates text in visual selection\n\nIf `!` is provided, the plugin will perform a reverse translating by switching `target_lang` and `source_lang`\n\nExamples(you can use `\u003cTab\u003e` to get completion):\n\n```vim\n:Translate                                  \" translate the word under the cursor\n:Translate --engines=google,youdao are you ok \" translate text `are you ok` using google and youdao engines\n:2Translate ...                             \" translate line 2\n:1,3Translate ...                           \" translate line 1 to line 3\n:'\u003c,'\u003eTranslate ...                         \" translate selected lines\n```\n\n#### `TranslateW`\n\n`:TranslateW[!] [--engines=ENGINES] [--target_lang=TARGET_LANG] [--source_lang=SOURCE_LANG] [your text]`\n\nLike `:Translate...`, but display the translation in a window\n\n#### `TranslateR`\n\n`:TranslateR[!] [--engines=ENGINES] [--target_lang=TARGET_LANG] [--source_lang=SOURCE_LANG] [your text]`\n\nLike `:Translate...`, but replace the current text with the translation\n\n#### `TranslateX`\n\n`:TranslateX[!] [--engines=ENGINES] [--target_lang=TARGET_LANG] [--source_lang=SOURCE_LANG] [your text]`\n\nTranslate the text in the clipboard\n\n#### `TranslateH`\n\n`:TranslateH`\n\nExport the translation history\n\n#### `TranslateL`\n\n`:TranslateL`\n\nDisplay log message\n\n## Highlight\n\nHere are the default highlight links. To customize, use `hi` or `hi link`\n\n```vim\n\" Text highlight of translator window\nhi def link TranslatorQuery             Identifier\nhi def link TranslatorDelimiter         Special\nhi def link TranslatorExplain           Statement\n\n\" Background of translator window border\nhi def link Translator                  Normal\nhi def link TranslatorBorder            NormalFloat\n```\n\n## Statusline\n\n- `g:translator_status`\n\n## FAQ\n\nhttps://github.com/voldikss/vim-translator/issues?q=label%3AFAQ\n\n## Breaking Changes\n\nhttps://github.com/voldikss/vim-translator/issues?q=label%3A%22breaking+change%22\n\n## References\n\n- [dict.vim](https://github.com/iamcco/dict.vim)\n- [translator](https://github.com/skywind3000/translator)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoldikss%2Fvim-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoldikss%2Fvim-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoldikss%2Fvim-translator/lists"}