diff --git a/cli/.config/fish/functions/prompt.add.fish b/cli/.config/fish/functions/fish_prompt.add.fish similarity index 92% rename from cli/.config/fish/functions/prompt.add.fish rename to cli/.config/fish/functions/fish_prompt.add.fish index fa28bf1..435d5ac 100644 --- a/cli/.config/fish/functions/prompt.add.fish +++ b/cli/.config/fish/functions/fish_prompt.add.fish @@ -1,4 +1,4 @@ -function prompt.add +function fish_prompt.add set -l text $argv[1] set -l color $argv[2] if test -n "$color" diff --git a/cli/.config/fish/functions/prompt.add.pl.fish b/cli/.config/fish/functions/fish_prompt.add.pl.fish similarity index 93% rename from cli/.config/fish/functions/prompt.add.pl.fish rename to cli/.config/fish/functions/fish_prompt.add.pl.fish index b53d54d..57a4b73 100644 --- a/cli/.config/fish/functions/prompt.add.pl.fish +++ b/cli/.config/fish/functions/fish_prompt.add.pl.fish @@ -1,4 +1,4 @@ -function prompt.add.pl +function fish_prompt.add.pl set -l color $argv[1] set -l text $argv[2] set -l sep '' diff --git a/cli/.config/fish/functions/fish_prompt.bang.fish b/cli/.config/fish/functions/fish_prompt.bang.fish new file mode 100644 index 0000000..40ca599 --- /dev/null +++ b/cli/.config/fish/functions/fish_prompt.bang.fish @@ -0,0 +1,7 @@ +function fish_prompt.bang + if ! string match -eq linux $TERM + fish_prompt.add \n$bang_symbol\ brblack + else + fish_prompt.add \n\#\ brred + end +end diff --git a/cli/.config/fish/functions/fish_prompt.emoji.fish b/cli/.config/fish/functions/fish_prompt.emoji.fish new file mode 100644 index 0000000..12cd051 --- /dev/null +++ b/cli/.config/fish/functions/fish_prompt.emoji.fish @@ -0,0 +1,4 @@ +function fish_prompt.emoji + set emoji \U1f41f \U1f420 \U1f421 + printf $emoji[(random 1 (count $emoji))] +end diff --git a/cli/.config/fish/functions/fish_prompt.fish b/cli/.config/fish/functions/fish_prompt.fish index 49dd3ca..29d81cd 100644 --- a/cli/.config/fish/functions/fish_prompt.fish +++ b/cli/.config/fish/functions/fish_prompt.fish @@ -1,12 +1,12 @@ function fish_prompt set -g prompt_string set -g prev_color - prompt.add \[ brblack - prompt.user - prompt.add (prompt_pwd) blue - prompt.git - prompt.add \] brblack - prompt.bang + fish_prompt.add \[ brblack + fish_prompt.user + fish_prompt.add (prompt_pwd) blue + fish_prompt.git + fish_prompt.add \] brblack + fish_prompt.bang echo $prompt_string set -e prompt_string diff --git a/cli/.config/fish/functions/prompt.git.fish b/cli/.config/fish/functions/fish_prompt.git.fish similarity index 65% rename from cli/.config/fish/functions/prompt.git.fish rename to cli/.config/fish/functions/fish_prompt.git.fish index 848a978..01e96f4 100644 --- a/cli/.config/fish/functions/prompt.git.fish +++ b/cli/.config/fish/functions/fish_prompt.git.fish @@ -1,4 +1,4 @@ -function prompt.git +function fish_prompt.git set -l is_git_tree (git rev-parse --is-inside-work-tree 2>/dev/null) string match -qe 'true' "$is_git_tree" || return git status --porcelain -bu | while read line @@ -6,7 +6,7 @@ function prompt.git set git_branch (string match -r '[^# .]+' "$line") string match -qr '\[behind' $line && set git_branch "$git_branch?" string match -qr '\[ahead' $line && set git_branch "$git_branch!" - prompt.add "$git_sign $git_branch" + fish_prompt.add "$git_sign $git_branch" else string match -qr "^.[MD]" "$line" && set git_count[1] (math $git_count[1] + 1) string match -qr "^[MDARC]." "$line" && set git_count[2] (math $git_count[2] + 1) @@ -14,8 +14,8 @@ function prompt.git string match -qr "^[ADU]{2}" "$line" && set git_count[4] (math $git_count[4] + 1) end end - test -n "$git_count[1]" && prompt.add "$git_count[1]$git_status[1]" "$color_git[1]" - test -n "$git_count[2]" && prompt.add "$git_count[2]$git_status[2]" "$color_git[2]" - test -n "$git_count[3]" && prompt.add "$git_count[3]$git_status[3]" "$color_git[3]" - test -n "$git_count[4]" && prompt.add "$git_count[4]$git_status[4]" "$color_git[4]" + test -n "$git_count[1]" && fish_prompt.add "$git_count[1]$git_status[1]" "$color_git[1]" + test -n "$git_count[2]" && fish_prompt.add "$git_count[2]$git_status[2]" "$color_git[2]" + test -n "$git_count[3]" && fish_prompt.add "$git_count[3]$git_status[3]" "$color_git[3]" + test -n "$git_count[4]" && fish_prompt.add "$git_count[4]$git_status[4]" "$color_git[4]" end diff --git a/cli/.config/fish/functions/prompt.user.fish b/cli/.config/fish/functions/fish_prompt.user.fish similarity index 51% rename from cli/.config/fish/functions/prompt.user.fish rename to cli/.config/fish/functions/fish_prompt.user.fish index 7155f98..828fda3 100644 --- a/cli/.config/fish/functions/prompt.user.fish +++ b/cli/.config/fish/functions/fish_prompt.user.fish @@ -1,5 +1,5 @@ -function prompt.user +function fish_prompt.user if test -n "$SSH_CONNECTION" || string match -qe root "$USER" - prompt.add $USER@$hostname brblack + fish_prompt.add $USER@$hostname brblack end end diff --git a/cli/.config/fish/functions/prompt.bang.fish b/cli/.config/fish/functions/prompt.bang.fish deleted file mode 100644 index 6795fe9..0000000 --- a/cli/.config/fish/functions/prompt.bang.fish +++ /dev/null @@ -1,7 +0,0 @@ -function prompt.bang - if ! string match -eq linux $TERM - prompt.add \n$bang_symbol\ brblack - else - prompt.add \n\#\ brred - end -end diff --git a/cli/.config/fish/functions/prompt.fishes.fish b/cli/.config/fish/functions/prompt.fishes.fish deleted file mode 100644 index 413c2ec..0000000 --- a/cli/.config/fish/functions/prompt.fishes.fish +++ /dev/null @@ -1,4 +0,0 @@ -function prompt.fishes - set fishes \U1f41f \U1f420 \U1f421 - printf $fishes[(random 1 (count $fishes))] -end