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

Breaks zsh tab completion #11

Closed
HaleTom opened this issue Jan 4, 2022 · 6 comments
Closed

Breaks zsh tab completion #11

HaleTom opened this issue Jan 4, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@HaleTom
Copy link

HaleTom commented Jan 4, 2022

Without the plugin, if I type cd and press TAB I get a list of only directories.

With the plugin, both files and directories are listed.

.zshrc config required:

autoload -Uz compinit && compinit
@HaleTom
Copy link
Author

HaleTom commented Jan 4, 2022

if [[ -n $ZSH_VERSION ]]; then
    # Enable Zsh completions as for builtin cd
    compdef __smartcd__=cd
fi

@CodesOfRishi CodesOfRishi added the bug Something isn't working label Jan 4, 2022
@HaleTom
Copy link
Author

HaleTom commented Jan 6, 2022

Ah, you'd also want to check that compdef is actually a function. It isn't until after compinit is run.

@CodesOfRishi
Copy link
Owner

Thanks again!!

@HaleTom
Copy link
Author

HaleTom commented Jan 8, 2022

Cheers!

@HaleTom
Copy link
Author

HaleTom commented Jan 14, 2022

It would be great if this worked straight out of the box with less config:

[[ -n $ZSH_VERSION ]] && typeset -f compdef > /dev/null && compdef __smartcd__=cd

This would be ignored for bash, or if compinit hadn't yet been called.

@CodesOfRishi
Copy link
Owner

Yep, right! I will implement this!!

@CodesOfRishi CodesOfRishi reopened this Jan 14, 2022
@CodesOfRishi CodesOfRishi added enhancement New feature or request and removed bug Something isn't working labels Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants