You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if there would be shell completion for all nix commands, like:
% git a<TAB>
add -- add file contents to index
ai -- alias for 'add -i'
am -- apply patches from a mailbox
ap -- alias for 'add -p'
apply -- apply patch to files and/or to index
archimport -- import an Arch repository into git
archive -- create archive of files from named tree
Reacted by davidak, Milán Nagy and Bob van der Linden
Sorry for reviving such an old issue but I started working on zsh completion for Nix commands. I have finished about 99% of the nix-env options. This should be a good reference point for implementing the completion of other commands. I could need some help to implement the options for the other commands and improving existing ones.
Paths are completed most places where it makes sense. eg. nix-env -i --file local.nix -A, nix-shell '<nixpkgs>' -A, etc.
spwihitt haven't responed yet, but I've used it for a while myself without major problems. It would be nice if someone wanted to test it to weed out possible bugs before it's (hopefully) merged.
Activity
chaoflow commentedon Jul 15, 2012
resources that might be useful:
http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Widgets
http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System
http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/completion/git-completion.bash;hb=HEAD
svenkeidel commentedon Jul 25, 2014
Hi,
Sorry for reviving such an old issue but I started working on zsh completion for Nix commands. I have finished about 99% of the
nix-envoptions. This should be a good reference point for implementing the completion of other commands. I could need some help to implement the options for the other commands and improving existing ones.Repo is at https://github.com/svenkeidel/nixos-zsh-completion
Best,
Sven
domenkozar commentedon Feb 6, 2015
👍
bjornfor commentedon Oct 8, 2015
I'd really like to have completion for attributes: "nix-env -iA nixos.TAB_TAB" :-)
olejorgenb commentedon Jun 19, 2016
There is a package for zsh completions now: http://github.com/spwhitt/nix-zsh-completions (
nix-env -iA nix-zsh-completions)Also: nix-community/nix-zsh-completions#3 (WIP on attribute completions)
The implementation for nix-env at https://github.com/svenkeidel/nixos-zsh-completion seems to be a bit better that the nix-zsh-completion package though. (
nix-env -i<tab>is handlet better for instance)joelmo commentedon Jun 20, 2016
Before someone do it for bash you should now there is interest redesigning the command interface, #779.
olejorgenb commentedon Jul 30, 2016
Hopefully not spammy: A working attribute path completion for zsh is at nix-community/nix-zsh-completions#4
Paths are completed most places where it makes sense. eg.
nix-env -i --file local.nix -A,nix-shell '<nixpkgs>' -A, etc.spwihitt haven't responed yet, but I've used it for a while myself without major problems. It would be nice if someone wanted to test it to weed out possible bugs before it's (hopefully) merged.
olejorgenb commentedon Dec 21, 2016
New version of nix-zsh-completions (with attribute path completion) is now in master: NixOS/nixpkgs#21331
olejorgenb commentedon Nov 10, 2017
@hedning have implemented completions for bash too (including the new
nixcommands): #1658 (comment)(ref #1658)
lheckemann commentedon Feb 16, 2018
This is done now, no? Suggest close.
hedning commentedon Apr 2, 2018
From 18.03 and forward nix-bash-completions will be installed when
programs.bash.enableCompletionis turned on, so I'd also suggest closing this.There's a question of how to make completion work out of the box when using Nix on non-NixOS systems, but that's another issue.
Merge pull request NixOS#37 from obsidiansystems/git-with-refs
Merge pull request NixOS#37 from domenkozar/dependabot/pip/sphinx-3.1.0
libutil/nar-accessor: extract fso::descendPath path-walk helper
doc/inventory: Branch lines for libfetchers/libflake/libutil/nix-cli …
doc/inventory: add NixOS#220 and NixOS#221 + record Pass-B follow-up …
doc/inventory: STATUS — record Pass-B follow-up amends + NixOS#220/Ni…
libutil/nar-accessor: extract fso::descendPath path-walk helper
libutil/canon-path: add numSegments accessor