Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a Bash tab-completion script be used in zsh?

I have a Bash tab-completion script for Apache's Hadoop. Normally, I use zsh as my day-to-day shell. It tends to be pretty bash-like when I need it to be, but it looks like the tab-completion systems are radically different between them. Is there a simple way to "convert" the existing bash-tab-completion definitions to work in zsh? I don't want to invest a ton of time in this, but if it's easy I'd save a moderate amount of effort.

like image 927
Coderer Avatar asked Jul 14 '10 18:07

Coderer


People also ask

How do I use autocomplete in zsh?

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.

Where are zsh completions stored?

On macOS completions are stored in /usr/share/zsh/5.3/functions (replace the 5.3 with 5.7. 1 in Catalina). This directory stores many functions used with zsh and is in the default fpath . All the files in that directory that start with an underscore _ contain the completion definitions command.


Video Answer


1 Answers

autoload bashcompinit bashcompinit source /path/to/your/bash_completion_file 
like image 114
freestyler Avatar answered Sep 28 '22 05:09

freestyler