Update Fish prompt
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
set -gx fish_greeting
|
||||
|
||||
function nix
|
||||
if test "$argv[1]" = "develop"
|
||||
command nix develop -c fish $argv[2..-1]
|
||||
else if test "$argv[1]" = "shell"
|
||||
env IN_NIX_SHELL=shell command nix $argv
|
||||
else
|
||||
command nix $argv
|
||||
end
|
||||
end
|
||||
function a
|
||||
for arg in $argv
|
||||
if string match -q '*/' $arg
|
||||
|
||||
@@ -1,3 +1,64 @@
|
||||
if test "$KITTY_STR" = "1"
|
||||
if not set -q _FASTFETCH_RUN
|
||||
set -gx _FASTFETCH_RUN 1
|
||||
fastfetch
|
||||
end
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
set -l last_status $status
|
||||
set -l markers
|
||||
set -l user $USER
|
||||
set -l host (hostname)
|
||||
|
||||
if test -n "$IN_NIX_SHELL"
|
||||
if test "$IN_NIX_SHELL" = "shell"
|
||||
set -a markers "nix-shell"
|
||||
else if test "$IN_NIX_SHELL" = "pure"; or test "$IN_NIX_SHELL" = "impure"
|
||||
set -a markers "nix-develop"
|
||||
end
|
||||
end
|
||||
|
||||
if test -n "$VIRTUAL_ENV"
|
||||
set -a markers "venv:"(basename "$VIRTUAL_ENV")
|
||||
end
|
||||
|
||||
if test -n "$CONDA_DEFAULT_ENV"
|
||||
set -a markers "conda:"$CONDA_DEFAULT_ENV
|
||||
end
|
||||
|
||||
if test -n "$BUN_INSTALL"
|
||||
set -a markers "bun"
|
||||
end
|
||||
|
||||
if test $last_status -ne 0
|
||||
set_color ff007c
|
||||
echo -n "[$last_status] "
|
||||
end
|
||||
|
||||
set_color 7aa2f7
|
||||
echo -n "$user"
|
||||
|
||||
set_color white
|
||||
echo -n "@"
|
||||
|
||||
set_color 9ece6a
|
||||
echo -n "$host "
|
||||
|
||||
set_color 89ddff
|
||||
echo -n (prompt_pwd)
|
||||
|
||||
set_color bb9af7
|
||||
echo -n (fish_git_prompt)
|
||||
|
||||
if test (count $markers) -gt 0
|
||||
set_color ff9e64
|
||||
echo -n " ("(string join " " $markers)")"
|
||||
end
|
||||
|
||||
echo
|
||||
set_color 73daca
|
||||
echo -n "λ "
|
||||
|
||||
set_color normal
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user