nix-output-monitor icon indicating copy to clipboard operation
nix-output-monitor copied to clipboard

Tab completion

Open mweinelt opened this issue 2 years ago • 6 comments

The biggest regression from using plain nix is that we don't have tab completion anymore. Do we have someone who is familiar with that kind of thing to make nom-build feel more like a drop-in replacement for nix-build?

mweinelt avatar Mar 08 '22 19:03 mweinelt

I need to do more research to modify the nixpkgs expression to "just do the right thing".

Until then in zsh you can put compdef nom-build=nix-build in your zshrc.

maralorn avatar Mar 09 '22 00:03 maralorn

For bash:

complete -F _nix_completion nom-build

I already started something https://github.com/hedning/nix-bash-completions/pull/16 but I can't remember if that fully worked or was half broken.

SuperSandro2000 avatar Mar 09 '22 15:03 SuperSandro2000

As of https://github.com/NixOS/nixpkgs/pull/163441 we have zsh completion support in nixpkgs.

maralorn avatar Mar 09 '22 22:03 maralorn

For bash:

complete -F _nix_completion nom-build

I have just tried that command in a quick bash I started. That apparently didn’t work. Not sure what’s wrong.

maralorn avatar Mar 09 '22 22:03 maralorn

I have just tried that command in a quick bash I started. That apparently didn’t work. Not sure what’s wrong.

Either bash-completion loads things async and you first need to load the nix completion function or my patch is really necessary. I have aliases nom to nix-build so everything just worked.

SuperSandro2000 avatar Mar 09 '22 23:03 SuperSandro2000

With the new bunch of commands introduced now:

  • [ ] nom-shell
  • [ ] nom build
  • [ ] nom develop
  • [ ] nom shell

There is more todo on completion.

maralorn avatar Jun 27 '22 20:06 maralorn