Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Yet another) GOPATH issue #468

Closed
notpratheek opened this issue Jun 29, 2015 · 9 comments
Closed

(Yet another) GOPATH issue #468

notpratheek opened this issue Jun 29, 2015 · 9 comments

Comments

@notpratheek
Copy link

This issue maybe a slightly funky one.

I have set my $GOPATH in ~/.bashrc as so:

# export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

and I have added the let g:go_bin_path in my .vimrc as so:

let g:go_bin_path = expand("~/go")

I tried with expand() and gave an absolute path as well.

Now, When I launch gvim from terminal and run :GoInstall it shows installed to /home/<myname>/go

but, when I launch gvim from i3wm as a keyboard shortcut, (I have bound Win Key + g to launch gvim), and run :GoInstall it shows a blank (as in vim-go: installed to _____ )

Is there anyway to fix ? Or, should I try with i3wm developer ?


I'm on Ubuntu 14.04.2 LTS, gvim (I installed vim-gtk) version gives : 7.4.052 (Yeah, Its old ! 😅 ), running go version gives go version go1.4.2 linux/amd64 and I'm using the master branch of your plugin

@fatih
Copy link
Owner

fatih commented Jun 29, 2015

Hi @notpratheek. What happens if you don't specify g:go_bin_path ?

@notpratheek
Copy link
Author

@fatih

If I remove g:go_bin_path, and

  1. from terminal open gvim and run :GoInstall it shows vim-go: installed to /home/<myname>/go
  2. from the keyboard shortcut, running :GoInstall it shows vim-go: installed to ______

@fatih
Copy link
Owner

fatih commented Jun 29, 2015

Oh btw, why are you calling :GoInstall? Did you mean :GoInstallBinaries ? It seems for the second option GOPATH is not set.

@notpratheek
Copy link
Author

Sorry, I meant that ! 😅

When I launch from shortcut and run :GoInstallBinaries, It shows the error : vim.go: $GOPATH is not set

But opening gvim from terminal and running :GoInstallBinaries, It runs fine !

@fatih
Copy link
Owner

fatih commented Jun 29, 2015

Got it, you need to check out Linux environment variables. This is really not vim-go related. I know but you are going to call :GoInstallBinaries only once. I can't say much or help you here :)

@fatih fatih closed this as completed Jun 29, 2015
@notpratheek
Copy link
Author

Ok ! Thanks @fatih 😄

@notpratheek
Copy link
Author

@fatih

I seemed to have solved the issue with the help from #i3 channel in IRC (but all and full credits to the good folks at #i3 IRC for coming up with the solution !).

To solve it, We need to add the $GOPATH and (the updated) $PATH variables to .xsessionrc, Log-out and re login.

That seems to solve this funky issue ! 😄


I'm leaving this info here, in case it might help someone else ! 😄

@gustavokuklinski
Copy link

I solved starting gvim with: bash -lc gvim, it will wrap Gvim with the current .profileor .bashrc file.

@bettinson
Copy link

Do you have Xcode developer tools installed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants