Contents
Where do I find the completion definitions in zsh?
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. So, the file _cp contains the definition for the cp command. (Some of the definition files contain the definitions for multiple commands.)
Do you need to rewrite Bash completions in zsh?
You do not have to rewrite these completions, since the zsh completion system can use bash completion scripts as well: (add this to your zsh configuration file) # load bashcompinit for some old bash completions\
What does the tab key do in zsh?
In zsh you can also hit the tab key repeatedly to cycle through the suggested completions. In this example, the first tab keystroke will show the list, the second will complete ~/Desktop/, the third completes ~/Documents, and so on.
How to make tab completion case insensitive in zsh?
Since the macOS file systems are usually case-insensitive, I prefer my tab-completion to be case-insensitive as well. For bash you configure that in the ~/.inputrc. In zsh you modify the completion systems behavior with this (monstrous) command: # case insensitive path-completion\
How to force file completion everywhere in zshrc?
In the completion function, one route would be to cut out the current word I want to complete, complete it, and then re-insert the completion back into the line if that’s possible. It could also be more like _precommand which shifts the second word to the first word so that normal command completion works.
What should the hosts file be in autocomplete zsh?
The hosts file must be in the format IP_address canonical_hostname [aliases…], so your approach should be to fix your hosts file, not to get one program snippet working around your broken file. Other programs may run in problems too, if your hosts is broken, so this would be the only sane solution to your use case.
Which is better the bash prompt or the zsh prompt?
The zsh default prompt is far shorter than the bash default, but even less useful. Since I work on the local system most of the time, the hostname bears no useful information, and repeating it every line is superfluous.