From efb336a23b65a9a2d56889396b13c1757bdaf354 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Sun, 29 Dec 2019 14:58:33 -0300 Subject: Initial commit --- .../spacefish/functions/__sf_section_git.fish | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .config/fisher/github.com/matchai/spacefish/functions/__sf_section_git.fish (limited to '.config/fisher/github.com/matchai/spacefish/functions/__sf_section_git.fish') diff --git a/.config/fisher/github.com/matchai/spacefish/functions/__sf_section_git.fish b/.config/fisher/github.com/matchai/spacefish/functions/__sf_section_git.fish new file mode 100644 index 00000000..ea3c390e --- /dev/null +++ b/.config/fisher/github.com/matchai/spacefish/functions/__sf_section_git.fish @@ -0,0 +1,35 @@ +# +# Git +# + +function __sf_section_git -d "Display the git branch and status" + # ------------------------------------------------------------------------------ + # Configuration + # ------------------------------------------------------------------------------ + + __sf_util_set_default SPACEFISH_GIT_SHOW true + __sf_util_set_default SPACEFISH_GIT_PREFIX "on " + __sf_util_set_default SPACEFISH_GIT_SUFFIX $SPACEFISH_PROMPT_DEFAULT_SUFFIX + __sf_util_set_default SPACEFISH_GIT_SYMBOL " " + + # ------------------------------------------------------------------------------ + # Section + # ------------------------------------------------------------------------------ + + # Show both git branch and git status: + # spacefish_git_branch + # spacefish_git_status + + [ $SPACEFISH_GIT_SHOW = false ]; and return + + set -l git_branch (__sf_section_git_branch) + set -l git_status (__sf_section_git_status) + + [ -z $git_branch ]; and return + + __sf_lib_section \ + fff \ + $SPACEFISH_GIT_PREFIX \ + "$git_branch$git_status" \ + $SPACEFISH_GIT_SUFFIX +end -- cgit v1.2.3