1
0
Fork 0

some experiments

This commit is contained in:
Von Random 2022-12-21 17:59:58 +02:00
parent 235c626ff9
commit a5827a87a2
5 changed files with 32 additions and 23 deletions

View file

@ -86,6 +86,9 @@ let g:lightline = {
let g:lightline['colorscheme'] = printf(lightline_theme) let g:lightline['colorscheme'] = printf(lightline_theme)
if $TERM !~ '^linux' if $TERM !~ '^linux'
if $TERM == 'xterm-256color'
set term=xterm-direct
endif
if has('gui_running') if has('gui_running')
set guifont=Cascadia\ Code\ PL:h16 set guifont=Cascadia\ Code\ PL:h16
set guicursor=a:blinkon0,a:block,i:ver1-Cursor/lCursor,r:hor1-Cursor/lCursor set guicursor=a:blinkon0,a:block,i:ver1-Cursor/lCursor,r:hor1-Cursor/lCursor

View file

@ -1,6 +1,6 @@
local wt = require 'wezterm' local wt = require 'wezterm'
local act = wt.action local act = wt.action
local fontsize_darwin = 15 local fontsize_darwin = 13
local fontsize_others = 11 local fontsize_others = 11
local theme_n = 0 local theme_n = 0
local themes = { local themes = {
@ -70,13 +70,14 @@ wt.on('reset-overrides', function(window) window:set_config_overrides() end)
wt.on('webinar', function(window) window:set_config_overrides(webinar_overrides) end) wt.on('webinar', function(window) window:set_config_overrides(webinar_overrides) end)
return { return {
audible_bell = "Disabled", audible_bell = 'Disabled',
font_size = set_fontsize(), font_size = set_fontsize(),
font = wt.font 'Cascadia Code PL',
color_scheme = default_theme, color_scheme = default_theme,
cursor_blink_rate = 0, cursor_blink_rate = 0,
check_for_updates = false, check_for_updates = false,
use_resize_increments = true,
bold_brightens_ansi_colors = false, bold_brightens_ansi_colors = false,
term = 'wezterm',
window_padding = { window_padding = {
left = 0, right = 0, top = 0, bottom = 0, left = 0, right = 0, top = 0, bottom = 0,
}, },
@ -89,6 +90,10 @@ return {
{ key = 's', mods = 'META', action = act.EmitEvent 'next-theme' }, { key = 's', mods = 'META', action = act.EmitEvent 'next-theme' },
{ key = 'd', mods = 'META', action = act.EmitEvent 'reset-overrides' }, { key = 'd', mods = 'META', action = act.EmitEvent 'reset-overrides' },
{ key = 'w', mods = 'META', action = act.EmitEvent 'webinar' }, { key = 'w', mods = 'META', action = act.EmitEvent 'webinar' },
-- tabs
{ key = 'c', mods = 'LEADER', action = act.SpawnTab 'DefaultDomain' },
{ key = 'n', mods = 'LEADER', action = act.ActivateTabRelative( 1) },
{ key = 'p', mods = 'LEADER', action = act.ActivateTabRelative(-1) },
-- panes -- panes
{ key = 's', mods = 'LEADER', action = act.SplitVertical { domain = 'CurrentPaneDomain' } }, { key = 's', mods = 'LEADER', action = act.SplitVertical { domain = 'CurrentPaneDomain' } },
{ key = 'v', mods = 'LEADER', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' } }, { key = 'v', mods = 'LEADER', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' } },

View file

@ -3,6 +3,7 @@ termcompat() {
case $term in case $term in
(alacritty*) ;& (alacritty*) ;&
(kitty*) ;& (kitty*) ;&
(wezterm) ;&
(xterm-*) (xterm-*)
term=xterm;; term=xterm;;
(rxvt-unicode*) (rxvt-unicode*)

View file

@ -1,10 +1,10 @@
reset='%%{\e[0m%%}' reset='%%{\e[0m%%}'
prompt_fmt='[ %s %s:%s %s]\n\U01f525 ' prompt_fmt='[ %s@%s %s %s]\n\U1f525 '
prompt_fmtn='[ %%{\e[2;3m%%}%s%%{\e[0m%%} ] ' prompt_fmtn='[ %%{\e[2;3m%%}%s%%{\e[0m%%} ] '
prompt_user='%F{%(!.red.blue)}%n%f' prompt_user='%F{%(!.9.12)}%n%f'
prompt_host='%m' prompt_host='%m'
prompt_cwd='%F{green}%d%f' prompt_cwd='%F{10}%d%f'
prompt_git_fmt='\ue0a0 %s %s%%f ' prompt_git_fmt='\ue0a0 %s:%s%%f '
prompt_state_file=/tmp/zsh_gitstatus_$$.tmp prompt_state_file=/tmp/zsh_gitstatus_$$.tmp
printf -v PROMPT $prompt_fmt $prompt_user $prompt_host $prompt_cwd printf -v PROMPT $prompt_fmt $prompt_user $prompt_host $prompt_cwd
@ -31,15 +31,15 @@ precmd.git() {
fi fi
[[ $line[1,2] == '??' ]] && (( untracked_count++ )) [[ $line[1,2] == '??' ]] && (( untracked_count++ ))
[[ $line[1,2] =~ .[MD] ]] && (( unstaged_count++ )) [[ $line[1,2] =~ .[MD] ]] && (( unstaged_count++ ))
[[ $line[1,2] =~ [MDARC]. ]] && (( staged_count++ ))
[[ $line[1,2] =~ [ADU]{2} ]] && (( unmerged_count++ )) [[ $line[1,2] =~ [ADU]{2} ]] && (( unmerged_count++ ))
[[ $line[1,2] =~ [MDARC]. ]] && (( staged_count++ ))
done <<< $raw_status done <<< $raw_status
(( unstaged_count )) && git_status+=%F{yellow}~$unstaged_count (( untracked_count )) && git_status+=\ %F{9}-$untracked_count
(( staged_count )) && git_status+=%F{blue}+$staged_count (( unstaged_count )) && git_status+=\ %F{11}~$unstaged_count
(( untracked_count )) && git_status+=%F{red}-$untracked_count (( unmerged_count )) && git_status+=\ %F{14}*$unmerged_count
(( unmerged_count )) && git_status+=%F{cyan}*$unmerged_count (( staged_count )) && git_status+=\ %F{12}+$staged_count
[[ -z $git_status ]] && git_status=%F{green}ok [[ -z $git_status ]] && git_status=\ %F{10}ok
printf $prompt_git_fmt $branch_status $git_status > $prompt_state_file printf $prompt_git_fmt $branch_status $git_status > $prompt_state_file
} }

View file

@ -5,17 +5,17 @@ printf -v PROMPT4 $prompt_fmtn '+%N:%i'
prompt_fifo=~/.zsh_gitstatus_$$ prompt_fifo=~/.zsh_gitstatus_$$
typeset -A prompt_symbols=( typeset -A prompt_symbols=(
sep_a $'\ue0b0' sep_a '' #$'\ue0b0'
sep_b $'\ue0b1' sep_b '' #$'\ue0b1'
ellipsis $'\u2026' ellipsis $'\u2026'
ro $'\u2717' ro $'\u2717'
ssh $'\u23fb' ssh $'\u23fb'
git $'\ue0a0' git $'\ue0a0'
git_unstaged '±' git_unstaged '~'
git_staged $'\u2713' git_staged $'\u2713'
git_untracked '!' git_untracked '!'
git_unmerged '*' git_unmerged '*'
bang $'\n\U01f525' bang $'\n\U1f525'
) )
# gruvbox # gruvbox
typeset -A prompt_colors=( typeset -A prompt_colors=(
@ -130,7 +130,7 @@ precmd.prompt.git() {
esac esac
done <<< $raw_status done <<< $raw_status
for i in git_unstaged git_untracked git_unmerged git_staged; do for i in git_untracked git_unmerged git_unstaged git_staged; do
(( count[$i] )) && precmd.prompt.add "$count[$i]$prompt_symbols[$i]" $prompt_colors[$i] (( count[$i] )) && precmd.prompt.add "$count[$i]$prompt_symbols[$i]" $prompt_colors[$i]
done done
} }