aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2024-01-16 12:50:24 +0100
committerMartin Polden <mpolden@mpolden.no>2024-01-16 12:50:24 +0100
commit092d8fbe109a0abc55d3a829daad91a18dafe34c (patch)
tree86f8afde76f0d1dd62117c63bb35697e50a1159a
parent0340c0c3245247abf7568895dd375681a1e590f3 (diff)
fish: fix indentation
-rw-r--r--fish_prompt.fish52
1 files changed, 26 insertions, 26 deletions
diff --git a/fish_prompt.fish b/fish_prompt.fish
index f415b4b..8ec453e 100644
--- a/fish_prompt.fish
+++ b/fish_prompt.fish
@@ -1,32 +1,32 @@
function fish_prompt --description "Write out the prompt"
- set last_status $status
- if not set -q __fish_prompt_hostname
- set -g __fish_prompt_hostname (hostname -s)
- end
+ set last_status $status
+ if not set -q __fish_prompt_hostname
+ set -g __fish_prompt_hostname (hostname -s)
+ end
- set normal (set_color normal)
- set -q fish_color_at
- or set -U fish_color_at $normal
+ set normal (set_color normal)
+ set -q fish_color_at
+ or set -U fish_color_at $normal
- # Add user@host when connected through SSH or using toolbox
- set ssh_prefix
- if set -q SSH_CLIENT
- or set -q SSH_TTY
- or set -q SSH_CONNECTION
- or set -q TOOLBOX_PATH
- set ssh_prefix (set_color $fish_color_user) $USER \
- (set_color $fish_color_at) @ (set_color $fish_color_host) \
- $__fish_prompt_hostname $normal ":"
- end
+ # Add user@host when connected through SSH or using toolbox
+ set ssh_prefix
+ if set -q SSH_CLIENT
+ or set -q SSH_TTY
+ or set -q SSH_CONNECTION
+ or set -q TOOLBOX_PATH
+ set ssh_prefix (set_color $fish_color_user) $USER \
+ (set_color $fish_color_at) @ (set_color $fish_color_host) \
+ $__fish_prompt_hostname $normal ":"
+ end
- # Color prompt symbol based on exit status. Inspired by
- # https://solovyov.net/blog/2020/useful-shell-prompt/
- set __prompt_symbol '$'
- if [ $last_status -ne 0 ]
- set __prompt_symbol "$(set_color yellow)\$$normal"
- end
+ # Color prompt symbol based on exit status. Inspired by
+ # https://solovyov.net/blog/2020/useful-shell-prompt/
+ set __prompt_symbol '$'
+ if [ $last_status -ne 0 ]
+ set __prompt_symbol "$(set_color yellow)\$$normal"
+ end
- # Print prompt
- echo -n -s $ssh_prefix (set_color $fish_color_cwd) (prompt_pwd) \
- $normal (__fish_git_prompt " %s") $normal $__prompt_symbol " "
+ # Print prompt
+ echo -n -s $ssh_prefix (set_color $fish_color_cwd) (prompt_pwd) \
+ $normal (__fish_git_prompt " %s") $normal $__prompt_symbol " "
end