Skip to content

Commit

Permalink
Fix contributing.md guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Dahan committed Aug 21, 2019
1 parent ffa8582 commit a8f0f75
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ See below for a common template that can be followed while creating a new functi
We love it when new functions:

* are prefixed with `geometry_`
* are located in [geometry/functions/](geometry/functions)
* are located in [geometry/functions/](/functions)
* document their customization options [in the readme][]
* share screenshots or screencasts in the pull request

## A sample function template

``` zsh
# Define defaults for all environment variables
# Define defaults for relevant environment variables
: ${GEOMETRY_<PLUGIN_NAME>_VAR1:="VALUE1"}
: ${GEOMETRY_<PLUGIN_NAME>_VAR2:="VALUE2"}

# Define the function
geometry_<plugin_name>() {
geometry_<function_name>() {

# check if command exists for function to be useful
(( $+commands[command_i_need_to_work] )) || return
Expand All @@ -45,7 +45,8 @@ If you want to set up your own custom function, it's pretty straightforward to d
so. All you need is to make sure it echos whatever you want printed to the prompt.

Let's assume you want to add a plugin that prints `(☞゚∀゚)☞` when the git branch
is clean and `(ノಠ益ಠ)ノ彡┻━┻` when it's dirty. Let's call it `pre`my_pretty_git`.
is clean and `(ノಠ益ಠ)ノ彡┻━┻` when it's dirty.
Let's call it `my_pretty_git`.

```zsh
# my_pretty_git - show emoticons if in a git directory
Expand Down Expand Up @@ -96,7 +97,7 @@ will only be display when in a npm or yarn-based project.
Save the following example as `my_pretty_git.zsh` anywhere.
Then just source the function and add it to `GEOMETRY_PROMPT` or `GEOMETRY_RPROMPT`.

```sh
```zsh
cat <<EOF > my_pretty_git.zsh
# my_pretty_git - show emoticons if in a git directory
Expand All @@ -115,7 +116,7 @@ my_pretty_git() {
}
EOF

source pretty_git.zsh
source my_pretty_git.zsh
GEOMETRY_RPROMPT+=(my_pretty_git)
```

Expand Down

0 comments on commit a8f0f75

Please sign in to comment.