zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: Textfile-Favoring Completion
Date: Sat, 25 Mar 2006 23:18:56 -0800	[thread overview]
Message-ID: <060325231856.ZM6755@torch.brasslantern.com> (raw)
In-Reply-To: <20060325181625.GA17430@namib.cs.utk.edu>

On Mar 25,  1:16pm, Chris Johnson wrote:
}
} Now I'm using something slightly simpler that has the same drawback as
} the first solution in hiding certain files when there's a valid match in
} the first group.  (For instance, I want to complete an executable plain
} file 'itself.sh' but there's a directory 'include' that supercedes.)  It
} does cut back on the regular expression maintenance, though.  (I haven't
} entered the extensions for LaTeX yet, so this may change.)
} 
}    # First match files that aren't plain executable files or don't
}    # end in .o.  Failing that, match anything.
}    zstyle ':completion:*:*:(emacs|vi|vim):*' file-patterns \
}           '*~*.o(^*):globbed-files' '*:all-files'

If you're going to go about it that way, look at ignored-patterns:

zstyle ':completion:*:*:(emacs|vi|vim):*' ignored-patterns '*.o'

You may find it easier to maintain the list of excluded patterns there.
The drawback to ignored-patterns is that they're matched only against
the text of the file name, not used as file globs, so you can't, e.g.,
ignore files with the execute bit set.  However, if you combine it
with a variant of your file-patterns style ...

zstyle ':completion:*:*:(emacs|vi|vim):*' file-patterns \
    '*(.^*):globbed-files *(/):directories' '*:all-files'

... you may get something very close to what you want.

Just remember that you may also want to put _ignored into your completer
style somewhere.


  reply	other threads:[~2006-03-26  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-25 18:16 Chris Johnson
2006-03-26  7:18 ` Bart Schaefer [this message]
2006-03-26 18:59   ` zzapper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=060325231856.ZM6755@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).