After installing cheat
(command cheat sheets from the command line), I tried to enable the autocompletion using the provided zsh script. However, I don't seem to find the correct location for the script.
cheat.zsh
;~/.oh-my-zsh/custom/plugins/cheat/_cheat.zsh
;plugins
array in my ~/.zshrc
;Auto-completion doesn't happen when typing cheat d<TAB>
.
So where to place zsh auto-completion script on Linux?
Installing Zsh Completions Your completion script must have the following filename format: _example . Next, create a directory at ~/. zsh/completion and copy the completion script to the new directory.
zsh-autocomplete adds real-time type-ahead autocompletion to Zsh. Find as you type, then press Tab to insert the top completion, Shift Tab to insert the bottom one, or ↓ / PgDn to select another completion.
Zsh can handle bash completions functions. The latest development version of zsh has a function bashcompinit, that when run will allow zsh to read bash completion specifications and functions. This is documented in the zshcompsys man page. To use it all you need to do is run bashcompinit at any time after compinit.
Let me try to help here.
I was trying something similar and this is how I was able to get it worked.
Below solution has verified with oh-my-zsh
on debian distro [ubuntu]
> Your zsh isnt giving proper completion suggestions say [conda] > This is what you get when you type in # conda tab
Find the completion script
one great location is https://github.com/clarketm/zsh-completions/tree/master/src
Download the file to completions folder [~/.oh-my-zsh/completions]
wget https://raw.githubusercontent.com/clarketm/zsh-completions/master/src/_conda ~/.oh-my-zsh/completions
Make sure the completions folder is listed under $fpath
print -l $fpath
What if its not listed It should have normaly added with .oh-my-zsh.sh If not append below to ~/.oh-my-zsh/oh-my-zsh.sh
# add a function path
fpath=($ZSH/functions $ZSH/completions $fpath)
source .zshrc
source ~/.zshrc
Execute compinit
this will build ~/.zcompdump
file for the functions
compinit
Due to conflicts the suggestions might not be shown try the following
rm -f ~/.zcompdump; compinit
# we are clearing the function dump stored by zsh, its safe zsh will rebuilt it.
Try source .zshrc
source ~/.zshrc
Try loggin out and login
Check the mapping in ~/.zcompdump
vi ~/.zcompdump
search for conda
[/conda]
you should see as below
'conda' '_conda'
Hope someone will find it useful, if so Happy to Help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With