Unfortunately, ZSH can also suffer from the fact that it's so powerful. Among the things that made me almost cry was the user completion, enabled by default, that made the whole console freeze for long time before it finally resumed, giving me a list of hundreds LDAP users when all I wanted is a completion of local directory.
After longer search I finally mastered the query to get the right solution to the problem:
unsetopt cdablevars
This short line turns off auto-completion based on user names and variables. Once in place you will no longer be able to type:
cd user_name
cd var_name
instead, you're back to standard
cd ~user_name
cd $var_name
but, the upside is, the directory completion (when you press TAB key) is again working smoothly, even when you're completing commands (git etc).
Among available alternatives you can find a solution that would disable completion for a particular command, such as:
'local-directories path-directories directory-stack' '*'
which will complete cd and pushd commands with directories only (so, no variables and no users for you). You can try to tweak this completion pattern to actually give you some of these mechanisms back to these commands.
No comments:
Post a Comment