vim - 如何在neovim中安装vim-translate插件

标签 vim configuration neovim

我正在尝试安装以下 neovim 翻译应用程序:
https://github.com/voldikss/vim-translator

我使用了 pip3 install --user neovim
我的 ~/.config/nvim 配置如下:

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc

call plug#begin()
Plug 'roxma/nvim-completion-manager'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'voldikss/vim-translator'
call plug#end()

""" Example configuration
" Echo translation in the cmdline
nmap <silent> <Leader>t <Plug>Translate
vmap <silent> <Leader>t <Plug>TranslateV
" Display translation in a window
nmap <silent> <Leader>w <Plug>TranslateW
vmap <silent> <Leader>w <Plug>TranslateWV
" Replace the text with translation
nmap <silent> <Leader>r <Plug>TranslateR
vmap <silent> <Leader>r <Plug>TranslateRV

然后我做了:
nvim
:PlugInstall
:UpdateRemotePlugins
:q!
:q!

在 nvim 中尝试示例命令时
:TranslateW -w test -e bing youdao -l zh

(编辑:现在这有效。维护者修复了错误)

我收到这个错误
Error detected while processing function translator#translate:                                        
line   25:
E716: Key not present in Dictionary: to_lang . (g:translator_proxy_url ? (' --proxy ' . g:translator_proxy_url
) : '')
E15: Invalid expression: s:python_executable . ' ' . s:py_file . ' --text '      . shellescape(args_obj.word) 
. ' --engines '   . join(args_obj.engines, ' ') . ' --toLang '    . args_obj.to_lang . (g:translator_proxy_url
 ? (' --proxy ' . g:translator_proxy_url) : '')

我没有想法了。安装说明非常模糊。

python --version: Python 2.7.12
python3 --version: Python 3.5.2
nvim --version
nvim --version
NVIM v0.3.8
Build type: Release
LuaJIT 2.0.4
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -Wconversion -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-4YEfmh/neovim-0.3.8/build/config -I/build/neovim-4YEfmh/neovim-0.3.8/src -I/usr/include -I/build/neovim-4YEfmh/neovim-0.3.8/build/src/nvim/auto -I/build/neovim-4YEfmh/neovim-0.3.8/build/include

vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 07 2019 15:35:43)
Included patches: 1-1689
Extra patches: 8.0.0056

:checkhealth
health#translator#check
========================================================================
  - OK: Async check passed
  - ERROR: Floating window is missed on the current version Nvim
    - ADVICE:
      - Upgrade your Nvim")
  - OK: Using python3

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='4205'

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xsel

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help provider-python
          /usr/bin/python2.7 does not have the "neovim" module. :help provider-python
          python2.6 not found in search path or not executable.
          /usr/bin/python does not have the "neovim" module. :help provider-python
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python version: 3.5.2
  - INFO: pynvim version: 0.4.0
  - OK: Latest pynvim is installed.

最佳答案

我向维护者提出了一个问题,维护者修复了该错误。 github.com/voldikss/vim-translator/issues/35

关于vim - 如何在neovim中安装vim-translate插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59570826/

相关文章:

git - NeoVim Fugitive 插件 Gpush 锁定

css - 如何编辑 VIM Omni Completion 以便所有 CSS 属性不以冒号结尾?

vim - vim 的命令行窗口可以配置为*不* 移动缓冲区的内容吗?

asp.net - CS0234 : Missing Assembly Reference

ssh - 连接到系统 : neovim inside tmux inside ssh

python - 尽管 Python 在 Neovim 中工作得很好,但插件无法识别 Neovim 中的 Python 主机

php - PHP 文件类型中 HTML 的 Vim 自动缩进不起作用

vim - 如果内容未更改,则停止 Vim 保存文件

c# - 在配置准备好之前配置 Serilog?

hibernate - 如何使用环境变量配置 Hibernate