diff options
author | Roger Gonzalez <rogergonzalez21@gmail.com> | 2019-12-29 14:58:33 -0300 |
---|---|---|
committer | Roger Gonzalez <rogergonzalez21@gmail.com> | 2019-12-29 14:58:33 -0300 |
commit | efb336a23b65a9a2d56889396b13c1757bdaf354 (patch) | |
tree | 234e40115f79a84c8a755df6fb932cc6797e36e1 /.config/fisher/github.com/matchai/spacefish/functions/__sf_lib_section.fish |
Initial commit
Diffstat (limited to '.config/fisher/github.com/matchai/spacefish/functions/__sf_lib_section.fish')
-rw-r--r-- | .config/fisher/github.com/matchai/spacefish/functions/__sf_lib_section.fish | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/.config/fisher/github.com/matchai/spacefish/functions/__sf_lib_section.fish b/.config/fisher/github.com/matchai/spacefish/functions/__sf_lib_section.fish new file mode 100644 index 00000000..819b68ff --- /dev/null +++ b/.config/fisher/github.com/matchai/spacefish/functions/__sf_lib_section.fish @@ -0,0 +1,28 @@ +function __sf_lib_section -a color prefix content suffix + # If there are only 2 args, they are $content and $prefix + if test (count $argv) -eq 2 + set content $argv[2] + set prefix + end + + if test "$sf_prompt_opened" = "true" -a "$SPACEFISH_PROMPT_PREFIXES_SHOW" = "true" + # Echo prefixes in bold white + set_color --bold + echo -e -n -s $prefix + set_color normal + end + + # Set the prompt as having been opened + set -g sf_prompt_opened true + + set_color --bold $color + echo -e -n $content + set_color normal + + if test "$SPACEFISH_PROMPT_SUFFIXES_SHOW" = "true" + # Echo suffixes in bold white + set_color --bold + echo -e -n -s $suffix + set_color normal + end +end |