Como obtenho o preenchimento automático de zsh para completar curingas como o bash faz?

3

No zsh e no bash, se eu digitar ls c<TAB> , ele exibirá cada nome de arquivo, começando com c. Se, em vez disso, eu digitar ls c*<TAB> , o bash se comportará da mesma maneira, mas o zsh substituirá o c* pela lista de todos os arquivos que começam com c. Existe alguma maneira de fazer o zsh se comportar como o bash faz?

    
por m42a 20.03.2012 / 21:00

1 resposta

4

setopt GLOB_COMPLETE

De man zshoptions :

GLOB_COMPLETE

When the current word has a glob pattern, do not insert all the words resulting from the expansion but generate matches as for completion and cycle through them like MENU_COMPLETE. The matches are generated as if a ‘*’ was added to the end of the word, or inserted at the cursor when COMPLETE_IN_WORD is set. This actually uses pattern matching, not globbing, so it works not only for files but for any completion, such as options, user names, etc.

Note that when the pattern matcher is used, matching control (for example, case-insensitive or anchored matching) cannot be used. This limitation only applies when the current word contains a pattern; simply turning on the GLOB_COMPLETE option does not have this effect.

    
por 04.05.2012 / 02:45