Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zsh color partial tab completions

Is it possible to color the completed part of the partial completion results in Zsh?

Fish does this by default (in Gentoo at least) as shown in the image below:

enter image description here

Full size image: http://i.imgur.com/tN6w3.png

like image 577
bear24rw Avatar asked Nov 28 '11 18:11

bear24rw


2 Answers

Yes, you can do it with things like that:

zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==02=01}:${(s.:.)LS_COLORS}")'

Just change the 01 and 02 colors so it matches your taste, for example to match your screenshot:

zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==34=34}:${(s.:.)LS_COLORS}")';

(Taken from reddit thread, added here to help people searching for this, like I did.)

like image 158
drrlvn Avatar answered Nov 17 '22 01:11

drrlvn


I think [1] is thing you want. You need menu and select as @svlasov commented.

[1]. ZSH highlight on tab

like image 20
NgaNguyenDuy Avatar answered Nov 17 '22 03:11

NgaNguyenDuy