bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Colored command completion


From: Stephane CHAZELAS
Subject: Re: Colored command completion
Date: Tue, 26 Jan 2010 21:39:45 +0000 (UTC)
User-agent: slrn/pre1.0.0-16 (Linux)

2010-01-26, 09:36(-06), Peng Yu:
> I'm wondering if it is possible to color the files shown by command
> completion (i.e. after typing <TAB>). The color scheme can be of the
> same as the one used in "ls --color=auto". By this way, it is easier
> to see what the type of the file is.
[...]

A bit off topic here, but note that zsh supports that and can
use GNU ls's configuration as well ($LS_COLORS). zsh is largely
compatible with bash. You can use "compinstall" to configure
the completion, or you could try those settings (they have been
generated by compinstall for me):

(set -C && dircolors -p > ~/.dircolors) 2> /dev/null
eval "$(dircolors -b ~/.dircolors)"
zstyle ':completion:*' completer _expand _complete _ignored _correct 
_approximate _prefix
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 
'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' max-errors 1 not-numeric
zstyle ':completion:*' menu select=2
zstyle ':completion:*' original true
zstyle ':completion:*' prompt 'correct> '
zstyle ':completion:*' select-prompt %SScrolling active: current selection at 
%p%s
autoload -U compinit
compinit -i

(you need a relatively recent version of zsh (at least
3.1.5-pws-24, circa 1999) (some OSes like Solaris come with a
very old version of zsh (or at least used to))).

-- 
Stéphane


reply via email to

[Prev in Thread] Current Thread [Next in Thread]