1
0
Fork 0

fish, vim, neovim: remove powerline

This commit is contained in:
Von Random 2023-08-21 20:58:02 +03:00
parent 4255130bd5
commit 9be728d5d6
9 changed files with 51 additions and 44 deletions

View file

@ -1,13 +1,13 @@
if ! string match -eq linux $TERM
set prompt_sep \ue0b0
set prompt_bang \n\ (set_color brred)\u266a\
set prompt_bang \n\u266a\
set git_sign \ue0a0
else
set prompt_bang \n\ (set_color brred)\#\
set prompt_bang \n\#\
set git_sign g
end
set color_fg brwhite
set color_user 222222
set color_git_branch 3c3c3c
# git symbols and colors
# [1] unstaged, [2] staged, [3] untracked, [4] conflicts
set symbol_git \~ + ! \*
set color_git yellow blue red purple
set color_git_branch brblack

View file

@ -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

View file

@ -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

View 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

View file

@ -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

View file

@ -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