-
Notifications
You must be signed in to change notification settings - Fork 714
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
go: add zstyle to prevent listing packages from GOROOT and GOPATH #750
base: master
Are you sure you want to change the base?
Conversation
Adding all of GOROOT means all of stdlib is added as completions to many commands, which I find rather noisy and rarely useful. Before: [~/check]% go install <Tab> archive/ context/ fmt/ log/ regexp/ testing/ bufio/ crypto/ go/ math/ runtime/ text/ builtin/ database/ hash/ mime/ sort/ time/ bytes/ debug/ html/ net/ strconv/ unicode/ check.go encoding/ image/ os/ strings/ unsafe/ cmd/ errors/ index/ path/ sync/ vendor/ compress/ expvar/ internal/ plugin/ syscall/ container/ flag/ io/ reflect/ testdata/ After: [~/check]% go install <Tab> # completes to ./check.go, which is the only file in this small package. Also add a setting to disable GOPATH, as it's kind deprecated and on its way out. Sometimes I have some stuff "go get"'d in there, but I rarely want that as completions.
FYI @pseyfert, since you made a number of changes to the Go completion recently. |
btw, IMHO the |
Rather than have a custom style, all calling of external commands is supposed to be wrapped by the standard So it should just be something like:
Then you can use the command style. Which is also more flexible because in addition to disabling it, you can change the command to something else. |
Thanks for highlighting me. For |
I took the liberty to implement @okapia 's suggestion in pseyfert@18de228 . (I was thinking that the behavior of completing GOPATH or not could also be made "smart" by checking how |
Ah cheers, I looked at it and got confused and decided I need to sit down and read up a bit more on how this whole thing works, but haven't had the time yet 😅 |
Did you guys reach a consensus on this ? Personally I'm fine with @arp242's PR since it looks easier for users, but I am not familiar enough with go to make a decision. |
This has been sitting in inbox to look at; I've been pretty burned out by programming etc. in the last few months, so I haven't had the energy 😅 But feeling better now, and finishing up loads of stuff like this. I'll look again in a few days after I finish some other things and get back to ya'll. |
Adding all of GOROOT means all of stdlib is added as completions to many
commands, which I find rather noisy and rarely useful.
Before:
After:
Also add a setting to disable GOPATH, as it's kind deprecated and on its
way out. Sometimes I have some stuff "go get"'d in there, but I rarely
want that as completions.