1
1
Fork 0

fish: remove custom prompt

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-12-26 00:25:38 -05:00
parent 8b19ff9470
commit 66f8a9eb17
Signed by: Myned
GPG key ID: C7224454F7881A34

View file

@ -214,72 +214,40 @@ in {
}; };
interactiveShellInit = '' interactiveShellInit = ''
### Prompt
# Disable greeting # Disable greeting
set -g fish_greeting set -g fish_greeting
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
set -l normal (set_color normal)
set -l status_color (set_color brgreen)
set -l cwd_color (set_color $fish_color_cwd)
set -l vcs_color (set_color brpurple)
set -l prompt_status ""
# Since we display the prompt on a new line allow the directory names to be longer.
set -q fish_prompt_pwd_dir_length
or set -lx fish_prompt_pwd_dir_length 0
# Color the prompt differently when we're root
set -l suffix ''
if functions -q fish_is_root_user; and fish_is_root_user
if set -q fish_color_cwd_root
set cwd_color (set_color $fish_color_cwd_root)
end
set suffix '#'
end
# Color the prompt in red on error
if test $last_status -ne 0
set status_color (set_color $fish_color_error)
set prompt_status $status_color "[" $last_status "]" $normal
end
echo -s (prompt_login) ' ' $cwd_color (prompt_pwd) $vcs_color (fish_vcs_prompt) $normal ' ' $prompt_status
echo -n -s $status_color $suffix ' ' $normal
end
### Interactive
# Default is brblack (bright0) # Default is brblack (bright0)
set -g fish_color_autosuggestion brgreen set -g fish_color_autosuggestion brgreen
function exit -d 'Always exit successfully when interactive' ### Interactive
builtin exit 0 # function exit -d 'Always exit successfully when interactive'
end # builtin exit 0
# end
# TODO: Pass flags properly # TODO: Pass flags properly
# TODO: Convert to bash # TODO: Convert to bash
function run -d 'Run packages via nixpkg flakes' # function run -d 'Run packages via nixpkg flakes'
for i in (seq (count $argv)) # for i in (seq (count $argv))
if ! string match -r '^-' -- $argv[$i] # if ! string match -r '^-' -- $argv[$i]
set argv[$i] (string replace -r ^ nixpkgs# $argv[$i]) # set argv[$i] (string replace -r ^ nixpkgs# $argv[$i])
end # end
end # end
nix run $argv # nix run $argv
end # end
function shell -d 'Open packages in new shell via nixpkg flakes' # function shell -d 'Open packages in new shell via nixpkg flakes'
for i in (seq (count $argv)) # for i in (seq (count $argv))
if ! string match -r '^-' -- $argv[$i] # if ! string match -r '^-' -- $argv[$i]
set argv[$i] (string replace -r ^ nixpkgs# $argv[$i]) # set argv[$i] (string replace -r ^ nixpkgs# $argv[$i])
end # end
end # end
nix shell $argv # nix shell $argv
end # end
function activate -d 'Activate Python venv' # function activate -d 'Activate Python venv'
source .venv/bin/activate.fish # source .venv/bin/activate.fish
end # end
''; '';
}; };
}; };