diff options
Diffstat (limited to 'vim/plugin/fortune.vim')
-rw-r--r-- | vim/plugin/fortune.vim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vim/plugin/fortune.vim b/vim/plugin/fortune.vim index 6681312a..e800bfee 100644 --- a/vim/plugin/fortune.vim +++ b/vim/plugin/fortune.vim @@ -1,8 +1,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 * - \ if !argc() && line2byte('$') == -1 | Fortune | endif + \ call s:FortuneVimEnter() augroup END |