diff --git a/functions/utils.zsh b/functions/utils.zsh index d9a2c6b38325d5b6d861f59396968b587970d2ba..c9b3b8a6719834bc8ce05d091ebc3269f1c12291 100644 --- a/functions/utils.zsh +++ b/functions/utils.zsh @@ -11,7 +11,7 @@ # # @param $1 : name of the variable to be filled # @param $2 : default value set if $1 is not already defined -function set_default() { +set_default () { # /!\ compute differently with color variables # TODO make the regex case-insensitive @@ -28,7 +28,7 @@ function set_default() { # # @param $1 : name of the variable to be filled # @param $2 : default value set if $1 is not already a visual effect or a color code -function set_default_color() { +set_default_color () { # See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Visual-effects if [[ ! ${(P)1} =~ '%' ]]; then diff --git a/functions/vcs_themes.zsh b/functions/vcs_themes.zsh index 900486991566daac5ab5fc26ecb1e61839fb9ecd..be2d3ab21c6a4c04d874fdbf8e956652f4b4d201 100644 --- a/functions/vcs_themes.zsh +++ b/functions/vcs_themes.zsh @@ -18,7 +18,7 @@ # %S : A subdirectory within a repository. If $PWD is /foo/bar/repoXY/beer/tasty, %S is beer/tasty. # %m : A "misc" replacement. It is at the discretion of the backend to decide what this replacement expands to. -function +vi-theme-default() { ++vi-theme-default () { local vcs_prompt_prefix="%F{magenta}(%F{white}%s%F{magenta})%f" local vcs_prompt_hyphen="%F{yellow}-%f" local vcs_prompt_normal="%F{magenta}[%m%c%u%b%F{magenta}]%f" @@ -28,7 +28,7 @@ function +vi-theme-default() { OHMYVIA_VCS_PROMPT_ACTION=${OHMYVIA_VCS_PROMPT_ACTION:-"$vcs_prompt_prefix$vcs_prompt_hyphen$vcs_prompt_action"} } -function +vi-theme-alphabet() { ++vi-theme-alphabet () { local vcs_prompt_prefix="%F{magenta}(%F{white}%s%F{magenta})%f" local vcs_prompt_hyphen="%F{yellow}-%f" local vcs_prompt_normal="%F{magenta}[%m%c%u%b%F{magenta}]%f" @@ -38,7 +38,7 @@ function +vi-theme-alphabet() { OHMYVIA_VCS_PROMPT_ACTION="$vcs_prompt_prefix$vcs_prompt_hyphen$vcs_prompt_action" } -function +vi-theme-djou() { ++vi-theme-djou () { local vcs_prompt_prefix="%F{white}%s%f" local vcs_prompt_hyphen=" %F{yellow}-%f " local vcs_prompt_normal="%m%c%u%b%f" @@ -48,7 +48,7 @@ function +vi-theme-djou() { OHMYVIA_VCS_PROMPT_ACTION="$vcs_prompt_prefix$vcs_prompt_hyphen$vcs_prompt_action" } -function +vi-theme-kiwi() { ++vi-theme-kiwi () { local vcs_prompt_prefix="%F{magenta}(%F{white}%s%F{magenta})%f" local vcs_prompt_hyphen="%F{yellow}-%f" local vcs_prompt_normal="%F{magenta}[%m%c%u%b%F{magenta}]%f" @@ -58,7 +58,7 @@ function +vi-theme-kiwi() { OHMYVIA_VCS_PROMPT_ACTION="$vcs_prompt_prefix$vcs_prompt_hyphen$vcs_prompt_action" } -function +vi-theme-jon() { ++vi-theme-jon () { local vcs_prompt_prefix="" local vcs_prompt_hyphen="" local vcs_prompt_normal="%F{magenta}[%m%c%u%b%F{magenta}]%f" diff --git a/functions/vcs_utils.zsh b/functions/vcs_utils.zsh index 192ad55a2c0bb09a5c7332d4ffabf0c888e944ff..fec582b2332d558488777570d7a6c86a4c46c675 100644 --- a/functions/vcs_utils.zsh +++ b/functions/vcs_utils.zsh @@ -7,14 +7,14 @@ # # Thanks to http://eseth.org/2010/git-in-zsh.html -function +vi-git-stash() { ++vi-git-stash () { if [[ -s ${hook_com[base]}/.git/refs/stash ]] ; then hook_com[misc]+=$OHMYVIA_VCS_COLOR_STASH fi } # Thanks to https://github.com/sunaku/home/ -function +vi-git-untracked() { ++vi-git-untracked () { if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \ git status --porcelain | fgrep '??' &> /dev/null ; then # This will show the marker if there are any untracked files in repo. @@ -27,7 +27,7 @@ function +vi-git-untracked() { # Erase hook_com[misc] ( ie. %m ) to avoid dealing with backends info outputs # Add $vcs_clean_color to setup default %b coloring in vcs prompt -function +vi-misc-init() { ++vi-misc-init () { hook_com[misc]=$OHMYVIA_VCS_COLOR_CLEAN }