echuraev / translate-shell.vim

Translate-shell.vim is a plugin for translating text without leaving Vim.
GNU General Public License v3.0
69 stars 5 forks source link

How to config to run Translate Shell in Win 10's GVIM? #8

Closed VimWei closed 5 years ago

VimWei commented 5 years ago

I've installed GVIM 8.1.1 with translate-shell.vim under win10. I've also installed Translate Shell in Cygwin64 under win10, and it work well.

I do not know how to config to run Translate Shell in GVIM, thanks!

echuraev commented 5 years ago

Hi @ChenWeird! I didn't try to use it in Windows. But I think may be you have to pass your PATH to GVIM. Could you please give me more details how did you install the trahslate-shell.vim to GVIM and which settings of translate-shell.vim do you use?

VimWei commented 5 years ago

I've installed WSL and Translate Shell:

$ wget git.io/trans
$ chmod +x ./trans
$ sudo mv trans /usr/bin/

Now I can run Translate Shell command such as $ trans word in WSL.

And I added the following code to vimrc:

if has("windows")
    set shell=C:\Windows\Sysnative\wsl.exe
    set shellpipe=|
    set shellredir=>
    set shellcmdflag=
endif

Now I can run Translate Shell command such as :!trans word in GVIM , and it can pop up shell to work well.

And I install translate-shell.vim with: Plug 'echuraev/translate-shell.vim' But I do not know how to specify path to translate-shell by defining g:trans_bin variable.

what should I do?

echuraev commented 5 years ago

Sorry for the late reply. Just I didn't have a Windows machine with Vim. I found that the problem was connected with Windows behavior because on Windows we are not able to check if file is executable in custom shell (e.g we have set variable shell). I fixed it and merged to master. @ChenWeird Could you please update plugin from master and check it on your configuration? I checked it manually on my Win10 machine and it works for me. Hope it will work on your machine.