Skip to content
Luke Sampson edited this page Mar 1, 2014 · 4 revisions

Themes are JSON files that describe plugins and prompt customisations. The themes that come with pshazz are stored in the themes directory, and that's a good place to look for examples.

Prompt

E.g.:

"prompt": [
	[ "cyan",  "", "$dir " ],
	[ "red",   "", "$git_branch$git_dirty " ],
	[ "green", "", "`$" ]
]

This is an array of arrays. The inner array contains three items

[ "foreground color", "background color", "output text" ]

The colors are limited to console colors. These colors apply to the following output text. You can see what color names are available by running (in powershell):

[enum]::getvalues([consolecolor])

The output text can contain string literals or variables. See the Prompt variables page on the wiki for more information about what variables are supported. You can also use any variables available in your session, e.g. "$env:OS".

Plugins

E.g.:

"plugins": [ "git", "ssh", "z" ]

This line just says that we want to enable the git, ssh and z plugins. See the plugins directory to see what's available.

Special plugin variables

Aliases

Example:

"aliases": {
    "rm": [ "help", "man", "info" ],
    "add": {
        "help($name)": "get-help $name -detailed | less"
        "man": "help",
    }
}

The aliases plugin adds some sensible aliases and removes some questionable ones. Check the top of the aliases plugin to see what's added or removed.

You can also add or remove your own aliases. In the example above, I've removed the "help", "man", and "info" aliases. I've also added to aliases:

  • man is a simple alias to help
  • help is a function alias that takes a $name parameter, passes it to get-help with the -detailed flag, and then pipes the output through less.
Git
"git": {
    "prompt_dirty": "*"
}
  • prompt_dirty: a character or string to display when there are uncommitted changes in the working tree. This will be substituted in where the $git_dirty variable is used in the prompt output text.

lo

Clone this wiki locally