fish, vim, neovim: remove powerline
This commit is contained in:
parent
4255130bd5
commit
9be728d5d6
9 changed files with 51 additions and 44 deletions
|
@ -1,10 +1,12 @@
|
|||
function fish_prompt
|
||||
set -g prompt_string
|
||||
set -g prev_color
|
||||
prompt.add \[
|
||||
prompt.user
|
||||
prompt.add blue (prompt_pwd)
|
||||
prompt.add (prompt_pwd) blue
|
||||
prompt.git
|
||||
prompt.add normal $prompt_bang
|
||||
prompt.add \]
|
||||
prompt.add $prompt_bang brred
|
||||
|
||||
echo $prompt_string
|
||||
set -e prompt_string
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
function prompt.add
|
||||
set -l color $argv[1]
|
||||
set -l text $argv[2]
|
||||
set -l sep ''
|
||||
if test -n "$prompt_sep"
|
||||
set sep (set_color $prev_color)$prompt_sep(set_color $color_fg)
|
||||
set prev_color $color
|
||||
set -l text $argv[1]
|
||||
set -l color $argv[2]
|
||||
if test -n "$color"
|
||||
set value (set_color $color)$text(set_color normal)
|
||||
else
|
||||
set value $text
|
||||
end
|
||||
if test -z "$prompt_string"
|
||||
set prompt_string (set_color -b $color)(set_color $color_fg) $text
|
||||
set prompt_string $value
|
||||
else
|
||||
set -a prompt_string (set_color -b $color)$sep $text
|
||||
set -a prompt_string $value
|
||||
end
|
||||
end
|
||||
|
|
14
cli/.config/fish/functions/prompt.add.pl.fish
Normal file
14
cli/.config/fish/functions/prompt.add.pl.fish
Normal file
|
@ -0,0 +1,14 @@
|
|||
function prompt.add.pl
|
||||
set -l color $argv[1]
|
||||
set -l text $argv[2]
|
||||
set -l sep ''
|
||||
if test -n "$prompt_sep"
|
||||
set sep (set_color $prev_color)$prompt_sep(set_color $color_fg)
|
||||
set prev_color $color
|
||||
end
|
||||
if test -z "$prompt_string"
|
||||
set prompt_string (set_color -b $color)(set_color $color_fg) $text
|
||||
else
|
||||
set -a prompt_string (set_color -b $color)$sep $text
|
||||
end
|
||||
end
|
|
@ -6,7 +6,7 @@ function prompt.git
|
|||
set git_branch (string match -r '[^# .]+' "$line")
|
||||
string match -qr '\[behind' $line && set git_branch "$git_branch?"
|
||||
string match -qr '\[ahead' $line && set git_branch "$git_branch!"
|
||||
prompt.add "$color_git_branch" "$git_sign $git_branch"
|
||||
prompt.add "$git_sign $git_branch" "$color_git_branch"
|
||||
else
|
||||
string match -qr "^.[MD]" "$line" && set git_count[1] (math $git_count[1] + 1)
|
||||
string match -qr "^[MDARC]." "$line" && set git_count[2] (math $git_count[2] + 1)
|
||||
|
@ -14,8 +14,8 @@ function prompt.git
|
|||
string match -qr "^[ADU]{2}" "$line" && set git_count[4] (math $git_count[4] + 1)
|
||||
end
|
||||
end
|
||||
test -n "$git_count[1]" && prompt.add "$color_git[1]" "~$git_count[1]"
|
||||
test -n "$git_count[2]" && prompt.add "$color_git[2]" "+$git_count[2]"
|
||||
test -n "$git_count[3]" && prompt.add "$color_git[3]" "!$git_count[3]"
|
||||
test -n "$git_count[4]" && prompt.add "$color_git[4]" "*$git_count[4]"
|
||||
test -n "$git_count[1]" && prompt.add "$git_count[1]$symbol_git[1]" "$color_git[1]"
|
||||
test -n "$git_count[2]" && prompt.add "$git_count[2]$symbol_git[2]" "$color_git[2]"
|
||||
test -n "$git_count[3]" && prompt.add "$git_count[3]$symbol_git[3]" "$color_git[3]"
|
||||
test -n "$git_count[4]" && prompt.add "$git_count[4]$symbol_git[4]" "$color_git[4]"
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function prompt.user
|
||||
if test -n "$SSH_CONNECTION" || string match -qe root "$USER"
|
||||
prompt.add $color_user $USER@$hostname
|
||||
prompt.add $USER@$hostname
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue