From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16208 invoked from network); 30 May 2021 12:53:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 May 2021 12:53:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=+R14uzigzzTzJ5oajzVZ3Vd1khOKj17+xQcDfxWSAmM=; b=doOyfFkdoxLv0a4D60JYA5Th4m 2Bo1q3kXMNMROJ08z2XfiBHRgiZw0PsSWXCYc5pRI+LM4W9849lPIMd2PyIJ6F8GU8Wj9Kz6rVG/a ieXW5N/bZbig8QqCsGij0u7XHGNM0iBvvZv7K3eP86OhgJRYIpcLoEVy9JIhtibscKC4pjxyZcdvH MAULa3jkR70c6uRmTw6ZniailXc/yIvuM3WeuXXm/HRz+5qtuP/y8WdF1W0yFGnrk0mHmYC//ZNCD AUGWrq5OPbfeCC61FwyCni6qqMCoTUiPv+pJrJMRXKwgOFRSVhSMLRxxOc9bLyK8suVkQ18I1lxiS aEFNi2yA==; Received: from authenticated user by zero.zsh.org with local id 1lnKwl-000DNI-Iu; Sun, 30 May 2021 12:53:39 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lnKwA-000CeT-4z; Sun, 30 May 2021 12:53:02 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.94.2) (envelope-from ) id 1lnKw9-000MSc-1P; Sun, 30 May 2021 14:53:01 +0200 cc: zsh-users@zsh.org In-reply-to: From: Oliver Kiddle References: To: =?UTF-8?Q?Fran=C3=A7ois_RONVAUX?= Subject: Re: Completion does not work with hidden files/directories MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <86340.1622379181.1@hydra> Date: Sun, 30 May 2021 14:53:01 +0200 Message-ID: <86341-1622379181.040384@EIIb.SjlL.3aYW> X-Seq: 26747 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Fran?ois RONVAUX wrote: > In my home directory, there are currently only hidden files/directories and the > completion mechanism does not see them :-( The main way to control which files are included in file completion is via the file-patterns style. So if you always want to see hidden files, it would be something like: zstyle ':completion:*' file-patterns '%p(D):globbed-files *(D-/):directories' '*(D):all-files' (D) is a glob qualifier that includes hidden files and you might use it from the command-line as, e.g. *.png(D) I was going to suggest something like the following which adds the (D) to the all-files fallback: zstyle ':completion:*' file-patterns '%p:globbed-files *(-/):directories' '*(D):all-files' Unfortunately, _files has some sort of shortcut where it does: [[ "$pat" = '*' ]] && return ret So it never tried all-files if globbed-files was using * as a glob. This should perhaps be looked into and discussed on -workers. What you can do, however is add a second run of the _complete completer with the separate file-patterns style: zstyle ':completion:*::::' completer _complete _complete:-hidden zstyle ':completion:*:complete-hidden:*' file-patterns '%p(D):globbed-files' '*(D):all-files' Note, however that you likely already have a completer style with other functions like _expand listed and you should only add _complete:-hidden to the list somewhere after _complete. > Same issue when I want to change of directory : cd doesn't use files so file-patterns may not help there. > zstyle ':completion:*' cache-path ${ZDOTDIR}/zsh_cache > zstyle ':completion:*' use-cache true #on > Second issue (less important) : the section "Create a cache" in the above file > does not work. Only some completion functions need to create a cache. Note that those lines do not create a cache, they only tell completion where to put cache files. Is ${ZDOTDIR} definitely set to something. If not, it could be trying /zsh_cache. The directory you specify should already exist and should be a writable directory. Oliver