-
Notifications
You must be signed in to change notification settings - Fork 30
/
robbyrussel.diff
41 lines (35 loc) · 1.22 KB
/
robbyrussel.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/fish_prompt.fish b/fish_prompt.fish
index e1dd548..f58208b 100644
--- a/fish_prompt.fish
+++ b/fish_prompt.fish
@@ -3,6 +3,10 @@
# You can override some default options in your config.fish:
# set -g theme_display_git_untracked no
+if not set -q __fish_prompt_hostname
+ set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
+end
+
function _git_branch_name
echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||')
end
@@ -24,6 +28,7 @@ function fish_prompt
set -l blue (set_color -o blue)
set -l green (set_color -o green)
set -l normal (set_color normal)
+ set -l white (set_color white)
if test $last_status = 0
set arrow "$green➜ "
@@ -34,7 +39,7 @@ function fish_prompt
if [ (_git_branch_name) ]
set -l git_branch $red(_git_branch_name)
- set git_info "$blue git:($git_branch$blue)"
+ set git_info "$blue ($git_branch$blue)"
if [ (_is_git_dirty) ]
set -l dirty "$yellow ✗"
@@ -42,6 +47,7 @@ function fish_prompt
end
end
- echo -n -s $arrow ' ' $cwd $git_info $normal ' '
+ set whoatwhere $cyan'['$white$USER$cyan@''$white$__fish_prompt_hostname$cyan']'
+ echo -n -s $whoatwhere ' ' $arrow '' $cwd $git_info $normal ' '
end