Lots of stuff. Working on refactoring

This commit is contained in:
Thomas Loven
2017-10-14 09:47:18 +02:00
parent 8230d22739
commit 1b5423997e
23 changed files with 620 additions and 12 deletions

29
fish/functions/fish_prompt.fish Executable file
View File

@@ -0,0 +1,29 @@
function fish_prompt
set -l status_copy $status
if set -q VIRTUAL_ENV
echo -sn "(" (basename "$VIRTUAL_ENV") ")"
end
# Hostname with unique color
set_color (hostname -s | md5 | cut -c-6)
echo -sn (hostname -s)
# A yellow separator
# The color of this could be used to signify something
set_color yellow
echo -sn ':'
# Contracted path to PWD
set_color normal
echo -sn (prompt_pwd)
# A green or red >, depending on exit status of last command
if test "$status_copy" -ne 0
set_color red
else
set_color green
end
echo -sn ' > '
end