Better prompt and insert mode cursor

This commit is contained in:
Daniel Flanagan 2022-10-11 10:11:23 -05:00
parent f61c18dab1
commit 2ee3c1d62b
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
2 changed files with 8 additions and 4 deletions

View file

@ -18,6 +18,7 @@ end
function fish_prompt function fish_prompt
set last_cmd_status $status set last_cmd_status $status
set prompt_str '$'
if test (id -u) -eq 0 if test (id -u) -eq 0
if test $last_cmd_status -eq 0 if test $last_cmd_status -eq 0
set_color -b blue black set_color -b blue black
@ -25,20 +26,21 @@ function fish_prompt
set_color -b red black set_color -b red black
end end
printf " SUDO $USER@$hostname " printf " SUDO $USER@$hostname "
set prompt_str '#'
else else
if test $last_cmd_status -eq 0 if test $last_cmd_status -eq 0
set_color blue set_color blue
else else
set_color red set_color red
end end
printf %s@%s $USER (echo $hostname | cut -d '.' -f1) printf '%s@%s' $USER (echo $hostname | cut -d '.' -f1)
end end
set_color normal set_color normal
printf " " printf " "
set_color magenta set_color magenta
printf (preprocess_pwd)"" printf "%s" (preprocess_pwd)
set_color normal set_color -b black brblack
printf " " printf "\n$prompt_str "
end end
function fish_mode_prompt; end function fish_mode_prompt; end

View file

@ -12,6 +12,8 @@ set --export --universal BROWSER firefox-developer-edition
set --export --universal PAGER "less" set --export --universal PAGER "less"
set --export --universal MANPAGER "less" set --export --universal MANPAGER "less"
set --universal fish_cursor_insert line
if command --search --quiet helix if command --search --quiet helix
set --export --universal EDITOR helix set --export --universal EDITOR helix
set --export --universal VISUAL helix set --export --universal VISUAL helix