aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin/fortune.vim
blob: e800bfee836eb67b3f1d8b4a67cf259efe5afe40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
command! -bar Fortune
      \ call fortune#()

function! s:FortuneVimEnter() abort
  if !argc() && line2byte('$') == -1
    try | Fortune | catch | endtry
  endif
endfunction

augroup fortune
  autocmd!
  autocmd VimEnter *
        \ call s:FortuneVimEnter()
augroup END