Comments (15)
I've pushed a change that it doesn't produce any error anymore if you set it, however you still can use GoUpdateBinaries. Please try it and report how it works for you.
from vim-go.
Works fine. Thanks for a quick fix :)
from vim-go.
Actually, I spoke too early. I still get this complaint:
vim.go: $GOPATH is not set
Press ENTER or type command to continue
I'm not sure whether it's caused by vim-go trying to autoinstall things, or something else - I get it even when I just launch vim, without any files present on the command line.
from vim-go.
This is normal. You have to set GOPATH to install the binaries. Therefore this is ok.
And when you launch vim-go it tries to auto install. You are going to see this error until you disable it.
from vim-go.
Sometimes my vim is running without GOPATH set. In those cases I'd rather have the auto-install fail silently, rather than have me press enter before it starts up.
from vim-go.
There is no functionality for that and I don't want to fail silently, sorry there. What you can do there:
- Disable auto install completely
- Use
:GoUpdateBinaries
to install the necessary tools
Also the binareis are installed once and never touched again. I don't know why you don't want to disable auto install, because it will prevent it.
from vim-go.
I don't have a problem with manually installing binaries, and I'll probably end up doing so. As for GOPATH warning - as I've mentioned earlier, more often than not there's no GOPATH in my environment (and I can't point one that will always be true). In those situations, regardless of whether the binaries are installed or not, vim will stop on startup and complain as mentioned above. I don't like that :)
from vim-go.
Did you try disabling auto install? Because it will prevent showing the GoPath warning. If you see the warning still means there is something else wrong.
from vim-go.
There's no warning when auto install is disabled. It works as expected.
There's a warning when auto install is enabled and GOPATH is unset, regardless of whether binaries are already installed or not.
from vim-go.
Ok, the think is the warning needs to be there, because otherwise go install
will fail by default if there is no GOPATH. To prevent it vim-go fails earlier with the warning to set GOPATH. It's needed basically. Sorry that there is no middle ground for you. You can remove those lines from install.vim file and never see. But as I said it doesn't make sense when there is no GOPATH and auto install is enabled, probably it will fail.
from vim-go.
Now that :GoUpdateBinaries
works, I'm OK :)
One extra idea: can you delay the initialization of vim-go (and as such - auto-installation of necessary binaries) till a *.go file is opened? This way things would get faster overall (no stuff done during startup) and my scenario would be mostly addressed :D
from vim-go.
Yeah, I have some plans (such as moving and structuring the functions under autoload). Also ftplugin is a need instead of plugin. Thanks for pointing out :)
Btw the autoinstall is just once. You could the install and then disable it. It will never again report it.
from vim-go.
Cool. Is there a chance you can update this bug when you implement this delayed init? Unless there's another bug I can track...?
from vim-go.
I don't think it's a good idea to show a warning every time a user invoke vim.
Maybe one doesn't even want to install go for now, maybe he just want to include go language support for his vim, and it's for future use.
A syntax plugin shouldn't have so tight relationship with it's language.
Nevertheless, this is just my personal opinion, hope it is not useless.
BTW, thanks for the excellent job.
from vim-go.
@apporc you are definetly right about that. Vim-go is mainly for people who code in Go rather than view Go code. That's why the plugin is built around this idea. If you just want syntax feature have a look at:
https://github.com/google/vim-ft-go
Is it still asking every time for question to install it?
from vim-go.
Related Issues (20)
- Merged #3617 breaks UltiSnips placeholder mechanism HOT 3
- Cannot install or make it work with NeoVim gives error E492: Not an editor command :GoDef HOT 2
- Auto imports not working HOT 1
- Error in identifier/syntax prevents autocommands to be executed HOT 7
- Support quoting arguments to :GoImpl HOT 3
- Development: `make lint` always fails using GNU grep 3.8 or later HOT 5
- Vim randomly stops when go_highlight_function_calls is on HOT 4
- Execution: GoFmt changes the Chinese at the end to <e4> HOT 2
- Startup time ~4 s on nvim, macos, even with empty init.lua HOT 1
- c-x c-o error HOT 8
- Running :GoDef or any other commands that require gopls fails without error HOT 9
- vim has defined a set of key positions that span the ages
- Thank you for sharing
- Call: GoReferrers error
- GoFillStruct with proto pb.go HOT 1
- Import string is not highlighted if some comment follows
- Why is vim-go removing semicolons? HOT 2
- vim-go: failed to sync breakpoints
- How to setup gopath manually inside `.vimrc` HOT 2
- godef crashes when looking up a tag HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-go.