Skip to content
marlonrichertPublic

About

🌈 Generate a single, coherent theme for ls, git, grep, less and zsh

Topics

Resources

Code of conduct

Contributing

Stars

87 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

100 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌈 Z Colors

Tools to generate a coherent theme git, less, grep, and your Zsh prompt, completions and syntax highlighting

Also includes convienences for working with ANSI colors in general.

Do you enjoy using this software? Then please consider to become a sponsor. πŸ’

Requirements

Installation

To install, simply clone the repo:

git clone https://github.com/marlonrichert/zcolors.git

Usage

Z Colors' main usage is to generate a theme:

  1. cd into the repo.

  2. To generate the default theme, run:

    zcolors > ~/zshtheme
    

    Alternatively, to generate a custom theme based on your GNU $LS_COLORS, run:

    zcolors "$LS_COLORS" > ~/zsh_theme
    

    ⚠️ Note:

    • Your $LS_COLORS values for di, ln, so, pi, ex, bd, cd, su, sg, tw and ow need to contain 3- or 4-bit colors only. 8- and 24-bit colors are currently not supported!
    • zcolors will generate BSD $LSCOLORS for you, but you cannot pass it as input!
  3. Add to your .zshrc file:

    source zshtheme
    
  4. Close your current shell and open a new one.

Repeat these steps whenever you want to update your theme.

Additionally to configuring your theme, doing the above also exposes the following array and functions.

`$zcolor

An associative array that contains your theme values for file types di, ln, so, pi, ex, bd, cd, su, sg, tw and ow.

Example:

# $'...': string with support for `print` escape codes
# %{<esc>%}: Tell the prompt that <esc> is zero-width output.
# %{\e[m%}: Reset all colors and other highlighting.
# %~: present working dir
# %#: `%` for normal user, `#` for root
PS1=$'%{\e['$zcolor[di]$'m%}%~%{\e[m%}/ %# '

color

Converts a $color entry to ANSI and prints it.

Example usage:

color dim
print 'This text is now dim'
color none

lscolor

Prints the ANSI highlighting for a particular file type.

Example usage:

print 'The current directory is '
lscolor di
print $PWD
color none

Updating

  1. cd into the repo and run git pull.

  2. Repeat the steps under Usage.

Author and license

See the LICENSE file for more details.

About

🌈 Generate a single, coherent theme for ls, git, grep, less and zsh

Topics

Resources

Code of conduct

Contributing

Stars

87 stars

Watchers

1 watching

Forks

Sponsor this project

Contributors

Languages