commands are default color
This commit is contained in:
parent
7eeadeca2a
commit
26caa8e42e
|
@ -188,87 +188,90 @@ end
|
|||
# }}}
|
||||
# Prompt customization{{{
|
||||
|
||||
# Fine, I'll do it myself
|
||||
function fish_vi_cursor;end
|
||||
function fish_mode_prompt;end
|
||||
set fish_color_command default --bold
|
||||
set fish_color_param default
|
||||
|
||||
function _fish_prompt_color -a color
|
||||
# separate line needed for bold normal
|
||||
set_color $color
|
||||
set_color --bold
|
||||
set -e argv[1]
|
||||
echo -en $argv
|
||||
# Fine, I'll do it myself
|
||||
function fish_vi_cursor;end
|
||||
function fish_mode_prompt;end
|
||||
|
||||
function _fish_prompt_color -a color
|
||||
# separate line needed for bold normal
|
||||
set_color $color
|
||||
set_color --bold
|
||||
set -e argv[1]
|
||||
echo -en $argv
|
||||
end
|
||||
|
||||
alias _fish_prompt_accent "_fish_prompt_color '{{@@ color.accent @@}}'"
|
||||
alias _fish_prompt_warn "_fish_prompt_color 'bryellow'"
|
||||
|
||||
alias _fish_prompt_normal "_fish_prompt_color 'normal'"
|
||||
|
||||
function _fish_prompt_git_status
|
||||
git status -s | grep "^$argv[1]" &> /dev/null &&
|
||||
_fish_prompt_color $argv[3] $argv[2]
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
set _status $status
|
||||
|
||||
_fish_prompt_accent $USER
|
||||
_fish_prompt_normal " in "
|
||||
_fish_prompt_accent (prompt_pwd)
|
||||
if fish_vcs_prompt > /dev/null
|
||||
_fish_prompt_normal " on "
|
||||
|
||||
_fish_prompt_git_status '??' '?' '{{@@ color.txt @@}}'
|
||||
_fish_prompt_git_status ' M' '~' '{{@@ color.normal.yellow @@}}'
|
||||
_fish_prompt_git_status ' D' '-' '{{@@ color.normal.red @@}}'
|
||||
_fish_prompt_git_status 'A ' '+' '{{@@ color.normal.green @@}}'
|
||||
_fish_prompt_git_status 'M ' '~' '{{@@ color.normal.green @@}}'
|
||||
|
||||
_fish_prompt_accent (fish_vcs_prompt | string replace -ra ' \(|\)' '')
|
||||
end
|
||||
|
||||
alias _fish_prompt_accent "_fish_prompt_color '{{@@ color.accent @@}}'"
|
||||
alias _fish_prompt_warn "_fish_prompt_color 'bryellow'"
|
||||
echo
|
||||
|
||||
alias _fish_prompt_normal "_fish_prompt_color 'normal'"
|
||||
if test $fish_key_bindings = fish_vi_key_bindings
|
||||
|
||||
function _fish_prompt_git_status
|
||||
git status -s | grep "^$argv[1]" &> /dev/null &&
|
||||
_fish_prompt_color $argv[3] $argv[2]
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
set _status $status
|
||||
|
||||
_fish_prompt_accent $USER
|
||||
_fish_prompt_normal " in "
|
||||
_fish_prompt_accent (prompt_pwd)
|
||||
if fish_vcs_prompt > /dev/null
|
||||
_fish_prompt_normal " on "
|
||||
|
||||
_fish_prompt_git_status '??' '?' '{{@@ color.txt @@}}'
|
||||
_fish_prompt_git_status ' M' '~' '{{@@ color.normal.yellow @@}}'
|
||||
_fish_prompt_git_status ' D' '-' '{{@@ color.normal.red @@}}'
|
||||
_fish_prompt_git_status 'A ' '+' '{{@@ color.normal.green @@}}'
|
||||
_fish_prompt_git_status 'M ' '~' '{{@@ color.normal.green @@}}'
|
||||
|
||||
_fish_prompt_accent (fish_vcs_prompt | string replace -ra ' \(|\)' '')
|
||||
end
|
||||
|
||||
echo
|
||||
|
||||
if test $fish_key_bindings = fish_vi_key_bindings
|
||||
|
||||
# Set cursor shape
|
||||
if test $fish_bind_mode = insert
|
||||
printf '\e[5 q' # Bar
|
||||
else
|
||||
printf '\e[1 q' # Block
|
||||
end
|
||||
|
||||
_fish_prompt_accent (
|
||||
switch $fish_bind_mode
|
||||
case replace_one
|
||||
printf 'o'
|
||||
case default
|
||||
printf 'n'
|
||||
case '*'
|
||||
printf (string match -r '^.' $fish_bind_mode )
|
||||
end | string upper
|
||||
)' '
|
||||
end
|
||||
|
||||
if test $_status -ne 0
|
||||
_fish_prompt_warn $_status' '
|
||||
end
|
||||
|
||||
if test $USER = root
|
||||
_fish_prompt_normal '# '
|
||||
# Set cursor shape
|
||||
if test $fish_bind_mode = insert
|
||||
printf '\e[5 q' # Bar
|
||||
else
|
||||
_fish_prompt_normal '$ '
|
||||
printf '\e[1 q' # Block
|
||||
end
|
||||
|
||||
_update_fzf_colors
|
||||
set_color normal
|
||||
_fish_prompt_accent (
|
||||
switch $fish_bind_mode
|
||||
case replace_one
|
||||
printf 'o'
|
||||
case default
|
||||
printf 'n'
|
||||
case '*'
|
||||
printf (string match -r '^.' $fish_bind_mode )
|
||||
end | string upper
|
||||
)' '
|
||||
end
|
||||
|
||||
# set fish_cursor_default block blink
|
||||
# set fish_cursor_insert line blink
|
||||
# set fish_cursor_replace_one underscore blink
|
||||
# set fish_cursor_visual block
|
||||
if test $_status -ne 0
|
||||
_fish_prompt_warn $_status' '
|
||||
end
|
||||
|
||||
if test $USER = root
|
||||
_fish_prompt_normal '# '
|
||||
else
|
||||
_fish_prompt_normal '$ '
|
||||
end
|
||||
|
||||
_update_fzf_colors
|
||||
set_color normal
|
||||
end
|
||||
|
||||
# set fish_cursor_default block blink
|
||||
# set fish_cursor_insert line blink
|
||||
# set fish_cursor_replace_one underscore blink
|
||||
# set fish_cursor_visual block
|
||||
|
||||
#}}}
|
||||
# Color man pages{{{
|
||||
|
|
Reference in New Issue