go: add zstyle to prevent listing packages from GOROOT and GOPATH#750
go: add zstyle to prevent listing packages from GOROOT and GOPATH#750arp242 wants to merge 1 commit into
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.