Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kitty: install completions #55282

Merged
merged 1 commit into from Feb 6, 2019
Merged

kitty: install completions #55282

merged 1 commit into from Feb 6, 2019

Conversation

@jlesquembre
Copy link
Contributor

@jlesquembre jlesquembre commented Feb 5, 2019

Motivation for this change

Install completions for kitty

NOTE: I've only tested fish completions.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Ma27
Copy link
Member

@Ma27 Ma27 commented Feb 5, 2019

First of all thanks a lot for this!

Bash completion works perfectly fine, but I only got ZSH working after running source /run/current-system/sw/share/zsh/site-functions/_kitty in the test VM.

Do you have an idea how to get ZSH working as well? Unless I can do some further digging to get ZSH completions working.

@jlesquembre
Copy link
Contributor Author

@jlesquembre jlesquembre commented Feb 6, 2019

I don't know why doesn't work, I'm not a ZSH user, sorry. To add more information, I just copied the way auto-completions are implemented for autojump and fd:

  • mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
    cp target/release/build/fd-find-*/out/fd.bash "$out/share/bash-completion/completions/"
    cp target/release/build/fd-find-*/out/fd.fish "$out/share/fish/vendor_completions.d/"
    cp target/release/build/fd-find-*/out/_fd "$out/share/zsh/site-functions/"
  • chmod +x "$out/etc/profile.d/autojump.sh"
    install -Dt "$out/share/bash-completion/completions/" -m444 "$out/share/autojump/autojump.bash"
    install -Dt "$out/share/fish/vendor_conf.d/" -m444 "$out/share/autojump/autojump.fish"
    install -Dt "$out/share/zsh/site-functions/" -m444 "$out/share/autojump/autojump.zsh"

I assumed that completions are working for that packages, if here ZSH completions are broken, maybe are also broken for that packages?

@Ma27 Ma27 force-pushed the kitty-completions branch from f68f659 to 38eb737 Feb 6, 2019
Ma27
Ma27 approved these changes Feb 6, 2019
@Ma27 Ma27 merged commit 8bd91e5 into NixOS:master Feb 6, 2019
12 checks passed
@Ma27
Copy link
Member

@Ma27 Ma27 commented Feb 6, 2019

@jlesquembre thanks!

# ZSH completions need to be invoked with `source`:
# https://github.com/kovidgoyal/kitty/blob/8ceb941051b89b7c50850778634f0b6137aa5e6e/docs/index.rst#zsh
mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
Copy link
Member

@Mic92 Mic92 Feb 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick:

- mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
+ mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d}

@jlesquembre jlesquembre deleted the kitty-completions branch Feb 6, 2019
@wedens
Copy link

@wedens wedens commented Feb 7, 2019

@Ma27 zsh completions will probably work if you add environment.pathsToLink = [ "/share/zsh" ];

@Ma27
Copy link
Member

@Ma27 Ma27 commented Feb 7, 2019

I doubt it. I tested this with programs.zsh.enable = true which already links /share/zsh which is also why I could run source /run/current-system/sw/share/zsh/site-functions/_kitty to get the completions working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants