Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Run fish_indent on all *.fish files
Browse files Browse the repository at this point in the history
  • Loading branch information
matchai committed Jan 19, 2019
1 parent 89fefe0 commit 5b0cc48
Show file tree
Hide file tree
Showing 37 changed files with 1,153 additions and 1,108 deletions.
12 changes: 0 additions & 12 deletions .editorconfig

This file was deleted.

4 changes: 2 additions & 2 deletions fish_mode_prompt.fish
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function fish_mode_prompt
# Overriden by Spacefish fishshell theme
# To see vi mode in prompt add 'vi_mode' to SPACEFISH_PROMPT_ORDER
# Overriden by Spacefish fishshell theme
# To see vi mode in prompt add 'vi_mode' to SPACEFISH_PROMPT_ORDER
end
50 changes: 25 additions & 25 deletions fish_prompt.fish
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
function fish_prompt
# Store the exit code of the last command
set -g sf_exit_code $status
set -g SPACEFISH_VERSION 2.0.1
# Store the exit code of the last command
set -g sf_exit_code $status
set -g SPACEFISH_VERSION 2.0.1

# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------

__sf_util_set_default SPACEFISH_PROMPT_ADD_NEWLINE true
__sf_util_set_default SPACEFISH_PROMPT_FIRST_PREFIX_SHOW false
__sf_util_set_default SPACEFISH_PROMPT_PREFIXES_SHOW true
__sf_util_set_default SPACEFISH_PROMPT_SUFFIXES_SHOW true
__sf_util_set_default SPACEFISH_PROMPT_DEFAULT_PREFIX "via "
__sf_util_set_default SPACEFISH_PROMPT_DEFAULT_SUFFIX " "
__sf_util_set_default SPACEFISH_PROMPT_ORDER time user dir host git package node ruby golang php rust haskell julia docker aws conda pyenv dotnet kubecontext exec_time line_sep battery vi_mode jobs exit_code char
__sf_util_set_default SPACEFISH_PROMPT_ADD_NEWLINE true
__sf_util_set_default SPACEFISH_PROMPT_FIRST_PREFIX_SHOW false
__sf_util_set_default SPACEFISH_PROMPT_PREFIXES_SHOW true
__sf_util_set_default SPACEFISH_PROMPT_SUFFIXES_SHOW true
__sf_util_set_default SPACEFISH_PROMPT_DEFAULT_PREFIX "via "
__sf_util_set_default SPACEFISH_PROMPT_DEFAULT_SUFFIX " "
__sf_util_set_default SPACEFISH_PROMPT_ORDER time user dir host git package node ruby golang php rust haskell julia docker aws conda pyenv dotnet kubecontext exec_time line_sep battery vi_mode jobs exit_code char

# ------------------------------------------------------------------------------
# Sections
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Sections
# ------------------------------------------------------------------------------

# Keep track of whether the prompt has already been opened
set -g sf_prompt_opened $SPACEFISH_PROMPT_FIRST_PREFIX_SHOW
# Keep track of whether the prompt has already been opened
set -g sf_prompt_opened $SPACEFISH_PROMPT_FIRST_PREFIX_SHOW

if test "$SPACEFISH_PROMPT_ADD_NEWLINE" = "true"
echo
end
if test "$SPACEFISH_PROMPT_ADD_NEWLINE" = "true"
echo
end

for i in $SPACEFISH_PROMPT_ORDER
eval __sf_section_$i
end
set_color normal
for i in $SPACEFISH_PROMPT_ORDER
eval __sf_section_$i
end
set_color normal
end
25 changes: 13 additions & 12 deletions fish_right_prompt.fish
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
function fish_right_prompt

# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------

__sf_util_set_default SPACEFISH_RPROMPT_ORDER ""
__sf_util_set_default SPACEFISH_RPROMPT_ORDER ""

# ------------------------------------------------------------------------------
# Sections
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Sections
# ------------------------------------------------------------------------------

[ -n "$SPACEFISH_RPROMPT_ORDER" ]; or return
[ -n "$SPACEFISH_RPROMPT_ORDER" ]
or return

for i in $SPACEFISH_RPROMPT_ORDER
eval __sf_section_$i
end
set_color normal
for i in $SPACEFISH_RPROMPT_ORDER
eval __sf_section_$i
end
set_color normal
end
44 changes: 22 additions & 22 deletions functions/__sf_lib_section.fish
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
function __sf_lib_section -a color prefix content suffix
# If there are only 2 args, they're content and prefix
if test (count $argv) -eq 2
set content $argv[2]
set prefix
end
# If there are only 2 args, they're 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
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 the prompt as having been opened
set -g sf_prompt_opened true

set_color --bold $color
echo -e -n $content
set_color normal
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
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
52 changes: 27 additions & 25 deletions functions/__sf_section_aws.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,37 @@
# Link: https://aws.amazon.com/cli/

function __sf_section_aws -d "Display the selected aws profile"
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------

__sf_util_set_default SPACEFISH_AWS_SHOW true
__sf_util_set_default SPACEFISH_AWS_PREFIX "using "
__sf_util_set_default SPACEFISH_AWS_SUFFIX $SPACEFISH_PROMPT_DEFAULT_SUFFIX
__sf_util_set_default SPACEFISH_AWS_SYMBOL "☁️ "
__sf_util_set_default SPACEFISH_AWS_COLOR ff8700
__sf_util_set_default SPACEFISH_AWS_SHOW true
__sf_util_set_default SPACEFISH_AWS_PREFIX "using "
__sf_util_set_default SPACEFISH_AWS_SUFFIX $SPACEFISH_PROMPT_DEFAULT_SUFFIX
__sf_util_set_default SPACEFISH_AWS_SYMBOL "☁️ "
__sf_util_set_default SPACEFISH_AWS_COLOR ff8700

# ------------------------------------------------------------------------------
# Section
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Section
# ------------------------------------------------------------------------------

# Show the selected AWS-cli profile
[ $SPACEFISH_AWS_SHOW = false ]; and return
# Show the selected AWS-cli profile
[ $SPACEFISH_AWS_SHOW = false ]
and return

# Ensure the aws command is available
type -q aws; or return
# Ensure the aws command is available
type -q aws
or return

# Early return if there's no AWS_PROFILE, or it's set to default
if test -z "$AWS_PROFILE" \
-o "$AWS_PROFILE" = "default"
return
end
# Early return if there's no AWS_PROFILE, or it's set to default
if test -z "$AWS_PROFILE" \
-o "$AWS_PROFILE" = "default"
return
end

__sf_lib_section \
$SPACEFISH_AWS_COLOR \
$SPACEFISH_AWS_PREFIX \
"$SPACEFISH_AWS_SYMBOL""$AWS_PROFILE" \
$SPACEFISH_AWS_SUFFIX
__sf_lib_section \
$SPACEFISH_AWS_COLOR \
$SPACEFISH_AWS_PREFIX \
"$SPACEFISH_AWS_SYMBOL""$AWS_PROFILE" \
$SPACEFISH_AWS_SUFFIX
end
Loading

0 comments on commit 5b0cc48

Please sign in to comment.