Skip to content

Instantly share code, notes, and snippets.

View DjebbZ's full-sized avatar

Khalid Jebbari DjebbZ

  • Freelance
  • Paris, France
View GitHub Profile
function fish_prompt
set sepcol (set_color -o blue)
set hstcol (set_color -o yellow)
set pthcol (set_color cyan)
set gitcol (set_color normal)
if test $USER = "root"
set usrcol (set_color red)
else
set usrcol (set_color -o green)
end
function fish_right_prompt
set -l delay
set -l now (date +%s)
if set -q __fish_last_prompt
set -g dur (math $now - $__fish_last_prompt)
if test $dur -lt 120
set delay (printf '%ds' $dur)
else if test $dur -lt 3600
set delay (printf '%d:%02d' (math "floor($dur / 60)") (math "$dur % 60"))
else