nix-community / nix-zsh-completions

ZSH Completions for Nix
BSD 3-Clause "New" or "Revised" License
228 stars 31 forks source link

Make nix-build completions more like path completions #6

Closed LisannaAtHome closed 6 years ago

LisannaAtHome commented 6 years ago

Currently, completing nested data structures in nix-build produces the entire current selection in the autocomplete choices, for instance:

nix-build -A foo.bar.(TAB) foo.bar.baz foo.bar.bop foo.bar.bezel

For deeply nested data structures, this can get incredibly unwieldy to try to tab through, since the size of the suggestions will grow over time. Instead, it should probably work like how ZSH autocompletes regular filesystem paths, suggesting only the next layer at each level:

nix-build -A foo.bar.(TAB) baz bop bezel

hedning commented 6 years ago

Agreed that seems more consistent and sane. I have a fix using the _sep_parts function (_multi_parts, which I think is used in file completion used way too much time doing a bunch of weird stuff). Should be in the next release in a few days :)

LisannaAtHome commented 6 years ago

That's great to hear! Thanks!