Skip to content

zsh/bash/... completion for nix* commands #37

Closed

Description

@chaoflow

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

Activity

  1. svenkeidel commented on Jul 25, 2014

    @svenkeidel

    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-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.

    Repo is at https://github.com/svenkeidel/nixos-zsh-completion

    Best,
    Sven

  2. domenkozar commented on Feb 6, 2015

    @domenkozar
    Member

    👍

  3. bjornfor commented on Oct 8, 2015

    @bjornfor
    Contributor

    I'd really like to have completion for attributes: "nix-env -iA nixos.TAB_TAB" :-)

  4. olejorgenb commented on Jun 19, 2016

    @olejorgenb
    Contributor

    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)

  5. joelmo commented on Jun 20, 2016

    @joelmo
    Contributor

    Before someone do it for bash you should now there is interest redesigning the command interface, #779.

  6. olejorgenb commented on Jul 30, 2016

    @olejorgenb
    Contributor

    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.

  7. olejorgenb commented on Dec 21, 2016

    @olejorgenb
    Contributor

    New version of nix-zsh-completions (with attribute path completion) is now in master: NixOS/nixpkgs#21331

  8. olejorgenb commented on Nov 10, 2017

    @olejorgenb
    Contributor

    @hedning have implemented completions for bash too (including the new nix commands): #1658 (comment)

    (ref #1658)

  9. lheckemann commented on Feb 16, 2018

    @lheckemann
    Member

    This is done now, no? Suggest close.

  10. hedning commented on Apr 2, 2018

    @hedning

    From 18.03 and forward nix-bash-completions will be installed when programs.bash.enableCompletion is 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.

  11. added a commit that references this issue on Aug 28, 2020
  12. added a commit that references this issue on Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions