zsh-sdkman
zsh-sdkman copied to clipboard
Tab completion doesn't work
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"
??
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.
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?
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).