Skupiny Google už nepodporují nová předplatná ani příspěvky Usenet. Historický obsah lze zobrazit stále.

Colored command completion

2 zobrazení
Přeskočit na první nepřečtenou zprávu

Peng Yu

nepřečteno,
26. 1. 2010 10:36:2226.01.10
komu: bug-bash
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.


Chet Ramey

nepřečteno,
26. 1. 2010 11:34:1926.01.10
komu: Peng Yu, bug-bash, chet....@case.edu

You mean the list of possible completions? It's not exactly what you
asked for, but look at the readline `visible-stats' variable. That
produces output in the style of `ls -F'.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU ch...@case.edu http://cnswww.cns.cwru.edu/~chet/


Stephane CHAZELAS

nepřečteno,
26. 1. 2010 16:39:4526.01.10
komu:
2010-01-26, 09:36(-06), Peng Yu:
[...]

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

0 nových zpráv