chore(fish): simplified fish config to be the "same" as my zsh config
This commit is contained in:
parent
4933308689
commit
e0b9a10150
34 changed files with 176 additions and 1188 deletions
33
.config/fish/conf.d/prompt.fish
Normal file
33
.config/fish/conf.d/prompt.fish
Normal file
|
@ -0,0 +1,33 @@
|
|||
function fish_prompt --description 'Write out the prompt'
|
||||
set -l last_status $status
|
||||
set -l normal (set_color $fish_color_normal)
|
||||
set -l status_color (set_color brgreen)
|
||||
set -l cwd_color (set_color $fish_color_cwd)
|
||||
set -l vcs_color (set_color yellow)
|
||||
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 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 $cwd_color (prompt_pwd) $vcs_color (fish_vcs_prompt) $normal ' ' $prompt_status
|
||||
echo -n -s $status_color '❯' ' ' $normal
|
||||
end
|
||||
|
||||
function fish_mode_prompt
|
||||
switch $fish_bind_mode
|
||||
case default
|
||||
set_color --bold red
|
||||
echo '[N] '
|
||||
case visual
|
||||
set_color --bold brmagenta
|
||||
echo '[V] '
|
||||
end
|
||||
set_color normal
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue