diff --git a/contributing.md b/contributing.md index 914de050..84ac997e 100644 --- a/contributing.md +++ b/contributing.md @@ -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__VAR1:="VALUE1"} : ${GEOMETRY__VAR2:="VALUE2"} # Define the function -geometry_() { +geometry_() { # check if command exists for function to be useful (( $+commands[command_i_need_to_work] )) || return @@ -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 @@ -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 < my_pretty_git.zsh # my_pretty_git - show emoticons if in a git directory @@ -115,7 +116,7 @@ my_pretty_git() { } EOF -source pretty_git.zsh +source my_pretty_git.zsh GEOMETRY_RPROMPT+=(my_pretty_git) ```