Currently when I invoke completion the behaviour is like this:

% cd ~/<TAB>
Completing directory
Desktop/    Downloads/  Pictures/   system/     Videos/
Documents/  Music/      Public/     Templates/  www/

How can I configure the completion to list the hidden files also?


You could add globdots to $_comp_options in your .zshrc e.g.

  • 4
    Is there an easy way to ignore the current directory (.) and parent directory (..)? They are often useless on a comp list. – Krzysztof Kaczor Dec 10 '18 at 9:59
  • 3
    @KrzysztofKaczor - Those are never shown in the completion list unless your .zshrc contains something like this: zstyle ':completion:*' special-dirs true in which case they are listed so it's an easy fix ;) – don_crissti Dec 10 '18 at 18:05
  • 3
    thanks! turns out it's part of oh-my-zsh config. – Krzysztof Kaczor Dec 10 '18 at 19:26
  • 1
    One of the maintainers of Oh My Zsh said that only _comp_options+=(globdots) is necessary. Do I really need compinit, too? – Lucas Sep 26 '20 at 16:29

This is a zsh option. It is mentioned in its introduction.

GLOBDOTS lets files beginning with a . be matched without explicitly specifying the dot.

Add the following to your .zshrc file.

setopt globdots

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.