Home

Awesome

VIA theme for ZSH

GitHub Workflow Status Docker Image Version (latest by date) WTFPLv2 License

This is a theme for ZSH which mainly forks the historical theme used on VIA Centrale Réseaux servers. It can be used with ZSH frameworks such as Oh-My-ZSH.

Preview

Oh-My-VIA theme preview

Test oh-my-via easily without installing it with this docker image :

docker run -it --rm badouralix/oh-my-via

Info

VCS caption

ColorStateVariable
redthere are unstaged filesOHMYVIA_VCS_COLOR_UNSTAGED
yellowthere are staged filesOHMYVIA_VCS_COLOR_STAGED
bluethere are untracked filesOHMYVIA_VCS_COLOR_UNTRACKED
cyanstash stack is not emptyOHMYVIA_VCS_COLOR_STASH
greenworking directory is cleanOHMYVIA_VCS_COLOR_CLEAN

Usage

Install for Oh-My-ZSH

Oh-My-VIA is available as an external theme for Oh-My-ZSH.

In order to use this theme, you have to clone this repository in your Oh-My-ZSH custom/themes directory ( usually ~/.oh-my-zsh/custom/themes ) :

git clone https://github.com/badouralix/oh-my-via.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/oh-my-via

You then need to select this theme in your ~/.zshrc :

ZSH_THEME="oh-my-via/via"

Customization

Prompt is composed of several widgets that are displayed one after the other.

Date and time

VariableDescriptionDefault
OHMYVIA_TIME_COLORBackground and foreground color.%B%F{cyan}
OHMYVIA_TIME_FORMATDisplay date and time.%D{%H:%M}

Context ( user and hostname )

Context prompt showing user@hostname.

VariableDescriptionDefault
OHMYVIA_CONTEXT_HOSTNAMEDisplay hostname. Set to partial to print up to the first .. Set to empty to hide hostname.full
OHMYVIA_CONTEXT_HOSTNAME_COLORHostname background and foreground color.%B%F{white}
OHMYVIA_CONTEXT_HOSTNAME_COLOR_SSHAlternative hostname background and foreground color only applied on ssh sessions.$OHMYVIA_CONTEXT_HOSTNAME_COLOR
OHMYVIA_CONTEXT_SEPARATOR_COLOR@ separator between the user and the hostname background and foreground color.%B%F{yellow}
OHMYVIA_CONTEXT_ROOT_COLORRoot username background and foreground color.%B%F{blue}
OHMYVIA_CONTEXT_USER_COLORNon-root username background and foreground color.%B%F{red}

Working directory

VariableDescriptionDefault
OHMYVIA_DIR_COLORBackground and foreground color.%B%F{green}
OHMYVIA_DIR_SIZENumber of trailing components of the current directory to show. Set to 0 to show the whole path. Set to 1 to show only the current directory.0

VCS theme

VariableDescriptionDefault
OHMYVIA_VCS_THEMEGit prompt theme ( see available themes )default

Unit testing

Oh-My-VIA uses ZUnit as unit testing framework.

To run the tests, just run:

# Directly with zunit
zunit run tests

# Indirectly with act
act --job zunit

License

Unless explicitly stated to the contrary, all contents licensed under the WTFPL.