Make year-split follow different rules
This commit is contained in:
@ -9,26 +9,31 @@ function! GetYearGlyph()
|
|||||||
" 50 - 59 as \*0 - \*9
|
" 50 - 59 as \*0 - \*9
|
||||||
" return %{strftime('%y')}[1]
|
" return %{strftime('%y')}[1]
|
||||||
|
|
||||||
let year= strftime('%Y')
|
let year_= strftime('%Y')
|
||||||
|
let base= 1930
|
||||||
|
let year= year_
|
||||||
let decade= year / 10 % 10
|
let decade= year / 10 % 10
|
||||||
let glyph=
|
let glyph_=
|
||||||
\ ( year % 1000 ) > 100 ? decade :
|
\ ( year < base ) ? "?" :
|
||||||
|
\ ( base + 200 <= year ) ? "?" :
|
||||||
|
\ ( base + 100 > year ) ? decade :
|
||||||
\ decade == 0 ? "`" :
|
\ decade == 0 ? "`" :
|
||||||
\ decade == 1 ? "'" :
|
\ decade == 1 ? "'" :
|
||||||
\ decade == 2 ? '"' :
|
\ decade == 2 ? '"' :
|
||||||
\ decade == 3 ? "^" :
|
\ decade == 3 ? "^" :
|
||||||
\ decade == 4 ? "~" :
|
\ decade == 4 ? "~" :
|
||||||
\ decade == 4 ? "~" :
|
|
||||||
\ decade == 5 ? "+" :
|
\ decade == 5 ? "+" :
|
||||||
\ decade == 6 ? "*" :
|
\ decade == 6 ? "*" :
|
||||||
\ decade == 7 ? "/" :
|
\ decade == 7 ? "/" :
|
||||||
\ decade == 7 ? "%" :
|
\ decade == 8 ? "%" :
|
||||||
\ decade == 7 ? "&" :
|
\ decade == 9 ? "&" :
|
||||||
\ "?"
|
\ "?"
|
||||||
|
|
||||||
let year= year % 10
|
let glyph= glyph_
|
||||||
|
|
||||||
return glyph . year
|
let yearmod= year % 10
|
||||||
|
|
||||||
|
return glyph .. yearmod
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" This is a rebuild of the original vim status line. I'll put the original
|
" This is a rebuild of the original vim status line. I'll put the original
|
||||||
@ -52,4 +57,4 @@ set statusline+=\ Syn:\ %2*%{SyntaxItem()}%0* " Setup syntax highlighting gr
|
|||||||
set statusline+=\ %9*X=%02B " Current char byte val in hex
|
set statusline+=\ %9*X=%02B " Current char byte val in hex
|
||||||
|
|
||||||
"Lastly put the time in classic Magenta, like my TCSH prompt:
|
"Lastly put the time in classic Magenta, like my TCSH prompt:
|
||||||
set statusline+=\ %8*%{GetYearGlyph()}-%{strftime('%m-%d\ %H:%M')}
|
set statusline+=\ %8*%02{GetYearGlyph()}-%{strftime('%m-%d\ %H:%M')}
|
||||||
|
|||||||
Reference in New Issue
Block a user