Marco Hinz 9 лет назад
Родитель
Сommit
994a85ac22
2 измененных файлов с 18 добавлено и 6 удалено
  1. 1 1
      autoload/startify.vim
  2. 17 5
      autoload/startify/fortune.vim

+ 1 - 1
autoload/startify.vim

@@ -70,7 +70,7 @@ function! startify#insane_in_the_membrane() abort
   " Must be global so that it can be read by syntax/startify.vim.
   let g:startify_header = exists('g:startify_custom_header')
         \ ? copy(g:startify_custom_header)
-        \ : startify#fortune#get_random_quote()
+        \ : startify#fortune#cowsay()
   let g:startify_header += ['']  " add blank line
   call append('$', g:startify_header)
 

+ 17 - 5
autoload/startify/fortune.vim

@@ -11,6 +11,7 @@ let s:cow = [
 let s:quotes = exists('g:startify_custom_header_quotes')
       \ ? g:startify_custom_header_quotes
       \ : [
+      \ ["If you don't fail at least 90% of the time, you're not aiming high enough.", '', '- Alan Kay'],
       \ ['I think a lot of new programmers like to use advanced data structures and advanced language features as a way of demonstrating their ability. I call it the lion-tamer syndrome. Such demonstrations are impressive, but unless they actually translate into real wins for the project, avoid them.', '', '- Glyn Williams'],
       \ ['I would rather die of passion than of boredom.', '', '- Vincent Van Gogh'],
       \ ['If a system is to serve the creative spirit, it must be entirely comprehensible to a single individual.'],
@@ -128,14 +129,25 @@ function! s:draw_box(lines) abort
   return lines
 endfunction
 
-" Function: #get_random_quote {{{1
-function! startify#fortune#get_random_quote() abort
-  let quote = s:quotes[s:get_random_offset(len(s:quotes))]
+" Function: #quote {{{1
+function! startify#fortune#quote() abort
+  return s:quotes[s:get_random_offset(len(s:quotes))]
+endfunction
+
+" Function: #boxed {{{1
+function! startify#fortune#boxed() abort
   let wrapped_quote = []
+  let quote = startify#fortune#quote()
   for line in quote
     let wrapped_quote += split(line, '\%50c.\{-}\zs\s', 1)
   endfor
   let wrapped_quote = s:draw_box(wrapped_quote)
-  let wrapped_quote += s:cow
-  return map(wrapped_quote, '"   ". v:val')
+  return wrapped_quote
+endfunction
+
+" Function: #cowsay {{{1
+function! startify#fortune#cowsay() abort
+  let boxed_quote = startify#fortune#boxed()
+  let boxed_quote += s:cow
+  return map(boxed_quote, '"   ". v:val')
 endfunction