Skip to content

Commit

Permalink
document configuration right
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
  • Loading branch information
TomasTomecek committed Apr 19, 2017
1 parent bc1f416 commit b27b61f
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ $ pretty-git-prompt create-default-config

This repository contains also configuration for bash and zsh with colors:

1. `files/pretty-git-prompt.yml.bash`
2. `files/pretty-git-prompt.yml.zsh`
1. [`files/pretty-git-prompt.yml.bash`](https://github.com/TomasTomecek/pretty-git-prompt/blob/master/files/pretty-git-prompt.yml.bash)
2. [`files/pretty-git-prompt.yml.zsh`](https://github.com/TomasTomecek/pretty-git-prompt/blob/master/files/pretty-git-prompt.yml.zsh)

In case anything is not clear from the comments inside the config files, please
open a new issue.
Expand Down
21 changes: 16 additions & 5 deletions files/pretty-git-prompt.yml.bash
Original file line number Diff line number Diff line change
@@ -1,45 +1,56 @@
# version of configuration file
# right now it needs to be set to '1'
version: '1'
# configuration of various values (required), type dict
# if you omit a value, it won't be displayed
values:
# count of untracked files
new:
# formatting (required), both (pre_format, post_format) are required
# you can include coloring in pre_format and reset colors in post_format
# you can also include arbitrary string
# for more information about setting colors for bash and zsh:
# https://wiki.archlinux.org/index.php/zsh#Colors
# http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Visual-effects
# https://www.ibm.com/developerworks/linux/library/l-tip-prompt/
# this is how the value is formatted in the end:
# [pre_format][value][post_format]
# example:
# ✚2
pre_format: '\[\e[38;5;248m\]✚'
post_format: '\[\e[0m\]'
# the number of tracked files which were changed in working tree
changed:
pre_format: '\[\e[38;5;166m\]Δ'
post_format: '\[\e[0m\]'
# the number of files added to index
staged:
pre_format: '\[\e[38;5;2m\]▶'
post_format: '\[\e[0m\]'
# during merge, rebase, or others, the numbers files which conflict
conflicts:
pre_format: '\[\e[38;5;226m\]✖'
post_format: '\[\e[0m\]'
# the number of files present locally which are missing in remote repo
difference_ahead:
pre_format: '\[\e[38;5;7m\]↑'
post_format: '\[\e[0m\]'
# the number of commits present in remote repo which are missing locally
difference_behind:
pre_format: '\[\e[38;5;7m\]↓'
post_format: '\[\e[0m\]'

# monitor status against different remotes (optional), type dict
# track history divergence
monitor_remotes:
# formatting (required), both are required
# this is displayed as: '[pre_format][value][post_format]'
# include coloring in pre_format and reset colors in post_format
# you can also include arbitrary string
# there are some special values which are substituted:
# * <REMOTE> will be replaced with name of a remote
# * <LOCAL_BRANCH> will be replaced with current branch name
# * <REMOTE_BRANCH> will be replaced with name of remote branch
- pre_format: '\[\e[38;5;4m\]<LOCAL_BRANCH>'
post_format: '\[\e[0m\]'
# remote branch name (optional), type string
# example: 'upstream/mater'
# example: 'upstream/master'
# if omitted look for remotely tracked branch usualy set up with:
# git branch --set-upstream-to
# remote_branch: ''
Expand Down
21 changes: 16 additions & 5 deletions files/pretty-git-prompt.yml.zsh
Original file line number Diff line number Diff line change
@@ -1,45 +1,56 @@
# version of configuration file
# right now it needs to be set to '1'
version: '1'
# configuration of various values (required), type dict
# if you omit a value, it won't be displayed
values:
# count of untracked files
new:
# formatting (required), both (pre_format, post_format) are required
# you can include coloring in pre_format and reset colors in post_format
# you can also include arbitrary string
# for more information about setting colors for bash and zsh:
# https://wiki.archlinux.org/index.php/zsh#Colors
# http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Visual-effects
# https://www.ibm.com/developerworks/linux/library/l-tip-prompt/
# this is how the value is formatted in the end:
# [pre_format][value][post_format]
# example:
# ✚2
pre_format: '%{%F{014}%}✚'
post_format: '%{%f%}'
# the number of tracked files which were changed in working tree
changed:
pre_format: '%{%B%F{red}%}Δ'
post_format: '%{%b%f%}'
# the number of files added to index
staged:
pre_format: '%{%F{green}%}▶'
post_format: '%{%f%}'
# during merge, rebase, or others, the numbers files which conflict
conflicts:
pre_format: '%{%F{yellow}%}✖'
post_format: '%{%f%}'
# the number of files present locally which are missing in remote repo
difference_ahead:
pre_format: '%{%F{white}%}↑'
post_format: '%{%f%}'
# the number of commits present in remote repo which are missing locally
difference_behind:
pre_format: '%{%F{white}%}↓'
post_format: '%{%f%}'

# monitor status against different remotes (optional), type dict
# track history divergence
monitor_remotes:
# formatting (required), both are required
# this is displayed as: '[pre_format][value][post_format]'
# include coloring in pre_format and reset colors in post_format
# you can also include arbitrary string
# there are some special values which are substituted:
# * <REMOTE> will be replaced with name of a remote
# * <LOCAL_BRANCH> will be replaced with current branch name
# * <REMOTE_BRANCH> will be replaced with name of remote branch
- pre_format: '%{%F{blue}%}<LOCAL_BRANCH>'
post_format: '%{%f%}'
# remote branch name (optional), type string
# example: 'upstream/mater'
# example: 'upstream/master'
# if omitted look for remotely tracked branch usualy set up with:
# git branch --set-upstream-to
# remote_branch: ''
Expand Down
24 changes: 15 additions & 9 deletions src/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,60 @@ use constants::{get_default_config_path, CURRENT_CONFIG_VERSION};

use yaml_rust::{YamlLoader, Yaml};

// TODO: add version and check for correct version
// TODO: polish and sync comments
static DEFAULT_CONF: &'static str = "---
# version of configuration file
# right now it needs to be set to '1'
version: '1'
# configuration of various values (required), type dict
# if you omit a value, it won't be displayed
values:
# the number of untracked files
new:
# formatting (required), both are required
# formatting (required), both (pre_format, post_format) are required
# you can include coloring in pre_format and reset colors in post_format
# you can also include arbitrary string
# for more information about setting colors for bash and zsh:
# https://wiki.archlinux.org/index.php/zsh#Colors
# http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Visual-effects
# https://www.ibm.com/developerworks/linux/library/l-tip-prompt/
# This is values get formatted:
# this is how the value is formatted in the end:
# [pre_format][value][post_format]
# example:
# ✚2
pre_format: '✚'
post_format: ''
# the number of tracked files which were changed in working tree
changed:
pre_format: 'Δ'
post_format: ''
# the number of files added to index
staged:
pre_format: '▶'
post_format: ''
# during merge, rebase, or others, the numbers files which conflict
conflicts:
pre_format: '✖'
post_format: ''
# the number of files present locally which are missing in remote repo
difference_ahead:
pre_format: '↑'
post_format: ''
# the number of commits present in remote repo which are missing locally
difference_behind:
pre_format: '↓'
post_format: ''
# monitor status against different remotes (optional), type dict
# track history divergence
monitor_remotes:
# formatting (required), both are required
# this is displayed as: '[pre_format][value][post_format]'
# include coloring in pre_format and reset colors in post_format
# you can also include arbitrary string
# there are some special values which are substituted:
# * <REMOTE> will be replaced with name of a remote
# * <LOCAL_BRANCH> will be replaced with current branch name
# * <REMOTE_BRANCH> will be replaced with name of remote branch
- pre_format: '<LOCAL_BRANCH>'
post_format: ''
# remote branch name (optional), type string
# example: 'upstream/mater'
# example: 'upstream/master'
# if omitted look for remotely tracked branch usualy set up with:
# git branch --set-upstream-to
# remote_branch: ''
Expand Down

0 comments on commit b27b61f

Please sign in to comment.