Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Tab completion doesn't work #10

Open
ghostbuster91 opened this issue Oct 28, 2019 · 3 comments
Open

Tab completion doesn't work #10

ghostbuster91 opened this issue Oct 28, 2019 · 3 comments

Comments

@ghostbuster91
Copy link

Hi,

When I hit <tab> after writing sdk I get:
sdk (eval):1: command not found: _sdkman

Here is my zsh configuration: https://github.com/ghostbuster91/dot-files/blob/zplug/.zshrc

And just to make sure, do I need to add to .zshrc following lines

export SDKMAN_DIR="/home/kghost/.sdkman"
[[ -s "/home/kghost/.sdkman/bin/sdkman-init.sh" ]] && source "/home/kghost/.sdkman/bin/sdkman-init.sh"

??

@matthieusb
Copy link
Owner

There are currently some issues with my plugin, so tab completion will not work properly anyway.
I haven't hadtime to correct this, feel free to do a PR if you can.

However, your problem clearly is related to the absence of sdkman in your path.
So yes, you need to add theses lines.

@ghostbuster91
Copy link
Author

Ok, thanks for the quick reply. I am afraid that I won't be able to open PR since my zsh plugin knowledge from writing perspective is quite limited. But if you know any good resources I would be eager to learn.

In terms of these initialization lines which I am missing. I would like this plugin to work similarly to zsh-nvm or zsh-rbenv. They require user to only add plugin to zshrc and all the work is done under the hood.

Similarly this plugin could assume that by default the installation directory of sdk-man is ~/.sdkman and if somebody wants to override it then they would have to specify SDKMAN_DIR manually.

Or even better - assume that default directory is ~/.sdkman and if it doesn't exists install latest version.

WDYT?

@matthieusb
Copy link
Owner

Most zsh plugins assume your install is done correctly, and display an error message on terminal launch if this is not the case.

So I think your idea of assuming ~/.sdkman is the default install folder is a good one, I'll try to implement that when I have some time.

About resources, I think the best way is to read existing plugins and learn from them. Begin with simple plugins, try to tweak them yourself, and then go to more complex plugins: git and docker zsh plugins for example, which are really complex and offer a lot of features. If you're not familiar with bash: https://www.tutorialspoint.com/unix_commands/bash.htm (Zsh is a bit different but you'll get the general idea).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants