summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2020-03-24 09:51:50 +0100
committerache <ache@ache.one>2020-03-24 09:51:50 +0100
commit6f1baa370c57b191085827ce8d78c3ec20dfa23a (patch)
tree4a47b6539316786be67b601d1ca4b5269526ff02
parentAdd py command (diff)
Fix prompt new version
-rw-r--r--functions/fish_prompt.fish54
1 files changed, 3 insertions, 51 deletions
diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish
index 01968c9..bea229f 100644
--- a/functions/fish_prompt.fish
+++ b/functions/fish_prompt.fish
@@ -110,38 +110,6 @@ function get_hostname -d "Set current hostname to prompt variable $HOSTNAME_PROM
end
end
-function prompt_shlv -d "Display level shell"
- set pline ''
- if [ "$VIMRUNTIME" != "" ]
- set pline 'vim'
- if [ "$SHLVL" -gt 3 ]
- set pline 'vim:['$SHLVL']'
- end
- else
- if [ "$SHLVL" -gt 2 ]
- set pline '['$SHLVL']'
- end
- end
- if [ $pline != '' ]
- prompt_segment 8C8C8C black "$pline"
- end
-end
-
-function prompt_todo -d "Display todo"
- if which todo ^ /dev/null > /dev/null
- set all (todo | wc -l)
- set chkd (todo checked | wc -l)
- set td (math "$all-$chkd")
-
- if [ $all -gt 0 ]
- prompt_segment 5C5C5C blue "$td/$all"
- end
- end
-end
-
-
-
-
function prompt_dir -d "Display the current directory"
prompt_segment 1C1C1C FFFFFF (prompt_pwd)
@@ -186,7 +154,6 @@ function git_status_summary -d "Deal with git status --porcelain"
}'
end
-
function prompt_git -d "Display the current git state"
set -l ref
if [ -e .git ]
@@ -198,8 +165,6 @@ function prompt_git -d "Display the current git state"
set branch_symbol \uE0A0
set -l branch (echo $ref | sed "s-refs/heads/-$branch_symbol -")
- set -l BG PROMPT
-
set dirty ''
set gstatus ( git status --porcelain -b | git_status_summary )
@@ -220,16 +185,6 @@ function prompt_git -d "Display the current git state"
if [ $behind -gt 0 ]
set dirty $dirty'↓:'$behind' '
end
- if [ $untrkd -gt 0 ]
- set dirty $dirty'U:'$untrkd' '
- end
- if [ $unstdg -gt 0 ]
- set dirty $dirty'?:'$unstdg' '
- end
- if [ $staged -gt 0 ]
- set dirty $dirty'S:'$staged' '
- end
-
if [ $staged -eq 0 -a $untrkd -eq 0 ]
set BG green
@@ -239,12 +194,12 @@ function prompt_git -d "Display the current git state"
# Check if there's any commit in the repo
set -l empty 0
- git rev-parse --quiet --verify HEAD > /dev/null ^&1; or set empty 1
+ git rev-parse --quiet --verify HEAD > /dev/null 2>&1; or set empty 1
set -l target
if [ $empty = 1 ]
# The repo is empty
- set dirty ''
+ set dirty '∅'
set target '4b825dc642cb6eb9a060e54bf8d69288fbee4904'
else
@@ -292,7 +247,7 @@ function prompt_status -d "the symbols for a non zero exit status, root and back
end
function available -a name -d "Check if a function or program is available."
- type "$name" ^/dev/null >&2
+ type "$name" 2> /dev/null >&2
end
function prompt_battery
@@ -325,12 +280,9 @@ end
function fish_prompt
set -g RETVAL $status
prompt_time
- prompt_status
prompt_virtual_env
prompt_user
prompt_dir
- prompt_todo
- prompt_shlv
available git; and prompt_git
prompt_finish
end