Skip to content

Commit

Permalink
🐞fix: fix stl colro
Browse files Browse the repository at this point in the history
  • Loading branch information
utubo committed Nov 2, 2023
1 parent 2ab02e8 commit b13b8b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ endif
if !a
b:stl_bufinfo = ''
else
b:stl_bufinfo = '%#Cmdheight0Warn#' .. a->join(',') .. '%*'
b:stl_bufinfo = '%#Cmdheight0Warn#' .. a->join(',') .. '%#CmdHeight0#'
endif
enddef
au vimrc BufNew,BufRead,OptionSet * F()
Expand All @@ -186,10 +186,10 @@ var a = v:event.regcontents
->substitute('\t', '', 'g')
->E(20)
->substitute('%', '%%', 'g')
g:stl_reg = $'%#Cmdheight0Info#📋%*{a}'
g:stl_reg = $'%#Cmdheight0Info#📋%#CmdHeight0#{a}'
enddef
au vimrc TextYankPost * G()
g:stl_worktime = '%#Cmdheight0Info#🕛%*'
g:stl_worktime = '%#Cmdheight0Info#🕛'
g:stl_worktime_open_at = get(g:, 'ruler_worktime_open_at', localtime())
def! g:VimrcTimer60s(a: any)
const b = (localtime() - g:stl_worktime_open_at) / 60
Expand All @@ -199,9 +199,9 @@ if c ==# 45
notification#show(" ☕🍴🍰\nHave a break time !")
endif
if g:stl_worktime ==# '🍰'
g:stl_worktime = '%#Cmdheight0Warn#' .. g:stl_worktime .. '%*'
g:stl_worktime = '%#Cmdheight0Warn#' .. g:stl_worktime
else
g:stl_worktime = '%#Cmdheight0Info#' .. g:stl_worktime .. '%*'
g:stl_worktime = '%#Cmdheight0Info#' .. g:stl_worktime
endif
enddef
timer_stop(get(g:, 'vimrc_timer_60s', 0))
Expand All @@ -218,8 +218,8 @@ g:cmdheight0.statusline = ' ' ..
'%{%w:ruler_mdcb|%}' ..
'%{%g:stl_reg|%}' ..
'%3l:%-2c:%L%|' ..
'%{%b:stl_bufinfo|%}' ..
'%{%g:stl_worktime%}' ..
'%{%b:stl_bufinfo|%}%*' ..
'%{%g:stl_worktime%}%*' ..
' '
g:cmdheight0.laststatus = 0
nn ZZ <ScriptCmd>cmdheight0#ToggleZen()<CR>
Expand Down
14 changes: 7 additions & 7 deletions src/.vimrc.src.vim
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def UpdateStlBufInfo()
if !info
b:stl_bufinfo = ''
else
b:stl_bufinfo = '%#Cmdheight0Warn#' .. info->join(',') .. '%*'
b:stl_bufinfo = '%#Cmdheight0Warn#' .. info->join(',') .. '%#CmdHeight0#'
endif
enddef
au vimrc BufNew,BufRead,OptionSet * UpdateStlBufInfo()
Expand All @@ -244,12 +244,12 @@ def UpdateStlRegister()
->substitute('\t', '', 'g')
->TruncToDisplayWidth(20)
->substitute('%', '%%', 'g')
g:stl_reg = $'%#Cmdheight0Info#📋%*{reg}'
g:stl_reg = $'%#Cmdheight0Info#📋%#CmdHeight0#{reg}'
enddef
au vimrc TextYankPost * UpdateStlRegister()

# 毎時vim起動後45分から15分間休憩しようね
g:stl_worktime = '%#Cmdheight0Info#🕛%*'
g:stl_worktime = '%#Cmdheight0Info#🕛'
g:stl_worktime_open_at = get(g:, 'ruler_worktime_open_at', localtime())
def! g:VimrcTimer60s(timer: any)
const hhmm = (localtime() - g:stl_worktime_open_at) / 60
Expand All @@ -260,9 +260,9 @@ def! g:VimrcTimer60s(timer: any)
notification#show(" ☕🍴🍰\nHave a break time !")
endif
if g:stl_worktime ==# '🍰'
g:stl_worktime = '%#Cmdheight0Warn#' .. g:stl_worktime .. '%*'
g:stl_worktime = '%#Cmdheight0Warn#' .. g:stl_worktime
else
g:stl_worktime = '%#Cmdheight0Info#' .. g:stl_worktime .. '%*'
g:stl_worktime = '%#Cmdheight0Info#' .. g:stl_worktime
endif
enddef
timer_stop(get(g:, 'vimrc_timer_60s', 0)) # .vimrc再実行を考慮してタイマーをストップ
Expand All @@ -283,8 +283,8 @@ g:cmdheight0.statusline = ' ' .. # パディング
'%{%w:ruler_mdcb|%}' .. # markdownのチェックボックスの数
'%{%g:stl_reg|%}' .. # レジスタ
'%3l:%-2c:%L%|' .. # カーソル位置
'%{%b:stl_bufinfo|%}' .. # 文字コードと改行コード
'%{%g:stl_worktime%}' .. # 作業時間
'%{%b:stl_bufinfo|%}%*' .. # 文字コードと改行コード
'%{%g:stl_worktime%}%*' .. # 作業時間
' ' # パディング
g:cmdheight0.laststatus = 0
nnoremap ZZ <ScriptCmd>cmdheight0#ToggleZen()<CR>
Expand Down

0 comments on commit b13b8b7

Please sign in to comment.