|
|
@@ -985,13 +985,15 @@ How do I center my header/footer?~
|
|
|
|
|
|
Try something along these lines:
|
|
|
>
|
|
|
- function! s:filter_header(lines) abort
|
|
|
- let longest_line = max(map(copy(a:lines), 'strwidth(v:val)'))
|
|
|
- let centered_lines = map(copy(a:lines),
|
|
|
+ function! s:center(lines) abort
|
|
|
+ let longest_line = max(map(copy(a:lines), 'strwidth(v:val)'))
|
|
|
+ let centered_lines = map(copy(a:lines),
|
|
|
\ 'repeat(" ", (&columns / 2) - (longest_line / 2)) . v:val')
|
|
|
- return centered_lines
|
|
|
+ return centered_lines
|
|
|
endfunction
|
|
|
- let g:startify_custom_header = s:filter_header(startify#fortune#cowsay())
|
|
|
+
|
|
|
+ let g:startify_custom_header = s:center(startify#fortune#cowsay())
|
|
|
+ let g:startify_custom_footer = s:center(['foo', 'bar', 'baz'])
|
|
|
<
|
|
|
------------------------------------------------------------------------------
|
|
|
*startify-faq-09*
|