From 2ee3c1d62b864f07cb3411f3067cadbbbbcdf835 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 11 Oct 2022 10:11:23 -0500 Subject: [PATCH] Better prompt and insert mode cursor --- common/fish/prompt.fish | 10 ++++++---- common/fish/vars.fish | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/fish/prompt.fish b/common/fish/prompt.fish index e0aceef..d0d46e5 100644 --- a/common/fish/prompt.fish +++ b/common/fish/prompt.fish @@ -18,6 +18,7 @@ end function fish_prompt set last_cmd_status $status + set prompt_str '$' if test (id -u) -eq 0 if test $last_cmd_status -eq 0 set_color -b blue black @@ -25,20 +26,21 @@ function fish_prompt set_color -b red black end printf " SUDO $USER@$hostname " + set prompt_str '#' else if test $last_cmd_status -eq 0 set_color blue else set_color red end - printf %s@%s $USER (echo $hostname | cut -d '.' -f1) + printf '%s@%s' $USER (echo $hostname | cut -d '.' -f1) end set_color normal printf " " set_color magenta - printf (preprocess_pwd)"" - set_color normal - printf " " + printf "%s" (preprocess_pwd) + set_color -b black brblack + printf "\n$prompt_str " end function fish_mode_prompt; end diff --git a/common/fish/vars.fish b/common/fish/vars.fish index 2aef5a7..b5c108e 100644 --- a/common/fish/vars.fish +++ b/common/fish/vars.fish @@ -12,6 +12,8 @@ set --export --universal BROWSER firefox-developer-edition set --export --universal PAGER "less" set --export --universal MANPAGER "less" +set --universal fish_cursor_insert line + if command --search --quiet helix set --export --universal EDITOR helix set --export --universal VISUAL helix